|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AccountEngine
Account management
| Method Summary | |
|---|---|
void |
addGroup(long accountId,
long groupId)
Adds a usergroup to a user. |
void |
addRole(long accountId,
long roleId)
Adds a role for a user. |
long |
create(Account account,
java.lang.String password)
Creates a new user. |
long |
create(Account account,
java.lang.String password,
boolean hashPassword)
Creates a new user. |
void |
fixContactData()
Create contact data for all accounts that dont have them |
int |
getAccountMatches(java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isActive,
java.lang.Boolean isConfirmed,
java.lang.Long mandatorId,
int[] isInRole,
long[] isInGroup)
Returns number of users matching the parameters. |
java.util.List<UserTicket> |
getActiveUserTickets()
Returns all currently active UserTickets. |
java.util.List<Account> |
getAssignedUsers(long groupId,
int startIdx,
int maxEntries)
Returns all users assigned to a group defined by its unique id. |
long |
getAssignedUsersCount(long groupId,
boolean includeInvisible)
Returns the amount of users within a group. |
java.util.List<UserGroup> |
getGroups(long accountId)
Gets the groups a user is assigned to. |
UserTicket |
getGuestTicket()
Returns a guest user ticket. |
java.lang.String |
getPasswordHash(long accountId)
Load the password hash for the given account ID. |
java.util.List<Role> |
getRoles(long accountId,
RoleLoadMode mode)
Loads all roles that a user is assigned to. |
UserTicket |
getUserTicket()
Gets the user ticket for the current request. |
Account |
load(long id)
Loads a user specified by its unique id. |
Account |
load(java.lang.String loginName)
Loads a user. |
java.util.List<ACLAssignment> |
loadAccountAssignments(long accountId)
Retrives all ACLs assigned to a given account. |
java.util.List<Account> |
loadAll()
Loads all accounts. |
java.util.List<Account> |
loadAll(long mandatorId)
Loads all accounts of a mandator. |
java.util.List<Account> |
loadAll(java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isActive,
java.lang.Boolean isConfirmed,
java.lang.Long mandatorId,
int[] isInRole,
long[] isInGroup,
int startIdx,
int maxEntries)
Loads all users matching the parameters. |
Account |
loadForContactData(FxPK contactDataPK)
Load the account that belongs to the given contact data |
void |
login(java.lang.String username,
java.lang.String password,
boolean takeOver)
Perform a login |
boolean |
loginCheck(java.lang.String username,
java.lang.String password,
UserTicket currentTicket)
Check the password of the currently logged-in user. |
void |
logout()
Logout function. |
void |
remove(long accountId)
Removes a user. |
void |
setGroups(long accountId,
java.util.List<UserGroup> groups)
Sets the groups a user defined by its unique id belongs to. |
void |
setGroups(long accountId,
long... groups)
Sets the groups a user defined by its unique id belongs to. |
void |
setRoles(long accountId,
java.util.List<Role> roles)
Sets the roles a user is in. |
void |
setRoles(long accountId,
long... roles)
Sets the roles a user is in. |
void |
update(long accountId,
java.lang.String password,
java.lang.Long defaultNode,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isConfirmed,
java.lang.Boolean isActive,
java.util.Date validFrom,
java.util.Date validTo,
java.lang.Long lang,
java.lang.String description,
java.lang.Boolean allowMultiLogin,
java.lang.Long contactDataId)
Updates the data of a user specified by its unique id. |
void |
updateUser(long accountId,
java.lang.String password,
boolean hashPassword,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Long lang)
Updates some personal data of the specified user |
void |
updateUser(long accountId,
java.lang.String password,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Long lang)
Updates some personal data of the specified user |
| Method Detail |
|---|
void login(java.lang.String username,
java.lang.String password,
boolean takeOver)
throws FxLoginFailedException,
FxAccountInUseException
username - the usernamepassword - the passwordtakeOver - the take over flag
FxLoginFailedException - on errors
FxAccountInUseException - on errors
boolean loginCheck(java.lang.String username,
java.lang.String password,
UserTicket currentTicket)
throws FxLoginFailedException,
FxDbException
username - the user namepassword - the passwordcurrentTicket - the current UserTicket to check
FxLoginFailedException - on errors
FxDbException - on db errorsjava.util.List<UserTicket> getActiveUserTickets()
void logout()
throws FxLogoutFailedException
FxLogoutFailedException - on errors
Account load(long id)
throws FxApplicationException
id - the unique id of the user to load
be retrieved.
FxNotFoundException - if the user does not exist
FxLoadException - if the load failed
FxApplicationException - on errors
Account load(java.lang.String loginName)
throws FxApplicationException
loginName - the login name of the user to load
FxNotFoundException - if the user does not exist
FxLoadException - if the load failed
FxApplicationException - on errors
Account loadForContactData(FxPK contactDataPK)
throws FxApplicationException
contactDataPK - contact data
FxApplicationException - on errors loading the account or if no account exists for the contact data
java.lang.String getPasswordHash(long accountId)
throws FxApplicationException
accountId - the account ID
FxApplicationException - on errorsUserTicket getUserTicket()
UserTicket getGuestTicket()
java.util.List<UserGroup> getGroups(long accountId)
throws FxApplicationException
accountId - the user to get the groupd for
FxLoadException - if the load failed
FxNotFoundException - if the user does not exist
FxNoAccessException - if the caller lacks the permissions to load the groups
FxApplicationException - on errors
java.util.List<Role> getRoles(long accountId,
RoleLoadMode mode)
throws FxApplicationException
accountId - the unique user id to get the roles formode - MODE_USER: get all roles the USER himself is assigned toFxLoadException - if the load failed
FxNotFoundException - if the user does not exist
FxNoAccessException - if the caller lacks the permissions to load the roles
FxApplicationException - on errors
long create(Account account,
java.lang.String password)
throws FxApplicationException
account - the account to be created. Use an AccountEdit object for easier account creation.password - the user's password
FxCreateException - if the create failed
FxInvalidParameterException - if a parameter is invalid (mandatorId, guiLanguage, contentLanguage)
FxNoAccessException - if the caller lacks the permissions to create the user
FxEntryExistsException - if a user with the given login name already exists
FxApplicationException - on errors
long create(Account account,
java.lang.String password,
boolean hashPassword)
throws FxApplicationException
account - the account to be created. Use an AccountEdit object for easier account creation.password - the user's passwordhashPassword - whether the password should be hashed (set to false for importing users, otherwise
this should always be true)
FxCreateException - if the create failed
FxInvalidParameterException - if a parameter is invalid (mandatorId, guiLanguage, contentLanguage)
FxNoAccessException - if the caller lacks the permissions to create the user
FxEntryExistsException - if a user with the given login name already exists
FxApplicationException - on errors
void remove(long accountId)
throws FxApplicationException
accountId - the id of the user to remove
FxNotFoundException - if the given user does not exist
FxNoAccessException - if the caller lacks the permissions to remove the user
FxRemoveException - if the remove failed
FxApplicationException - on errors
void setRoles(long accountId,
long... roles)
throws FxApplicationException
accountId - the user to set the roles forroles - the roles to set, the array may contain undefined roles (=0) values (which are skipped) to make it
easier to build the list. FxNoAccessException - if the calling user lacks the permissions to set the roles for the given group
FxNotFoundException - if the group does not exist
FxUpdateException - if setting the roles failed
FxApplicationException - on errors
void addRole(long accountId,
long roleId)
throws FxApplicationException
accountId - the user IDroleId - the role ID to be added
FxNoAccessException - if the calling user lacks the permissions to set the roles for the given group
FxNotFoundException - if the group does not exist
FxUpdateException - if setting the roles failed
FxApplicationException - on errors
void setRoles(long accountId,
java.util.List<Role> roles)
throws FxApplicationException
accountId - the user to set the roles forroles - the roles to set, the array may contain ROLE_UNDEFINED (=0) values (which are skipped) to make it
easier to build the list. FxNoAccessException - if the calling user lacks the permissions to set the roles for the given group
FxNotFoundException - if the group does not exist
FxUpdateException - if setting the roles failed
FxApplicationException - on errors
void setGroups(long accountId,
long... groups)
throws FxApplicationException
accountId - the accountIdgroups - the groups the user should belong to
FxNoAccessException - if the calling user lacks the permissions to set the groups
FxNotFoundException - if the user does not exist
FxUpdateException - if setting the groups failed
FxApplicationException - on errors
void addGroup(long accountId,
long groupId)
throws FxApplicationException
accountId - the accountIdgroupId - the groupID to be added
FxNoAccessException - if the calling user lacks the permissions to set the groups
FxNotFoundException - if the user does not exist
FxUpdateException - if setting the groups failed
FxApplicationException - on errors
void setGroups(long accountId,
java.util.List<UserGroup> groups)
throws FxApplicationException
accountId - the accountIdgroups - the groups the user should belong to
FxNoAccessException - if the calling user lacks the permissions to set the groups
FxNotFoundException - if the user does not exist
FxUpdateException - if setting the groups failed
FxApplicationException - on errors
java.util.List<Account> loadAll(java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isActive,
java.lang.Boolean isConfirmed,
java.lang.Long mandatorId,
int[] isInRole,
long[] isInGroup,
int startIdx,
int maxEntries)
throws FxApplicationException
name - (a substring of) the name of the users to load, or null if the name should not filter the resultloginName - (a substring of) the login name of the users to load, or null if the login name should not filter
the resultemail - (a substring of) the email of the users to load, or null if the email should not filter the resultisActive - true|false to restrict by the active flag, or null if the active flag should not filter the resultisConfirmed - true | false to restrict by the confirmed flag, or null if the confirmed flag should not filter
the resultmandatorId - the function returns only users belonging to this mandator. If set to null the mandator of the
calling user is used. GROUP_GLOBAL_SUPERVISOR may use -1 to load users within all mandators, all other callers may
only load users within the mandator they belong to, or a FxNoAccessException is thrown.isInRole - if set the function only loads users which are in all specified roles. The result will be empty
if a invalid role id is used.isInGroup - if set the function only loads users which belong to all specified groups. The result will be empty
if a invalid group id is used.startIdx - the start index in the result, 0 basedmaxEntries - the maximum amount of users returned by the funktion (-1 for all), starting at startIdx
FxNoAccessException - if the caller may not load users of the specified mandator
FxLoadException - if the load failed
FxApplicationException - on errors
java.util.List<Account> loadAll(long mandatorId)
throws FxApplicationException
mandatorId - the mandator ID
FxApplicationException - on errors
java.util.List<Account> loadAll()
throws FxApplicationException
loadAll(long) with the user mandator ID.
FxApplicationException - on errors
int getAccountMatches(java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isActive,
java.lang.Boolean isConfirmed,
java.lang.Long mandatorId,
int[] isInRole,
long[] isInGroup)
throws FxApplicationException
name - (a substring of) the name of the users to load,
or null if the name should not filter the resultloginName - (a substring of) the login name of the users to load,
or null if the login name should not filter the resultemail - (a substring of) the email of the users to load,
or null if the email should not filter the resultisActive - true|false to restrict by the active flag,
or null if the active flag should not filter the resultisConfirmed - true | false to restrict by the confirmed flag,
or null if the confirmed flag should not filter the resultmandatorId - the function returns only users belonging to this mandator. If set to null the mandator of the
calling user is used. GROUP_GLOBAL_SUPERVISOR may use -1 to load users within all mandators,
all other callers may only load users within the mandator they belong to,
or a FxNoAccessException is thrown.isInRole - if set the function only loads users which are in all specified roles.
The result will be empty if an invalid role id is used.isInGroup - if set the function only loads users which belong to all specified groups.
The result will be empty if a invalid group id is used.
FxNoAccessException - if the caller may not load users of the specified mandator
FxLoadException - if the load failed
FxApplicationException - on errors
void update(long accountId,
java.lang.String password,
java.lang.Long defaultNode,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Boolean isConfirmed,
java.lang.Boolean isActive,
java.util.Date validFrom,
java.util.Date validTo,
java.lang.Long lang,
java.lang.String description,
java.lang.Boolean allowMultiLogin,
java.lang.Long contactDataId)
throws FxApplicationException
accountId - the unique id of the user to updatepassword - the new password, or null if the old value should be keptdefaultNode - the new defaultNode, or null if the old value should be keptname - the new name (not unique), or null if the old value should be keptloginName - the new login name (unqiue over all mandators), or null if the old value should be keptemail - the new email, or null if the old value should be keptisConfirmed - the new confirmed state, or null if the old value should be keptisActive - the new active state, or null if the old value should be keptvalidTo - the new valid to date, or null if the old value should be keptvalidFrom - the new valid from date, or null if the old value should be keptlang - the new language, or null if the old value should be keptdescription - the new description, or null if the old value should be keptallowMultiLogin - true if the account may be active more than once at the same
time, may be null to keep the old valuecontactDataId - id of the contact data
FxEntryExistsException - if a user with the given login name already exists
FxNoAccessException - if the caller lacks the permissions to update the user
FxUpdateException - if the update failed
FxNotFoundException - if the user to update does not exist
FxInvalidParameterException - if a parameter was invalid
FxApplicationException - on errors
void updateUser(long accountId,
java.lang.String password,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Long lang)
throws FxApplicationException
accountId - the user to update the data forpassword - the new password to assignname - user nameloginName - the new login name to assignemail - the new e-mail address to assignlang - the new language to assign
FxApplicationException - on errors
void updateUser(long accountId,
java.lang.String password,
boolean hashPassword,
java.lang.String name,
java.lang.String loginName,
java.lang.String email,
java.lang.Long lang)
throws FxApplicationException
accountId - the user to update the data forpassword - the new password to assignhashPassword - whether the password should be hashed (set to false for importing users, otherwise
this should always be true)name - user nameloginName - the new login name to assignemail - the new e-mail address to assignlang - the new language to assign
FxApplicationException - on errors
java.util.List<Account> getAssignedUsers(long groupId,
int startIdx,
int maxEntries)
throws FxApplicationException
groupId - the group to get the users forstartIdx - the start index in the result, 0 basedmaxEntries - the maximum amount of users returned by the funktion (-1 for all), starting at startIdx
FxApplicationException - on errors
FxNoAccessException - if the caller may not see the group
FxLoadException - if the get failed
FxNotFoundException - if the group does not exist
long getAssignedUsersCount(long groupId,
boolean includeInvisible)
throws FxApplicationException
groupId - the group to return the assignment count forincludeInvisible - a group may contain users belonging to a foreign mandator, which are invisible
for the caller (except GLOBAL_SUPERVISOR). This parameter specifies wether to count those invisible
users or not.
FxApplicationException - on errors
FxLoadException - if the load of the count failed
java.util.List<ACLAssignment> loadAccountAssignments(long accountId)
throws FxApplicationException
accountId - the user to get the ACLAssignments for
FxLoadException - if the function failed to load the ACLAssignments
FxNoAccessException - if the calling user may not access the ACLAssignment of the given user
FxApplicationException - on errors
void fixContactData()
throws FxApplicationException
FxApplicationException - on errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||