| com.flexive.shared.interfaces.AccountEngine
All known Subclasses: com.flexive.ejb.beans.AccountEngineBean,
AccountEngine | public interface AccountEngine (Code) | | author: Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) |
Inner Class : enum RoleLoadMode | |
Method Summary | |
long | create(String userName, String loginName, String password, String email, long lang, long mandatorId, boolean isActive, boolean isConfirmed, Date validFrom, Date validTo, long defaultNode, String description, boolean allowMultiLogin, boolean checkUserRoles) Creates a new user. | void | fixContactData() | int | getAccountMatches(String name, String loginName, String email, Boolean isActive, Boolean isConfirmed, Long mandatorId, int[] isInRole, long[] isInGroup) Returns number of users matching the parameters.
The caller may only search users within its own mandator .
Users in the group GROUP_GLOBAL_SUPERVISOR may load users within all mandators.
Parameters: name - (a substring of) the name of the users to load,or null if the name should not filter the result Parameters: loginName - (a substring of) the login name of the users to load,or null if the login name should not filter the result Parameters: email - (a substring of) the email of the users to load,or null if the email should not filter the result Parameters: isActive - true|false to restrict by the active flag,or null if the active flag should not filter the result Parameters: isConfirmed - true | false to restrict by the confirmed flag,or null if the confirmed flag should not filter the result Parameters: mandatorId - the function returns only users belonging to this mandator. | List<UserTicket> | getActiveUserTickets() Returns all currently active UserTickets. | Account[] | getAssignedUsers(long groupId, int startIdx, int maxEntries) Returns all users assigned to a group defined by its unique id.
This function provides the parameters startIdx and maxEntries to allow a page-view of the users
in the GUI. | long | getAssignedUsersCount(long groupId, boolean includeInvisible) Returns the amount of users within a group.
Parameters: groupId - the group to return the assignment count for Parameters: includeInvisible - a group may contain users belonging to a foreign mandator, which are invisiblefor the caller (except GLOBAL_SUPERVISOR). | ArrayList<UserGroup> | getGroupList(long accountId) Gets the groups a user is assigned to. | UserGroupList | getGroups(long accountId) Gets the groups a user is assigned to. | public List<Role> | getRoleList(long accountId, RoleLoadMode mode) Loads all roles that a user is assigned to. | 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.
This function may be called by anyone and performs no security checks.
Parameters: id - the unique id of the user to loadbe retrieved. | Account | load(String loginName) Loads a user. | ACLAssignment[] | loadAccountAssignments(long accountId) Retrives all ACLs assigned to a given account. | Account[] | loadAll(String name, String loginName, String email, Boolean isActive, Boolean isConfirmed, Long mandatorId, int[] isInRole, long[] isInGroup, int startIdx, int maxEntries) Loads all users matching the parameters.
The Name, LoginName and Email are compared case insensitive.
The caller may only search users within its own mandator .
Users in the group GROUP_GLOBAL_SUPERVISOR may load users within all mandators.
Parameters: name - (a substring of) the name of the users to load, or null if the name should not filter the result Parameters: loginName - (a substring of) the login name of the users to load, or null if the login name should not filterthe result Parameters: email - (a substring of) the email of the users to load, or null if the email should not filter the result Parameters: isActive - true|false to restrict by the active flag, or null if the active flag should not filter the result Parameters: isConfirmed - true | false to restrict by the confirmed flag, or null if the confirmed flag should not filterthe result Parameters: mandatorId - the function returns only users belonging to this mandator. | Account[] | loadAll(long mandatorId) Loads all accounts of a mandator. | Account | loadForContactData(FxPK contactDataPK) | void | login(String username, String password, boolean takeOver) | void | logout() Logout function. | void | remove(long accountId) Removes a user. | void | setGroupList(long accountId, List<UserGroup> groups) | void | setGroups(long accountId, long[] groups) Sets the groups a user defined by its unique id belongs to.
The caller must be in role ROLE_GROUP_MANAGEMENT or AccountManagement, and may
only update users belonging to his mandator. | void | setRoleList(long accountId, List<Role> roles) Sets the roles a user is in.
To set roles the caller must be in role ROLE_ROLE_MANAGEMENT, and may only update users belonging
to his mandator. | void | setRoles(long accountId, long... roles) Sets the roles a user is in.
To set roles the caller must be in role AccountManagement, and may only update users belonging
to his mandator. | void | update(long accountId, String password, Long defaultNode, String name, String loginName, String email, Boolean isConfirmed, Boolean isActive, Date validFrom, Date validTo, Long lang, String description, Boolean allowMultiLogin, Long contactDataId) Updates the data of a user specified by its unique id. | void | updateUser(long accountId, String password, String name, String loginName, String email, Long lang) |
create | long create(String userName, String loginName, String password, String email, long lang, long mandatorId, boolean isActive, boolean isConfirmed, Date validFrom, Date validTo, long defaultNode, String description, boolean allowMultiLogin, boolean checkUserRoles) throws FxApplicationException(Code) | | Creates a new user.
Role and Groups can be added after creation.
Only callers in ROLE_USER_MANAGEMENTS may create users, and only for their mandatorId.
GLOBAL_SUPERVISOR may create users for all mandators.
Parameters: userName - the name of the user, not unique Parameters: loginName - the unqiue (over all mandators) login name of the user Parameters: password - the password of the user Parameters: email - the email of the user Parameters: lang - the language of the user Parameters: mandatorId - the mandatorId of the user Parameters: isActive - the active flag of the user Parameters: isConfirmed - the confirmed flag of the user Parameters: validFrom - the valid from date Parameters: validTo - the valid to date Parameters: defaultNode - the desired start node in the tree for the user Parameters: description - description for the user Parameters: allowMultiLogin - if true more than one client may login with this account at the same time Parameters: checkUserRoles - perform checks if the calling user is a member of valid roles, should only be disabled ifcalled from run-once scripts or the like the ID of the created user throws: FxCreateException - if the create failed throws: FxInvalidParameterException - if a parameter is invalid (mandatorId, guiLanguage, contentLanguage) throws: FxNoAccessException - if the caller lacks the permissions to create the user throws: FxEntryExistsException - if a user with the given login name already exists throws: FxApplicationException - on errors |
getAccountMatches | int getAccountMatches(String name, String loginName, String email, Boolean isActive, Boolean isConfirmed, Long mandatorId, int[] isInRole, long[] isInGroup) throws FxApplicationException(Code) | | Returns number of users matching the parameters.
The caller may only search users within its own mandator .
Users in the group GROUP_GLOBAL_SUPERVISOR may load users within all mandators.
Parameters: name - (a substring of) the name of the users to load,or null if the name should not filter the result Parameters: loginName - (a substring of) the login name of the users to load,or null if the login name should not filter the result Parameters: email - (a substring of) the email of the users to load,or null if the email should not filter the result Parameters: isActive - true|false to restrict by the active flag,or null if the active flag should not filter the result Parameters: isConfirmed - true | false to restrict by the confirmed flag,or null if the confirmed flag should not filter the result Parameters: mandatorId - the function returns only users belonging to this mandator. If set to null the mandator of thecalling 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. Parameters: 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. Parameters: 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. The number of users matching the given parameters throws: FxNoAccessException - if the caller may not load users of the specified mandator throws: FxLoadException - if the load failed throws: FxApplicationException - on errors |
getActiveUserTickets | List<UserTicket> getActiveUserTickets()(Code) | | Returns all currently active UserTickets.
all active UserTickets |
getAssignedUsers | Account[] getAssignedUsers(long groupId, int startIdx, int maxEntries) throws FxApplicationException(Code) | | Returns all users assigned to a group defined by its unique id.
This function provides the parameters startIdx and maxEntries to allow a page-view of the users
in the GUI. This is neccesarry since a group may contain many thousands of users, which should
not be transfered at once to the client.
The caller may only see groups of the mandator he belongs to plus GROUP_EVERYONE and GROUPE_PRIVATE.
GLOBAL_SUPERVISOR may see the groups/users of all mandators.
Parameters: groupId - the group to get the users for Parameters: startIdx - the start index in the result, 0 based Parameters: maxEntries - the maximum amount of users returned by the funktion (-1 for all), starting at startIdx all users assigned to the given group throws: FxApplicationException - on errors throws: FxNoAccessException - if the caller may not see the group throws: FxLoadException - if the get failed throws: FxNotFoundException - if the group does not exist |
getAssignedUsersCount | long getAssignedUsersCount(long groupId, boolean includeInvisible) throws FxApplicationException(Code) | | Returns the amount of users within a group.
Parameters: groupId - the group to return the assignment count for Parameters: includeInvisible - a group may contain users belonging to a foreign mandator, which are invisiblefor the caller (except GLOBAL_SUPERVISOR). This parameter specifies wether to count those invisibleusers or not. the amount of users belonging to the group throws: FxApplicationException - on errors throws: FxLoadException - if the load of the count failed |
getRoleList | public List<Role> getRoleList(long accountId, RoleLoadMode mode) throws FxApplicationException(Code) | | Loads all roles that a user is assigned to.
Users may only query roles of users within the same mandator domain.
GLOBAL_SUPERVISOR may get the roles of all users.
Parameters: accountId - the unique user id to get the roles for Parameters: mode - MODE_USER: get all roles the USER himself is assigned to MODE_GROUPS: get all roles from the groups that the user belongs to MODE_ALL: get all roles the user belongs to from his groups, or direct assignment the roles assigned to the given user throws: FxLoadException - if the load failed throws: FxNotFoundException - if the user does not exist throws: FxNoAccessException - if the caller lacks the permissions to load the roles throws: FxApplicationException - on errors |
getRoles | Role[] getRoles(long accountId, RoleLoadMode mode) throws FxApplicationException(Code) | | Loads all roles that a user is assigned to.
Users may only query roles of users within the same mandator domain.
GLOBAL_SUPERVISOR may get the roles of all users.
Parameters: accountId - the unique user id to get the roles for Parameters: mode - MODE_USER: get all roles the USER himself is assigned to MODE_GROUPS: get all roles from the groups that the user belongs to MODE_ALL: get all roles the user belongs to from his groups, or direct assignment the roles assigned to the given user throws: FxLoadException - if the load failed throws: FxNotFoundException - if the user does not exist throws: FxNoAccessException - if the caller lacks the permissions to load the roles throws: FxApplicationException - on errors |
getUserTicket | UserTicket getUserTicket()(Code) | | Gets the user ticket for the current request.
the user ticket for the current request. |
loadAccountAssignments | ACLAssignment[] loadAccountAssignments(long accountId) throws FxApplicationException(Code) | | Retrives all ACLs assigned to a given account.
A empty resultset is returned if the account does not exist.
A user may only see his own ACLAssignment.
MANDATOR_FLEXIVE may retrive ACLAssignments for all his users.
GLOBAL_SUPERVISOR may retrive the ACLAssignments of all users.
Parameters: accountId - the user to get the ACLAssignments for the ACLAssignments of the user throws: FxLoadException - if the function failed to load the ACLAssignments throws: FxNoAccessException - if the calling user may not access the ACLAssignment of the given user throws: FxApplicationException - on errors |
loadAll | Account[] loadAll(String name, String loginName, String email, Boolean isActive, Boolean isConfirmed, Long mandatorId, int[] isInRole, long[] isInGroup, int startIdx, int maxEntries) throws FxApplicationException(Code) | | Loads all users matching the parameters.
The Name, LoginName and Email are compared case insensitive.
The caller may only search users within its own mandator .
Users in the group GROUP_GLOBAL_SUPERVISOR may load users within all mandators.
Parameters: name - (a substring of) the name of the users to load, or null if the name should not filter the result Parameters: loginName - (a substring of) the login name of the users to load, or null if the login name should not filterthe result Parameters: email - (a substring of) the email of the users to load, or null if the email should not filter the result Parameters: isActive - true|false to restrict by the active flag, or null if the active flag should not filter the result Parameters: isConfirmed - true | false to restrict by the confirmed flag, or null if the confirmed flag should not filterthe result Parameters: mandatorId - the function returns only users belonging to this mandator. If set to null the mandator of thecalling user is used. GROUP_GLOBAL_SUPERVISOR may use -1 to load users within all mandators, all other callers mayonly load users within the mandator they belong to, or a FxNoAccessException is thrown. Parameters: isInRole - if set the function only loads users which are in all specified roles. The result will be emptyif a invalid role id is used. Parameters: isInGroup - if set the function only loads users which belong to all specified groups. The result will be emptyif a invalid group id is used. Parameters: startIdx - the start index in the result, 0 based Parameters: maxEntries - the maximum amount of users returned by the funktion (-1 for all), starting at startIdx all matching accounts throws: FxNoAccessException - if the caller may not load users of the specified mandator throws: FxLoadException - if the load failed throws: FxApplicationException - on errors |
loadForContactData | Account loadForContactData(FxPK contactDataPK) throws FxApplicationException(Code) | | Load the account that belongs to the given contact data
Parameters: contactDataPK - contact data the account that belongs to the given contact data throws: FxApplicationException - on errors loading the account or if no account exists for the contact data |
remove | void remove(long accountId) throws FxApplicationException(Code) | | Removes a user.
The caller must be in role AccountManagement to remove a user belonging to his mandator.
GlobalSupervisor may remove users belonging to any mandator.
USER_GUEST and USER_GLOBAL_SUPERVISOR may not be removed in any case.
Parameters: accountId - the id of the user to remove throws: FxNotFoundException - if the given user does not exist throws: FxNoAccessException - if the caller lacks the permissions to remove the user throws: FxRemoveException - if the remove failed throws: FxApplicationException - on errors |
setGroups | void setGroups(long accountId, long[] groups) throws FxApplicationException(Code) | | Sets the groups a user defined by its unique id belongs to.
The caller must be in role ROLE_GROUP_MANAGEMENT or AccountManagement, and may
only update users belonging to his mandator. He may only assign groups that also belong to
his mandator, plus GROUP_EVERYONE and GROUP_OWNER.
GROUP_GLOBAL_SUPERVISOR may set all groups for all users.
Parameters: accountId - the accountId to get the lifecycle for Parameters: groups - the groups the user should belong to throws: FxNoAccessException - if the calling user lacks the permissions to set the groups throws: FxNotFoundException - if the user does not exist throws: FxUpdateException - if setting the groups failed throws: FxApplicationException - on errors |
setRoleList | void setRoleList(long accountId, List<Role> roles) throws FxApplicationException(Code) | | Sets the roles a user is in.
To set roles the caller must be in role ROLE_ROLE_MANAGEMENT, and may only update users belonging
to his mandator. GROUP_GLOBAL_SUPERVISOR may set the roles for all users in the system.
Parameters: accountId - the user to set the roles for Parameters: roles - the roles to set, the array may contain ROLE_UNDEFINED (=0) values (which are skipped) to make iteasier to build the list. Duplicated roles are discarded. throws: FxNoAccessException - if the calling user lacks the permissions to set the roles for the given group throws: FxNotFoundException - if the group does not exist throws: FxUpdateException - if setting the roles failed throws: FxApplicationException - on errors |
setRoles | void setRoles(long accountId, long... roles) throws FxApplicationException(Code) | | Sets the roles a user is in.
To set roles the caller must be in role AccountManagement, and may only update users belonging
to his mandator. GlobalSupervisor may set the roles for all users in the system.
Parameters: accountId - the user to set the roles for Parameters: roles - the roles to set, the array may contain undefined roles (=0) values (which are skipped) to make iteasier to build the list. Duplicated roles are discarded. throws: FxNoAccessException - if the calling user lacks the permissions to set the roles for the given group throws: FxNotFoundException - if the group does not exist throws: FxUpdateException - if setting the roles failed throws: FxApplicationException - on errors |
update | void update(long accountId, String password, Long defaultNode, String name, String loginName, String email, Boolean isConfirmed, Boolean isActive, Date validFrom, Date validTo, Long lang, String description, Boolean allowMultiLogin, Long contactDataId) throws FxApplicationException(Code) | | Updates the data of a user specified by its unique id.
Only callers in ROLE_USER_MANAGEMENTS may create users, and only for their mandator.
GLOBAL_SUPERVISOR may create users for all mandators.
Any user can change HIS OWN password, email, contentLanguage and guiLanguage using this function,
but setting any other parameters will cause a FxNoAccessException.
Parameters: accountId - the unique id of the user to update Parameters: password - the new password, or null if the old value should be kept Parameters: defaultNode - the new defaultNode, or null if the old value should be kept Parameters: name - the new name (not unique), or null if the old value should be kept Parameters: loginName - the new login name (unqiue over all mandators), or null if the old value should be kept Parameters: email - the new email, or null if the old value should be kept Parameters: isConfirmed - the new confirmed state, or null if the old value should be kept Parameters: isActive - the new active state, or null if the old value should be kept Parameters: validTo - the new valid to date, or null if the old value should be kept Parameters: validFrom - the new valid from date, or null if the old value should be kept Parameters: lang - the new language, or null if the old value should be kept Parameters: description - the new description, or null if the old value should be kept Parameters: allowMultiLogin - true if the account may be active more than once at the sametime, may be null to keep the old value Parameters: contactDataId - id of the contact data throws: FxEntryExistsException - if a user with the given login name already exists throws: FxNoAccessException - if the caller lacks the permissions to update the user throws: FxUpdateException - if the update failed throws: FxNotFoundException - if the user to update does not exist throws: FxInvalidParameterException - if a parameter was invalid throws: FxApplicationException - on errors |
updateUser | void updateUser(long accountId, String password, String name, String loginName, String email, Long lang) throws FxApplicationException(Code) | | Updates some personal data of the specified user
Parameters: accountId - the user to update the data for Parameters: password - the new password to assign Parameters: name - user name Parameters: loginName - the new login name to assign Parameters: email - the new e-mail address to assign Parameters: lang - the new language to assign throws: FxApplicationException - on errors |
|
|