|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GroupService
This service provides operations for checking group membership, querying for group data, creating and updating groups.
A group is a collection of principals. It's membership consists of direct principal assignment and/or nested group membership. All groups are uniquely identified by a namespace code plus a name.
As mentioned previously, groups support nested group membership. A principal or group is considered to be a "member" of a group if it is either directly assigned to the group or indirectly assigned (via a nested group membership). A principal or group is said to be a "direct" member of another group only if it is directly assigned as a member of the group, and not via a nested group assignment.
Method Summary | |
---|---|
boolean |
addGroupToGroup(String childId,
String parentId)
Adds the group with the id supplied in childId as a member of the group with the id supplied in parentId. |
boolean |
addPrincipalToGroup(String principalId,
String groupId)
Add the principal with the given principalId as a member of the group with the given groupId. |
Group |
createGroup(Group group)
Creates a new group using the given Group. |
GroupMember |
createGroupMember(GroupMember groupMember)
Creates a new group using the given GroupMember. |
List<String> |
findGroupIds(QueryByCriteria queryByCriteria)
Query for groups based on the given search criteria which is a Map of group field names to values. |
GroupMemberQueryResults |
findGroupMembers(QueryByCriteria queryByCriteria)
Query for group members based on the given search criteria which is a Map of group member field names to values. |
GroupQueryResults |
findGroups(QueryByCriteria queryByCriteria)
Query for groups based on the given search criteria which is a Map of group field names to values. |
Map<String,String> |
getAttributes(String groupId)
Get all the attributes of the given group. |
List<String> |
getDirectGroupIdsByPrincipalId(String principalId)
Get all the groups for the given principal. |
List<String> |
getDirectMemberGroupIds(String groupId)
Returns all group ids that are direct members of the given group id. |
List<String> |
getDirectMemberGroupIdsWithDate(String groupId)
|
List<String> |
getDirectMemberPrincipalIds(String groupId)
Returns all principal ids that are direct members of the given group id. |
List<String> |
getDirectParentGroupIds(String groupId)
Returns all parent groups ids that the given group id is a member of. |
List<String> |
getDirectParentGroupIdsWithDate(String groupId,
org.joda.time.DateTime asOfDate)
|
Group |
getGroup(String id)
Lookup a Group based on the passed in id. |
Group |
getGroupByNamespaceCodeAndName(String namespaceCode,
String groupName)
Lookup a Group based on the passed in namespace and name. |
List<String> |
getGroupIdsByPrincipalId(String principalId)
Get all the groups for the given principal. |
List<String> |
getGroupIdsByPrincipalIdAndNamespaceCode(String principalId,
String namespaceCode)
Get all the groups for the given principal. |
List<Group> |
getGroups(Collection<String> ids)
Gets all groups for the given collection of group ids. |
List<Group> |
getGroupsByPrincipalId(String principalId)
Get all the groups for a given principal. |
List<Group> |
getGroupsByPrincipalIdAndNamespaceCode(String principalId,
String namespaceCode)
Get all the groups within a namespace for a given principal. |
List<String> |
getMemberGroupIds(String groupId)
Returns all group ids that are members of the given group id. |
List<String> |
getMemberPrincipalIds(String groupId)
Returns all principal ids that are members of the given group id. |
List<GroupMember> |
getMembers(List<String> groupIds)
Get all GroupMembers all the groups with the given group ids. |
List<GroupMember> |
getMembersOfGroup(String groupId)
Get all GroupMembers all the groups with a given group id. |
List<GroupMember> |
getMembersOfGroupWithDate(String groupId,
org.joda.time.DateTime asOfDate)
Get all GroupMembers all the groups with a given group id and asOfDate. |
List<GroupMember> |
getMembersWithDate(List<String> groupIds,
org.joda.time.DateTime asOfDate)
|
List<String> |
getParentGroupIds(String groupId)
Returns all parent groups ids that the given group id is a member of. |
boolean |
isDirectMemberOfGroup(String principalId,
String groupId)
Check whether the give principal is a member of the group. |
boolean |
isGroupMemberOfGroup(String groupMemberId,
String groupId)
Check whether the group identified by groupMemberId is a member of the group identified by groupId. |
boolean |
isGroupMemberOfGroupWithDate(String groupMemberId,
String groupId,
org.joda.time.DateTime asOfDate)
|
boolean |
isMemberOfGroup(String principalId,
String groupId)
Check whether the give principal is a member of the group. |
boolean |
isMemberOfGroupWithDate(String principalId,
String groupId,
org.joda.time.DateTime asOfDate)
|
void |
removeAllMembers(String groupId)
Removes all members from the group with the given groupId. |
boolean |
removeGroupFromGroup(String childId,
String parentId)
Removes the group with the id supplied in childId from the group with the id supplied in parentId. |
boolean |
removePrincipalFromGroup(String principalId,
String groupId)
Removes the member principal with the given principalId from the group with the given groupId. |
Group |
updateGroup(Group group)
Updates an existing group using the given Group. |
Group |
updateGroup(String groupId,
Group group)
Updates a group using the given Group. |
GroupMember |
updateGroupMember(GroupMember groupMember)
Updates an existing group using the given GroupMember. |
Method Detail |
---|
@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'principalId=\' + #p0") List<Group> getGroupsByPrincipalId(String principalId) throws RiceIllegalArgumentException
This will include all groups directly assigned as well as those inferred by the fact that they are members of higher level groups.
principalId
- The id of the Principal
RiceIllegalArgumentException
- if the principalId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'principalId=\' + #p0 + \'|\' + \'namespaceCode=\' + #p1") List<Group> getGroupsByPrincipalIdAndNamespaceCode(String principalId, String namespaceCode) throws RiceIllegalArgumentException
This will include all groups directly assigned as well as those inferred by the fact that they are members of higher level groups, and filtered by Group namespace.
principalId
- The id of the PrincipalnamespaceCode
- The namespace code of the desired Groups to return
RiceIllegalArgumentException
- if the principalId, namespaceCode is null or blankList<String> findGroupIds(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
This method returns it's results as a List of group ids that match the given search criteria.
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
- if the queryByCriteria is nullGroupQueryResults findGroups(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
This method returns it's results as a List of Groups that match the given search criteria.
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
- if the queryByCriteria is nullGroupMemberQueryResults findGroupMembers(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
This method returns it's results as a List of GroupMemberss that match the given search criteria.
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
- if the queryByCriteria is null@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupType", key="\'id=\' + #p0") Group getGroup(String id) throws RiceIllegalArgumentException
id
- String that matches the desired Groups id
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupType", key="\'namespaceCode=\' + #p0 + \'|\' + \'groupName=\' + #p1") Group getGroupByNamespaceCodeAndName(String namespaceCode, String groupName) throws RiceIllegalArgumentException
namespaceCode
- String that matches the desired Group's namespaceCodegroupName
- String that matches the desired Group's name
RiceIllegalArgumentException
- if the namespaceCode, groupName is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupType", key="\'ids=\' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)") List<Group> getGroups(Collection<String> ids) throws RiceIllegalArgumentException
The result is a Map containing the group id as the key and the Group as the value.
ids
- Collection that matches the desired Groups' id
RiceIllegalArgumentException
- if the groupIds null or empty@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{isMemberOfGroup}\' + \'principalId=\' + #p0 + \'|\' + \'groupId=\' + #p1") boolean isMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException
Will return true if the principal is a member of the group or a group assigned to this group.
principalId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
- if the principalId, groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{isDirectMemberOfGroup}\' + \'principalId=\' + #p0 + \'|\' + \'groupId=\' + #p1") boolean isDirectMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException
This method does not recurse into contained groups.
principalId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
- if the principalId, groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getGroupIdsByPrincipalId}\' + \'principalId=\' + #p0") List<String> getGroupIdsByPrincipalId(String principalId) throws RiceIllegalArgumentException
This returns id for all groups for a given principal id.
principalId
- Id of a Principal
RiceIllegalArgumentException
- if the principalId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getGroupIdsByPrincipalIdAndNamespaceCode}\' + \'principalId=\' + #p0 + \'|\' + \'namespaceCode=\' + #p1") List<String> getGroupIdsByPrincipalIdAndNamespaceCode(String principalId, String namespaceCode) throws RiceIllegalArgumentException
This returns id for all groups for a given principal id, limited to specific Group namespace.
principalId
- Id of a PrincipalnamespaceCode
- Namspace code to limit group results to
RiceIllegalArgumentException
- if the principalId, namespaceCode is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getDirectGroupIdsByPrincipalId}\' + \'principalId=\' + #p0") List<String> getDirectGroupIdsByPrincipalId(String principalId) throws RiceIllegalArgumentException
This returns id for all groups for a given principal id.
principalId
- Id of a Principal
RiceIllegalArgumentException
- if the principalId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{isGroupMemberOfGroup}\' + \'groupMemberId=\' + #p0 + \'|\' + \'groupId=\' + #p1") boolean isGroupMemberOfGroup(String groupMemberId, String groupId) throws RiceIllegalArgumentException
Will return true if the group is a member of the group or a group assigned to this group.
groupMemberId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
- if the groupMemberId, groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getMemberPrincipalIds}\' + \'groupId=\' + #p0") List<String> getMemberPrincipalIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all principal ids for members this group.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getDirectMemberPrincipalIds}\' + \'groupId=\' + #p0") List<String> getDirectMemberPrincipalIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all principal ids for direct members this group.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getMemberGroupIds}\' + \'groupId=\' + #p0") List<String> getMemberGroupIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all group ids for members this group.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getDirectMemberGroupIds}\' + \'groupId=\' + #p0") List<String> getDirectMemberGroupIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all group ids for direct members this group.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getParentGroupIds}\' + \'groupId=\' + #p0") List<String> getParentGroupIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all group ids that the given group id is a member of.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'{getDirectParentGroupIds}\' + \'groupId=\' + #p0") List<String> getDirectParentGroupIds(String groupId) throws RiceIllegalArgumentException
Will return a list of all group ids that the given group id is a member of.
groupId
- Id string of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupType", key="\'{getAttributes}\' + \'groupId=\' + #p0") Map<String,String> getAttributes(String groupId) throws RiceIllegalArgumentException
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'groupId=\' + #p0") List<GroupMember> getMembersOfGroup(String groupId) throws RiceIllegalArgumentException
The collection of GroupMembers will contain members for a the group in no defined order.
groupId
- Id of group
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'groupId=\' + #p0 + \'|\' + \'asOfDate=\' + #p1") List<GroupMember> getMembersOfGroupWithDate(String groupId, org.joda.time.DateTime asOfDate) throws RiceIllegalArgumentException
The collection of GroupMembers will contain members for a the group in no defined order. That were members at the specified time.
groupId
- Id of groupasOfDate
- Date for historical record
RiceIllegalArgumentException
- if the groupId is null or blank@Cacheable(value="http://rice.kuali.org/kim/v2_0/GroupMemberType", key="\'groupIds=\' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)") List<GroupMember> getMembers(List<String> groupIds) throws RiceIllegalArgumentException
The collection of GroupMembers will contain members for all the groups in no defined order. The values returned may or may not be grouped by group id.
groupIds
- Ids of groups
RiceIllegalArgumentException
- if the groupIds is null or empty@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupType","http://rice.kuali.org/kim/v2_0/GroupMemberType"}, allEntries=true) Group createGroup(Group group) throws RiceIllegalArgumentException
This will attempt to create a new Group
group
- The new group to be created
RiceIllegalArgumentException
- if the group is null@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupType","http://rice.kuali.org/kim/v2_0/GroupMemberType"}, allEntries=true) Group updateGroup(Group group) throws RiceIllegalArgumentException
This will attempt to update an existing Group. For this to return without exceptions, the passed in Group must have it's Id set and be a valid group that already exists.
group
- The group to be updated
RiceIllegalArgumentException
- if the group is null@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupType","http://rice.kuali.org/kim/v2_0/GroupMemberType"}, allEntries=true) Group updateGroup(String groupId, Group group) throws RiceIllegalArgumentException
This will attempt to update an existing group with data from the passed in group. If the passed in groupId and the group.id values are different this method will inactivate the old group and create a new group with the same members with the passed in groups properties.
groupId
- Id of the Group to be updatedgroup
- Group object to use for update
RiceIllegalArgumentException
- if the group is null or the groupId is null or blank@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) GroupMember createGroupMember(GroupMember groupMember) throws RiceIllegalArgumentException
This will attempt to create a new GroupMember
groupMember
- The new groupMember to be created
RiceIllegalArgumentException
- if the group is null@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) GroupMember updateGroupMember(GroupMember groupMember) throws RiceIllegalArgumentException
This will attempt to update an existing GroupMember. For this to return without exceptions, the passed in GroupMember must have it's Id set and be a valid groupMember that already exists.
groupMember
- The groupMember to be updated
RiceIllegalArgumentException
- if the groupMember is null@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) boolean addGroupToGroup(String childId, String parentId) throws RiceIllegalArgumentException
childId
- Id of the Group to be added to the members of ParentparentId
- Id of the Group object to add the member to
RiceIllegalArgumentException
- if the childId, parentId is null or blank@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) boolean removeGroupFromGroup(String childId, String parentId) throws RiceIllegalArgumentException
childId
- Id of the Group to be removed from the members of ParentparentId
- Id of the Group object to remove the member from
RiceIllegalArgumentException
- if the childId, parentId is null or blank@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) boolean addPrincipalToGroup(String principalId, String groupId) throws RiceIllegalArgumentException
principalId
- Id of the Principal to be added to the members of the Parent GroupgroupId
- Id of the Group object to add the member to
RiceIllegalArgumentException
- if the principalId, groupId is null or blank@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) boolean removePrincipalFromGroup(String principalId, String groupId) throws RiceIllegalArgumentException
principalId
- Id of the Principal to be removed from the members of the Parent GroupgroupId
- Id of the Group object to remove the member from
RiceIllegalArgumentException
- if the principalId, groupId is null or blank@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/GroupMemberType","http://rice.kuali.org/kim/v2_0/RoleType"}, allEntries=true) void removeAllMembers(String groupId) throws RiceIllegalArgumentException
groupId
- Id of the Group object to remove the members from
RiceIllegalArgumentException
- if the groupId is null or blankboolean isGroupMemberOfGroupWithDate(String groupMemberId, String groupId, org.joda.time.DateTime asOfDate) throws RiceIllegalArgumentException
RiceIllegalArgumentException
boolean isMemberOfGroupWithDate(String principalId, String groupId, org.joda.time.DateTime asOfDate) throws RiceIllegalArgumentException
RiceIllegalArgumentException
List<String> getDirectMemberGroupIdsWithDate(String groupId) throws RiceIllegalArgumentException
RiceIllegalArgumentException
List<String> getDirectParentGroupIdsWithDate(String groupId, org.joda.time.DateTime asOfDate) throws RiceIllegalArgumentException
RiceIllegalArgumentException
List<GroupMember> getMembersWithDate(List<String> groupIds, org.joda.time.DateTime asOfDate) throws RiceIllegalArgumentException
RiceIllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |