|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GroupManager
This type contains CRUD methods on the Group instances, and provides methods to link and unlink
Users to Groups, and to query the set of Users in a given Group.
GroupManager instance that require a Group parameter are allowed
to assume that such a instance has been obtained through the methods of the same
GroupManager instance. If this is not the case, then an implementation may throw an unchecked
exception to indicate a programming error. The same holds for the parameters of the User type:
implementations may assume that these have been created by the UserManager that has been obtained
by the Realm through which this GroupManager has been obtained.
| Method Summary | |
|---|---|
void |
addTo(User user,
Group group)
Adds the given user to the given group. |
Group |
create(java.lang.String name)
Creates a new group with the given name. |
GroupSearchFilter |
createFilter(java.lang.String name)
Creates a group filter for the given name pattern. |
SortOptions<GroupSortBy> |
createSortOptions(boolean isAscending,
GroupSortBy sortBy)
Creates a sort options instance. |
void |
delete(Group group)
Deletes the given group. |
SearchResult<Group> |
find(GroupSearchFilter groupSearchFilter,
SortOptions<GroupSortBy> sortOptions)
Queries the groups according to the given search filter. |
Group |
get(java.lang.String idString)
Gets a group instance from the given identifier string. |
java.util.List<User> |
getUsers(Group group)
Retrieves all users in a given group. |
void |
removeFrom(User user,
Group group)
Removes the given user from the given group. |
void |
update(Group group)
Updates the given group in the persistent storage. |
| Method Detail |
|---|
Group create(java.lang.String name)
throws UserManagementException
name - the name of the new group
Group
UserManagementException - if no group could be created for another reasonGroupSearchFilter createFilter(java.lang.String name)
null then the filter
will return all groups. This method is useful for creating a filter that can be given to the
find(GroupSearchFilter, SortOptions) method.
name - a string which must be a substring of the group name, which may be null
GroupSearchFilter
SortOptions<GroupSortBy> createSortOptions(boolean isAscending,
GroupSortBy sortBy)
find(GroupSearchFilter, SortOptions) method.
isAscending - the isAscending value for the sort options (only relevant if sortBy is not
nullsortBy - the data by which must be sorted (may be null)
SearchResult<Group> find(GroupSearchFilter groupSearchFilter,
SortOptions<GroupSortBy> sortOptions)
throws UserManagementException
groupSearchFilter - the search filter, may be null in which case all groups are returnedsortOptions - the sort options for the result set, may be null in which case the order is
unspecified
SearchResult for the filter sorted according to the given sort options
UserManagementException - on error
void update(Group group)
throws UserManagementException
group - the Group to update
UserManagementException - on error
void delete(Group group)
throws UserManagementException
group - the Group to delete
UserManagementException - on error
void addTo(User user,
Group group)
throws UserManagementException
user - the User to addgroup - the Group to add the User to
UserManagementException - on error
void removeFrom(User user,
Group group)
throws UserManagementException
user - the User to removegroup - the Group to remove the User from
UserManagementException - on error
java.util.List<User> getUsers(Group group)
throws UserManagementException
group - the Group to get the users for
User instances in the given group
UserManagementException - on error
Group get(java.lang.String idString)
throws UserManagementException
Group#getId()#toString() on a Group instance which has been created by a
GroupManager instance. This implementation checks that the group still exists in the persistence
store.
idString - the id string to use to create a Group instance
Group instance which can be used with the methods of this manager
UserManagementException - on error (e.g., the group has been deleted or belongs to another realm)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||