| java.lang.Object es.udc.mypersonalizer.kernel.model.repository.sql.storers.UserGroupStorer
UserGroupStorer | public class UserGroupStorer (Code) | | This "storer" class stores and removes UserGroup s in the
database.
author: Abel Iago Toral Quiroga author: Abel Muinho since: 1.0 |
Method Summary | |
public UserGroup | addGroup(Connection connection, UserGroup userGroup) Adds a new group of users.
Parameters: connection - the connection to the database Parameters: userGroup - a UserGroup representing the new groupof users throws: InternalErrorException - if a failure is detected. | public void | addUserToGroup(Connection connection, String loginName, Long userGroupIdentifier) Adds a user to a group.
Parameters: connection - the connection to the database Parameters: loginName - the user's login name. Parameters: userGroupIdentifier - the group where to add the user. throws: InternalErrorException - if a failure is detected. | public Collection | findAllGroups(Connection connection, int startIndex, int count) Finds all groups. | public Collection | findAllGroupsAssignedToUser(Connection connection, String loginName, int startIndex, int count) Finds all groups assigned to a user. | public Collection | findAllUsersAssignedToGroup(Connection connection, Long groupId, int startIndex, int count) Finds all users assigned to a group. | public UserGroup | findGroup(Connection connection, Long userGroupIdentifier) Finds a specific group by its identifier.
Parameters: connection - the connection to the database Parameters: userGroupIdentifier - the user group identifier throws: InternalErrorException - if a failure is detected. | public UserGroup | findGroupByName(Connection connection, String userGroupName) Finds a specific group by its name.
Parameters: connection - the connection to the database Parameters: userGroupName - the user group name. throws: InternalErrorException - if a failure is detected. | public boolean | groupExists(Connection connection, Long userGroupIdentifier) Checks if a group exists. | public boolean | groupExists(Connection connection, String userGroupName) Checks if a group exists. | public void | removeAllGroupAssignments(Connection connection, String loginName) Removes all groups assignments for a given user. | public void | removeGroup(Connection connection, Long userGroupIdentifier) Removes a user group and the user assignments to it.
Parameters: connection - the connection to the database Parameters: userGroupIdentifier - the group to remove throws: InternalErrorException - if a failure is detected. | public void | removeUserFromGroup(Connection connection, String loginName, Long userGroupIdentifier) Removes a user from a group
Parameters: connection - the connection to the database Parameters: loginName - the user's login name. Parameters: userGroupIdentifier - the group where to remove the user throws: InternalErrorException - if a failure is detected. | public void | updateGroup(Connection connection, UserGroup userGroup) Updates data of a user group
Parameters: connection - the connection to the database Parameters: userGroup - the updated user group information throws: InternalErrorException - if a failure is detected. | public boolean | userIsAssignedToGroup(Connection connection, String loginName, Long userGroupIdentifier) Checks if a user is assigned to a group. |
findAllGroups | public Collection findAllGroups(Connection connection, int startIndex, int count) throws InternalErrorException(Code) | | Finds all groups. Implements Page-by-Page Iterator design pattern.
Parameters: connection - the connection to the database Parameters: startIndex - the index of the group fromwhich start to retrive groups. Parameters: count - the number of groups to retrive begining in the startIndex group. throws: InternalErrorException - if a failure is detected. a Collection of UserGroup objects. |
findAllGroupsAssignedToUser | public Collection findAllGroupsAssignedToUser(Connection connection, String loginName, int startIndex, int count) throws InternalErrorException(Code) | | Finds all groups assigned to a user. Implements Page-by-Page Iterator
design pattern.
Parameters: connection - the connection to the database Parameters: loginName - the user's login name. Parameters: startIndex - the index of the group assigned to this user fromwhich start to retrive groups. Parameters: count - the number of groups to retrive begining in the startIndex group. If count is < 0, then will returnall the remaining user groups from startIndex. throws: InternalErrorException - if a failure is detected. a Collection of UserGroup objectsrepresenting groups assigned to this user. |
findAllUsersAssignedToGroup | public Collection findAllUsersAssignedToGroup(Connection connection, Long groupId, int startIndex, int count) throws InternalErrorException(Code) | | Finds all users assigned to a group. Implements Page-by-Page Iterator
design pattern.
Parameters: connection - the connection to the database Parameters: groupId - the groupIdentifier. Parameters: startIndex - the index of the user assigned to this user group fromwhich start to retrive users. Parameters: count - the number of users to retrive begining in the startIndex user. throws: InternalErrorException - if a failure is detected. a Collection with the login names of theusers assigned to the group. |
groupExists | public boolean groupExists(Connection connection, Long userGroupIdentifier) throws InternalErrorException(Code) | | Checks if a group exists.
Parameters: connection - the connection to the database Parameters: userGroupIdentifier - the user group identifier true if the group exists,false otherwise throws: InternalErrorException - if a failure is detected. |
groupExists | public boolean groupExists(Connection connection, String userGroupName) throws InternalErrorException(Code) | | Checks if a group exists.
Parameters: connection - the connection to the database Parameters: userGroupName - the user group name true if the group exists,false otherwise throws: InternalErrorException - if a failure is detected. |
removeAllGroupAssignments | public void removeAllGroupAssignments(Connection connection, String loginName) throws InternalErrorException(Code) | | Removes all groups assignments for a given user.
Parameters: connection - the connection to the database. Parameters: loginName - the user login name. throws: InternalErrorException - if a failure is detected. |
userIsAssignedToGroup | public boolean userIsAssignedToGroup(Connection connection, String loginName, Long userGroupIdentifier) throws InternalErrorException(Code) | | Checks if a user is assigned to a group.
Parameters: connection - the connection to the database Parameters: loginName - the login name of the user Parameters: userGroupIdentifier - the user group identifier true if the user is assigned to the group,false otherwise throws: InternalErrorException - if a failure is detected. |
|
|