|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GroupService
Service that provides methods to manage lifecycle of a group within SAS Drug Development.
A group is a collection of principals (users or other groups) and may be identified by a name and context. Group is
associated with and scoped to a context where it is defined. Group contexts are objects that are implement the
GroupContext interface. See GroupContext
. Examples of group contexts are Organization, Project and Analysis.
Method Summary | |
---|---|
Group |
createGroup(GroupContext groupContext,
String groupName,
String groupDescription,
Set<Principal> members)
Create a new group. |
void |
deleteGroup(GroupDescriptor groupDescriptor)
Delete a group. |
Set<GroupDescriptor> |
getAllGroupsByMember(Principal member)
Get all groups that have the specified principal as a member. |
Set<GroupDescriptor> |
getAllReachableGroupsByMember(Principal member)
Returns a set of all reachable groups. |
Group |
getGroup(GroupDescriptor groupDescriptor)
Get the client representation of a group given its descriptor. |
Group |
getGroupByIdentifier(String identifier)
Get the client representation of a group given its identifier. |
Group |
getGroupByName(GroupContext groupContext,
String name)
Get the client representation of a group given its name and context. |
GroupDescriptor |
getGroupDescriptorByIdentifier(String identifier)
Get the light-weight representation of a group given its identifier. |
GroupDescriptor |
getGroupDescriptorByName(GroupContext groupContext,
String name)
Get the light-weight representation of a group given its name and context. |
Set<GroupDescriptor> |
getGroupDescriptors(GroupContext groupContext)
Get the light-weight representation of all groups defined in a given context |
Set<GroupDescriptor> |
getGroupDescriptorsByIdentifiers(Set<String> identifiers)
Get the light-weight representation of a group given its identifier. |
Set<Group> |
getGroups(GroupContext groupContext)
Get all the groups defined in a given context |
Set<Group> |
getGroupsByIdentifiers(Set<String> identifiers)
Get all the groups specified by the list of identifiers |
Set<GroupDescriptor> |
getGroupsByMember(GroupContext groupContext,
Principal member)
Get all groups in a given context that have the specified principal as a member. |
Set<GroupDescriptor> |
getReachableGroupsByMember(GroupContext groupContext,
Principal member)
Returns a set of all reachable groups in the specified context. |
boolean |
groupExists(GroupContext groupContext,
String name)
Does a group exist? |
boolean |
isMember(String identifier,
Principal member)
Test to see if a given principal is an explicit member of the group, using the group identifier specified. |
void |
removeFromGroupContextGroups(GroupContext groupContext,
Set<Principal> members)
Remove the specified members from all groups in a specific context. |
void |
removeFromGroups(Principal member)
Remove the specified member from all groups. |
Group |
updateGroup(Group group)
Update the definition of an existing group. |
Method Detail |
---|
Group createGroup(GroupContext groupContext, String groupName, String groupDescription, Set<Principal> members) throws GroupContextNotFoundException, GroupExistsException, InvalidGroupMemberException
groupContext
- The context of the groupgroupName
- The name of the group.groupDescription
- Description of this group.members
- The members of this group.
GroupContextNotFoundException
- The specified context could not be found.
GroupExistsException
- A group by this name already exists in the provided context.
InvalidGroupMemberException
- Thrown when a group is updated with new members that violate any membership
contracts.Group updateGroup(Group group) throws GroupNotFoundException, GroupExistsException, InvalidGroupMemberException
group
- the group to update
GroupNotFoundException
- The group could not be found on the server.
GroupExistsException
- When a new name specified in the update request already exists for the context
InvalidGroupMemberException
- Thrown when a group is updated with new members that violate any membership
contracts.void deleteGroup(GroupDescriptor groupDescriptor) throws GroupNotFoundException
groupDescriptor
- the group to delete
GroupNotFoundException
- Thrown when the group to be deleted could not be found.void removeFromGroups(Principal member)
member
- the member to remove from all groups.void removeFromGroupContextGroups(GroupContext groupContext, Set<Principal> members)
groupContext
- The context of the groups that should be modified.members
- The members to remove from those modified groups.boolean groupExists(GroupContext groupContext, String name)
groupContext
- The context of the group.name
- The name of the group.
boolean isMember(String identifier, Principal member)
This method will return true
if the principal is an explicit member or false
if the principal is
not a member, the group does not exist, or the principal does not exist. This check will retrieve the group with
the group identifier specified and see if the principal is an explicit member (it does NOT check any sub groups
for membership).
identifier
- the identifier of the group to check.member
- the principal to check.
Group getGroup(GroupDescriptor groupDescriptor) throws GroupNotFoundException
groupDescriptor
- the descriptor of the desired group.
GroupNotFoundException
- The specified group could not be found.Group getGroupByIdentifier(String identifier) throws GroupNotFoundException
identifier
- the identifier of the desired group.
GroupNotFoundException
- The specified group could not be found.Group getGroupByName(GroupContext groupContext, String name) throws GroupNotFoundException
groupContext
- the context of the groupname
- the name of the group
GroupNotFoundException
- The specified group could not be found.GroupDescriptor getGroupDescriptorByIdentifier(String identifier) throws GroupNotFoundException
identifier
- the identifier of the desired group
GroupNotFoundException
- The specified group could not be found.GroupDescriptor getGroupDescriptorByName(GroupContext groupContext, String name) throws GroupNotFoundException
groupContext
- the context of the groupname
- the name of the group
GroupNotFoundException
- The specified group could not be found.Set<GroupDescriptor> getGroupDescriptorsByIdentifiers(Set<String> identifiers)
identifiers
- the identifiers of the desired groups
Set<Group> getGroups(GroupContext groupContext)
groupContext
- the context of the desired groups
Set<GroupDescriptor> getGroupDescriptors(GroupContext groupContext)
groupContext
- the context of the desired groups
Set<Group> getGroupsByIdentifiers(Set<String> identifiers)
identifiers
- the identifiers of the desired groups
Set<GroupDescriptor> getAllGroupsByMember(Principal member)
member
- the principal in question
Set<GroupDescriptor> getGroupsByMember(GroupContext groupContext, Principal member) throws GroupContextNotFoundException
groupContext
- the context to searchmember
- the principal in question
GroupContextNotFoundException
- Thrown when the specified context could not be found.Set<GroupDescriptor> getAllReachableGroupsByMember(Principal member)
Reachable groups are the directly assigned groups plus all groups that are (transitively) reachable from them in the group hierarchy.
Example:
Group hierarchy: GROUP_A > GROUP_B and GROUP_B > GROUP_C.
Directly assigned authority: GROUP_A.
Reachable authorities: GROUP_A, GROUP_B, GROUP_C.
member
- the principal in question
Set<GroupDescriptor> getReachableGroupsByMember(GroupContext groupContext, Principal member)
Reachable groups are the directly assigned groups plus all groups that are (transitively) reachable from them in the group hierarchy.
groupContext
- the context to searchmember
- the principal in question
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |