Package org.openiam.srvc.am
Interface GroupDataWebService
-
- All Known Implementing Classes:
GroupDataWebServiceImpl
public interface GroupDataWebService
GroupDataWebService
provides a web service interface to manage groups as well as related objects such as Users. Groups are stored in an hierarchical relationship. A user belongs to one or more groups.
Groups are often modeled after an organizations structure.- Version:
- 2.0
- Author:
- Suneet Shah
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Response
addChildGroup(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate)
Makes Group specified by childGroupId a child of Group specified by groupIdResponse
canAddUserToGroup(String userId, String groupId)
Checks if User specified by userId can be added to the Group specified by groupId as a memberResponse
canRemoveUserFromGroup(String userId, String groupId)
Checks if User specified by userId can be removed from the Group specified by groupId as a memberint
countBeans(GroupSearchBean searchBean)
Returns total number of Groups based on parameters, which are specified in GroupSearchBean objectint
countGroupsForOwner(GroupSearchBean searchBean, String ownerId)
Returns total number of Groups for given groupOwner based on parameters, which are specified in GroupSearchBean objectResponse
deleteGroup(String groupId)
This method removes group from openIAM database for a particular groupId.GroupListResponse
findBeans(GroupSearchBean searchBean, EntitlementsCollection[] dependants, int from, int size)
Return a paged List of Groups based on parameters, which are specified in GroupSearchBean objectList<Group>
findGroupsForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Return a paged List of Groups for given groupOwner based on parameters, which are specified in GroupSearchBean objectvoid
forceSweepUserCountCache()
force refresh cache which holds count of users assigned to groups and max number limitList<String>
getAllGroupIds()
Method to get all Group IDs This method should not be called at run-time.GroupListResponse
getDetachedForUser(String userId, String name, int from, int size)
method is used to detect all user's groups that are not linked with any resources.Group
getGroup(String groupId)
This method retrieves an existing group object.List<String>
getPossibleAttributeNames()
GroupListResponse
getWithResources(String userId, GroupSearchBean searchBean, Set<String> resourceTypeIds, int from, int size)
method is used to get user's groups with entitled resources, filtered by #resourceTypeIds.boolean
hasAttachedEntities(String groupId)
Does this group have any children?Response
reindexGroup(String id)
Response
removeChildGroup(String groupId, String childGroupId)
Remove Group specified by childGroupId from the membership list of Group specified by groupIdResponse
removeRoleFromGroup(String roleId, String groupId)
Response
saveBulkGroup(EntitlementBulkRequest entitlementBulkRequest)
Bulk operation on Group objects, this method with save groups in bulkResponse
saveGroup(Group group)
This method creates a new group or update existed one.SaveTemplateProfileResponse
saveGroupRequest(GroupRequestModel request)
Group
suggestById(String id)
Find a group in Elasticsearch.Response
validateDelete(String groupId)
Response
validateEdit(Group group)
SaveTemplateProfileResponse
validateGroupRequest(GroupRequestModel request)
Response
validateGroupToGroupAddition(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate)
-
-
-
Method Detail
-
saveGroup
Response saveGroup(Group group)
This method creates a new group or update existed one. For example:Group grp = new Group(); grp.setGrpId(groupId); grp.setGrpName("Test Group"); grpManager.addGroup(grpValue);
- Parameters:
group
- - the Group object, which should be created or updated- Returns:
- - a Response Object. If operation succeed then Response object contains the primary key of saved group otherwise it contains error code.
-
getGroup
Group getGroup(String groupId)
This method retrieves an existing group object. Dependent objects such as users are not retrieved. Null is returned if the groupId is not found.- Parameters:
groupId
- - the Group ID- Returns:
- - a Group Object if it is found, otherwise null will be returned.
-
suggestById
Group suggestById(String id)
Find a group in Elasticsearch. Significantly faster than going to the database. Use this method when performance is important and/or data integrity is not 100% required, as the database and ES may be out of sync for a period of time- Parameters:
id
- the role id- Returns:
- group
-
deleteGroup
Response deleteGroup(String groupId)
This method removes group from openIAM database for a particular groupId.- Parameters:
groupId
- The id to be removed.- Returns:
- - a Response Object which contains operation status.
-
findBeans
GroupListResponse findBeans(GroupSearchBean searchBean, EntitlementsCollection[] dependants, int from, int size)
Return a paged List of Groups based on parameters, which are specified in GroupSearchBean object- Parameters:
searchBean
- - GroupSearchBean objectdependants
- - collection instead of deep copy flag for AccessRights processorfrom
- - where to start in the listsize
- - how many to return- Returns:
- List of Group objects. Returns null if no groups are found.
-
findGroupsForOwner
List<Group> findGroupsForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Return a paged List of Groups for given groupOwner based on parameters, which are specified in GroupSearchBean object- Parameters:
searchBean
- - GroupSearchBean objectownerId
- - the User ID who is the owner for the searching groupsfrom
- - where to start in the listsize
- - how many to return- Returns:
- List of Group objects. Returns null if no groups are found.
-
countBeans
int countBeans(GroupSearchBean searchBean)
Returns total number of Groups based on parameters, which are specified in GroupSearchBean object- Parameters:
searchBean
- - GroupSearchBean object- Returns:
- - Integer, total number of groups based on parameters, which are specified in GroupSearchBean object
-
countGroupsForOwner
int countGroupsForOwner(GroupSearchBean searchBean, String ownerId)
Returns total number of Groups for given groupOwner based on parameters, which are specified in GroupSearchBean object- Parameters:
searchBean
- - GroupSearchBean objectownerId
- - the User ID who is the owner for the searching groups- Returns:
- - Integer, total number of groups based on parameters, which are specified in GroupSearchBean object
-
addChildGroup
Response addChildGroup(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate)
Makes Group specified by childGroupId a child of Group specified by groupId- Parameters:
groupId
- - the Group ID to which another group specified by childGroupId will be addedchildGroupId
- - the Group ID which will be added to the group specified by groupId- Returns:
- a Response Object, containing the status of this operation.
-
validateGroupToGroupAddition
Response validateGroupToGroupAddition(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate)
-
removeChildGroup
Response removeChildGroup(String groupId, String childGroupId)
Remove Group specified by childGroupId from the membership list of Group specified by groupId- Parameters:
groupId
- - the Group ID from which another group specified by childGroupId will be deletedchildGroupId
- - the Group ID which will be deleted from the group specified by groupId- Returns:
- a Response Object, containing the status of this operation.
-
canAddUserToGroup
Response canAddUserToGroup(String userId, String groupId)
Checks if User specified by userId can be added to the Group specified by groupId as a member- Parameters:
userId
- - the User IDgroupId
- - the Group ID- Returns:
- a Response Object, containing the status of this operation. if status is SUCCESS then the User can be added to this Croup
-
canRemoveUserFromGroup
Response canRemoveUserFromGroup(String userId, String groupId)
Checks if User specified by userId can be removed from the Group specified by groupId as a member- Parameters:
userId
- - the User IDgroupId
- - the Group ID- Returns:
- a Response Object, containing the status of this operation. if status is SUCCESS then the User can be removed from this Group
-
saveGroupRequest
SaveTemplateProfileResponse saveGroupRequest(GroupRequestModel request)
-
validateGroupRequest
SaveTemplateProfileResponse validateGroupRequest(GroupRequestModel request)
-
hasAttachedEntities
boolean hasAttachedEntities(String groupId)
Does this group have any children?- Parameters:
groupId
-- Returns:
-
getAllGroupIds
List<String> getAllGroupIds()
Method to get all Group IDs This method should not be called at run-time. It is here only for testing purpose.At the time of writing, this method is called by the ui-test/stress-test module.
- Returns:
-
getDetachedForUser
GroupListResponse getDetachedForUser(String userId, String name, int from, int size)
method is used to detect all user's groups that are not linked with any resources.- Parameters:
userId
- - id of User to check detached groupsname
- - name for case INSENSITIVE CONTAINS match search.from
- - zero based very first result- Returns:
- -
GroupListResponse
-
getWithResources
GroupListResponse getWithResources(String userId, GroupSearchBean searchBean, Set<String> resourceTypeIds, int from, int size)
method is used to get user's groups with entitled resources, filtered by #resourceTypeIds. Resources are returned inGroup#getResources()
container (only ids).- Parameters:
userId
- - user idsearchBean
- - searchBean for objectsresourceTypeIds
- - types of resources to fetchfrom
- - zero based very first resultsize
- - total size of page.- Returns:
GroupListResponse
with requested objects
-
saveBulkGroup
Response saveBulkGroup(EntitlementBulkRequest entitlementBulkRequest)
Bulk operation on Group objects, this method with save groups in bulk- Parameters:
entitlementBulkRequest
- - EntitlementBulkRequest object that will be processed.
-
forceSweepUserCountCache
void forceSweepUserCountCache()
force refresh cache which holds count of users assigned to groups and max number limit
-
-