|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kim.impl.group.GroupServiceBase org.kuali.rice.kim.impl.group.GroupServiceImpl
public class GroupServiceImpl
Field Summary | |
---|---|
protected BusinessObjectService |
businessObjectService
|
Constructor Summary | |
---|---|
GroupServiceImpl()
|
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. |
protected Collection<Group> |
getDirectGroupsForPrincipal(String principalId)
|
protected Collection<Group> |
getDirectGroupsForPrincipal(String principalId,
String namespaceCode)
|
List<String> |
getDirectMemberGroupIds(String groupId)
Returns all group ids that are direct members of the given group id. |
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. |
protected List<Group> |
getDirectParentGroups(String groupId)
|
Group |
getGroup(String groupId)
Lookup a Group based on the passed in id. |
protected org.kuali.rice.kim.impl.group.GroupBo |
getGroupBo(String groupId)
|
Group |
getGroupByNameAndNamespaceCode(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. |
protected List<String> |
getGroupIdsByPrincipalIdAndNamespaceCodeInternal(String principalId,
String namespaceCode)
|
protected org.kuali.rice.kim.impl.group.GroupMemberBo |
getGroupMemberBo(String id)
|
List<Group> |
getGroups(Collection<String> groupIds)
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. |
protected List<Group> |
getGroupsByPrincipalIdAndNamespaceCodeInternal(String principalId,
String namespaceCode)
|
protected List<org.kuali.rice.kim.impl.group.GroupBo> |
getMemberGroupBos(String groupId)
|
List<String> |
getMemberGroupIds(String groupId)
Returns all group ids that are members of the given group id. |
protected void |
getMemberGroupsInternal(org.kuali.rice.kim.impl.group.GroupBo group,
Set<org.kuali.rice.kim.impl.group.GroupBo> groups)
|
protected List<String> |
getMemberIdsByType(Collection<GroupMember> members,
MemberType memberType)
|
List<String> |
getMemberPrincipalIds(String groupId)
Returns all principal ids that are members of the given group id. |
protected List<String> |
getMemberPrincipalIdsInternal(String groupId,
Set<String> visitedGroupIds)
|
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<String> |
getParentGroupIds(String groupId)
Returns all parent groups ids that the given group id is a member of. |
protected List<Group> |
getParentGroups(String groupId)
|
protected void |
getParentGroupsInternal(String groupId,
Set<Group> groups)
|
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 |
isMemberOfGroup(String principalId,
String groupId)
Check whether the give principal is a member of the group. |
protected boolean |
isMemberOfGroupInternal(String memberId,
String groupId,
Set<String> visitedGroupIds,
MemberType memberType)
|
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. |
protected org.kuali.rice.kim.impl.group.GroupBo |
saveGroup(org.kuali.rice.kim.impl.group.GroupBo group)
|
void |
setBusinessObjectService(BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value. |
void |
setCriteriaLookupService(CriteriaLookupService criteriaLookupService)
Sets the criteriaLookupService attribute value. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BusinessObjectService businessObjectService
Constructor Detail |
---|
public GroupServiceImpl()
Method Detail |
---|
public Group getGroup(String groupId) throws RiceIllegalArgumentException
GroupService
getGroup
in interface GroupService
groupId
- String that matches the desired Groups id
RiceIllegalArgumentException
public List<Group> getGroupsByPrincipalId(String principalId) throws RiceIllegalArgumentException
GroupService
This will include all groups directly assigned as well as those inferred by the fact that they are members of higher level groups.
getGroupsByPrincipalId
in interface GroupService
principalId
- The id of the Principal
RiceIllegalArgumentException
public List<Group> getGroupsByPrincipalIdAndNamespaceCode(String principalId, String namespaceCode) throws RiceIllegalArgumentException
GroupService
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.
getGroupsByPrincipalIdAndNamespaceCode
in interface GroupService
principalId
- The id of the PrincipalnamespaceCode
- The namespace code of the desired Groups to return
RiceIllegalArgumentException
protected List<Group> getGroupsByPrincipalIdAndNamespaceCodeInternal(String principalId, String namespaceCode) throws RiceIllegalArgumentException
RiceIllegalArgumentException
public List<String> findGroupIds(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
GroupService
This method returns it's results as a List of group ids that match the given search criteria.
findGroupIds
in interface GroupService
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
public boolean isDirectMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException
GroupService
This method does not recurse into contained groups.
isDirectMemberOfGroup
in interface GroupService
principalId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
public List<String> getGroupIdsByPrincipalId(String principalId) throws RiceIllegalArgumentException
GroupService
This returns id for all groups for a given principal id.
getGroupIdsByPrincipalId
in interface GroupService
principalId
- Id of a Principal
RiceIllegalArgumentException
public List<String> getGroupIdsByPrincipalIdAndNamespaceCode(String principalId, String namespaceCode) throws RiceIllegalArgumentException
GroupService
This returns id for all groups for a given principal id, limited to specific Group namespace.
getGroupIdsByPrincipalIdAndNamespaceCode
in interface GroupService
principalId
- Id of a PrincipalnamespaceCode
- Namspace code to limit group results to
RiceIllegalArgumentException
protected List<String> getGroupIdsByPrincipalIdAndNamespaceCodeInternal(String principalId, String namespaceCode) throws RiceIllegalArgumentException
RiceIllegalArgumentException
public List<String> getDirectGroupIdsByPrincipalId(String principalId) throws RiceIllegalArgumentException
GroupService
This returns id for all groups for a given principal id.
getDirectGroupIdsByPrincipalId
in interface GroupService
principalId
- Id of a Principal
RiceIllegalArgumentException
public List<String> getMemberPrincipalIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all principal ids for members this group.
getMemberPrincipalIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
public List<String> getDirectMemberPrincipalIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all principal ids for direct members this group.
getDirectMemberPrincipalIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
public List<String> getMemberGroupIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all group ids for members this group.
getMemberGroupIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
protected List<org.kuali.rice.kim.impl.group.GroupBo> getMemberGroupBos(String groupId)
protected void getMemberGroupsInternal(org.kuali.rice.kim.impl.group.GroupBo group, Set<org.kuali.rice.kim.impl.group.GroupBo> groups)
public boolean isGroupMemberOfGroup(String groupMemberId, String groupId) throws RiceIllegalArgumentException
GroupService
Will return true if the group is a member of the group or a group assigned to this group.
isGroupMemberOfGroup
in interface GroupService
groupMemberId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
public boolean isMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException
GroupService
Will return true if the principal is a member of the group or a group assigned to this group.
isMemberOfGroup
in interface GroupService
principalId
- Id of the principalgroupId
- Id string of group
RiceIllegalArgumentException
public List<String> getDirectMemberGroupIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all group ids for direct members this group.
getDirectMemberGroupIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
public List<String> getParentGroupIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all group ids that the given group id is a member of.
getParentGroupIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
public List<String> getDirectParentGroupIds(String groupId) throws RiceIllegalArgumentException
GroupService
Will return a list of all group ids that the given group id is a member of.
getDirectParentGroupIds
in interface GroupService
groupId
- Id string of group
RiceIllegalArgumentException
public Map<String,String> getAttributes(String groupId) throws RiceIllegalArgumentException
GroupService
getAttributes
in interface GroupService
RiceIllegalArgumentException
public List<GroupMember> getMembers(List<String> groupIds) throws RiceIllegalArgumentException
GroupService
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.
getMembers
in interface GroupService
groupIds
- Ids of groups
RiceIllegalArgumentException
public List<Group> getGroups(Collection<String> groupIds) throws RiceIllegalArgumentException
GroupService
The result is a Map containing the group id as the key and the Group as the value.
getGroups
in interface GroupService
groupIds
- Collection that matches the desired Groups' id
RiceIllegalArgumentException
public Group getGroupByNameAndNamespaceCode(String namespaceCode, String groupName) throws RiceIllegalArgumentException
GroupService
getGroupByNameAndNamespaceCode
in interface GroupService
namespaceCode
- String that matches the desired Group's namespaceCodegroupName
- String that matches the desired Group's name
RiceIllegalArgumentException
public GroupQueryResults findGroups(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
GroupService
This method returns it's results as a List of Groups that match the given search criteria.
findGroups
in interface GroupService
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
public GroupMemberQueryResults findGroupMembers(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
GroupService
This method returns it's results as a List of GroupMemberss that match the given search criteria.
findGroupMembers
in interface GroupService
queryByCriteria
- the criteria. Cannot be null.
RiceIllegalArgumentException
protected boolean isMemberOfGroupInternal(String memberId, String groupId, Set<String> visitedGroupIds, MemberType memberType)
protected void getParentGroupsInternal(String groupId, Set<Group> groups)
protected List<Group> getDirectParentGroups(String groupId)
public List<GroupMember> getMembersOfGroup(String groupId) throws RiceIllegalArgumentException
GroupService
The collection of GroupMembers will contain members for a the group in no defined order.
getMembersOfGroup
in interface GroupService
groupId
- Id of group
RiceIllegalArgumentException
protected List<String> getMemberIdsByType(Collection<GroupMember> members, MemberType memberType)
protected org.kuali.rice.kim.impl.group.GroupBo getGroupBo(String groupId)
protected org.kuali.rice.kim.impl.group.GroupMemberBo getGroupMemberBo(String id)
protected List<Group> getParentGroups(String groupId) throws RiceIllegalArgumentException
RiceIllegalArgumentException
protected List<String> getMemberPrincipalIdsInternal(String groupId, Set<String> visitedGroupIds)
protected Collection<Group> getDirectGroupsForPrincipal(String principalId)
protected Collection<Group> getDirectGroupsForPrincipal(String principalId, String namespaceCode)
public boolean addGroupToGroup(String childId, String parentId) throws RiceIllegalArgumentException
GroupService
addGroupToGroup
in interface GroupService
childId
- Id of the Group to be added to the members of ParentparentId
- Id of the Group object to add the member to
RiceIllegalArgumentException
public boolean addPrincipalToGroup(String principalId, String groupId) throws RiceIllegalArgumentException
GroupService
addPrincipalToGroup
in interface GroupService
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
public Group createGroup(Group group) throws RiceIllegalArgumentException
GroupService
This will attempt to create a new Group
createGroup
in interface GroupService
group
- The new group to be created
RiceIllegalArgumentException
public Group updateGroup(Group group) throws RiceIllegalArgumentException
GroupService
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.
updateGroup
in interface GroupService
group
- The group to be updated
RiceIllegalArgumentException
public Group updateGroup(String groupId, Group group) throws RiceIllegalArgumentException
GroupService
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.
updateGroup
in interface GroupService
groupId
- Id of the Group to be updatedgroup
- Group object to use for update
RiceIllegalArgumentException
public GroupMember createGroupMember(GroupMember groupMember) throws RiceIllegalArgumentException
GroupService
This will attempt to create a new GroupMember
createGroupMember
in interface GroupService
groupMember
- The new groupMember to be created
RiceIllegalArgumentException
public GroupMember updateGroupMember(GroupMember groupMember) throws RiceIllegalArgumentException
GroupService
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.
updateGroupMember
in interface GroupService
groupMember
- The groupMember to be updated
RiceIllegalArgumentException
public void removeAllMembers(String groupId) throws RiceIllegalArgumentException
GroupService
removeAllMembers
in interface GroupService
groupId
- Id of the Group object to remove the members from
RiceIllegalArgumentException
public boolean removeGroupFromGroup(String childId, String parentId) throws RiceIllegalArgumentException
GroupService
removeGroupFromGroup
in interface GroupService
childId
- Id of the Group to be removed from the members of ParentparentId
- Id of the Group object to remove the member from
RiceIllegalArgumentException
public boolean removePrincipalFromGroup(String principalId, String groupId) throws RiceIllegalArgumentException
GroupService
removePrincipalFromGroup
in interface GroupService
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
protected org.kuali.rice.kim.impl.group.GroupBo saveGroup(org.kuali.rice.kim.impl.group.GroupBo group)
public void setBusinessObjectService(BusinessObjectService businessObjectService)
businessObjectService
- The businessObjectService to set.public void setCriteriaLookupService(CriteriaLookupService criteriaLookupService)
criteriaLookupService
- The criteriaLookupService to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |