Package org.openiam.esb.core.service
Interface GroupDataService
-
- All Superinterfaces:
GetBeansElasticsearchService<Group,GroupEntity,String,GroupSearchBean>
,GetBeansService<Group,GroupEntity,String,GroupSearchBean>
,GetDetachedEntitlementsService<Group,GroupSearchBean>
,GetEntitlementBeansService<Group,GroupEntity,String,GroupSearchBean>
- All Known Implementing Classes:
GroupDataServiceImpl
public interface GroupDataService extends GetEntitlementBeansService<Group,GroupEntity,String,GroupSearchBean>, GetDetachedEntitlementsService<Group,GroupSearchBean>
GroupDataService
provides a service 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 void
addChildGroup(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate)
Adds child group to a parent group.void
canAddUserToGroup(String groupId, String userId)
void
canRemoveUserFromGroup(String groupId, String userId)
int
countGroupsForOwner(GroupSearchBean searchBean, String ownerId)
Counts number of groups for given count criteria.void
deleteGroup(String groupId)
Deletes group with given group id.List<Group>
findBeans(SynchronizationRequestSearchBean searchBean)
List<Group>
findGroupsDtoForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Returns list of Group objects for given search criteria.List<GroupEntity>
findGroupsForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Returns list of GroupEntity objects for given search criteria.GroupEntity
getGroup(String id)
Gets GroupEntity object for given group id.Group
getGroupDTO(String groupId)
Gets Group for given group id.List<String>
getGroupIdList()
Gets Set of all group ids.List<String>
getPossibleAttributeNames()
boolean
hasAttachedEntities(String groupId)
Checks if group with given id has attached entities like groups, resources and roles.void
reindexGroup(String id)
Force reindex of a group.void
removeChildGroup(String groupId, String childGroupId)
Removes child from group.void
removeGroupFromRole(String roleId, String groupId)
Removes Group from Role.void
saveAttribute(GroupAttributeEntity attribute)
Saves GroupAttributeEntity object.void
saveBulkGroup(EntitlementBulkRequest groupBulkRequest)
Bulk operation on Group objects, this method with save groups in bulkvoid
saveGroup(Group group)
Saves Group object.void
saveGroupRequest(GroupRequestModel request)
Saves GroupRequestModel object, this method saves GroupEntity object with its attributes list and sets parent if applicable.SaveTemplateProfileResponse
saveGroupRequestWeb(GroupRequestModel request)
Saves GroupRequestModel, this save saves GroupEntity and its attributes from model.void
validate(GroupEntity group)
Checks if GroupEntity object is valid.void
validateDelete(Group dto)
void
validateEdit(Group dto)
void
validateGroupRequest(GroupRequestModel request)
Validates template assigned to GroupRequestModel object.void
validateGroupToGroupAddition(String parentId, String memberId, Date startDate, Date endDate)
Checks if parent and child group are not null, exists and child can be added to parent.-
Methods inherited from interface org.openiam.esb.core.service.GetBeansElasticsearchService
reindex, reindex, suggestById
-
Methods inherited from interface org.openiam.esb.core.service.GetBeansService
countBeans, find, findBeans, findBeans, get
-
Methods inherited from interface org.openiam.esb.core.service.GetDetachedEntitlementsService
getDetached, getWithResources
-
Methods inherited from interface org.openiam.esb.core.service.GetEntitlementBeansService
findBeans
-
-
-
-
Method Detail
-
getGroup
GroupEntity getGroup(String id)
Gets GroupEntity object for given group id.- Parameters:
id
- group id.- Returns:
- GroupEntity with given group id if found, otherwise null.
-
getGroupIdList
List<String> getGroupIdList()
Gets Set of all group ids.- Returns:
- Set of all group ids.
-
validate
void validate(GroupEntity group) throws BasicDataServiceException
Checks if GroupEntity object is valid.- Parameters:
group
- GroupEntity object which validity will be checked.- Throws:
BasicDataServiceException
-
saveGroup
void saveGroup(Group group) throws BasicDataServiceException
Saves Group object.- Parameters:
group
- Group object that will be saved.- Throws:
BasicDataServiceException
-
deleteGroup
void deleteGroup(String groupId) throws BasicDataServiceException
Deletes group with given group id.- Parameters:
groupId
- group id.- Throws:
BasicDataServiceException
-
saveAttribute
void saveAttribute(GroupAttributeEntity attribute)
Saves GroupAttributeEntity object.- Parameters:
attribute
- GroupAttributeEntity.
-
validateGroupToGroupAddition
void validateGroupToGroupAddition(String parentId, String memberId, Date startDate, Date endDate) throws BasicDataServiceException
Checks if parent and child group are not null, exists and child can be added to parent.- Parameters:
parentId
- parent group id.memberId
- child group id.startDate
- start date.endDate
- end date.- Throws:
BasicDataServiceException
-
getGroupDTO
Group getGroupDTO(String groupId)
Gets Group for given group id.- Parameters:
groupId
- group id used for search criteria.- Returns:
- Group object if found or null otherwise.
-
countGroupsForOwner
int countGroupsForOwner(GroupSearchBean searchBean, String ownerId)
Counts number of groups for given count criteria.- Parameters:
searchBean
- search bean used for count criteria.ownerId
- group owner id.- Returns:
- number of groups.
-
findGroupsForOwner
List<GroupEntity> findGroupsForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Returns list of GroupEntity objects for given search criteria.- Parameters:
searchBean
- search bean used as search criteriaownerId
- user id, used in search criteria.from
- index of first item to retrieve.size
- number of items to retrieve.- Returns:
- list of GroupEntity objects.
-
hasAttachedEntities
boolean hasAttachedEntities(String groupId)
Checks if group with given id has attached entities like groups, resources and roles.- Parameters:
groupId
- group id.- Returns:
- true if it has attached entities, otherwise false.
-
findGroupsDtoForOwner
List<Group> findGroupsDtoForOwner(GroupSearchBean searchBean, String ownerId, int from, int size)
Returns list of Group objects for given search criteria.- Parameters:
searchBean
- search bean used in search criteria.ownerId
- , user id used in search criteria, owner of groups.from
- index of first item to retrieve.size
- number of items to retrieve.- Returns:
- list of Group objects.
-
removeGroupFromRole
void removeGroupFromRole(String roleId, String groupId) throws BasicDataServiceException
Removes Group from Role.- Parameters:
roleId
- role id.groupId
- group id.- Throws:
BasicDataServiceException
-
saveGroupRequest
void saveGroupRequest(GroupRequestModel request) throws BasicDataServiceException
Saves GroupRequestModel object, this method saves GroupEntity object with its attributes list and sets parent if applicable.- Parameters:
request
- GroupRequestModel object.- Throws:
Exception
BasicDataServiceException
-
validateGroupRequest
void validateGroupRequest(GroupRequestModel request) throws BasicDataServiceException
Validates template assigned to GroupRequestModel object.- Parameters:
request
- GroupRequestModel object.- Throws:
Exception
BasicDataServiceException
-
addChildGroup
void addChildGroup(String groupId, String childGroupId, Set<String> rights, Date startDate, Date endDate) throws BasicDataServiceException
Adds child group to a parent group.- Parameters:
groupId
- parent group id.childGroupId
- child group id.rights
- list of rights ids.startDate
- start date.endDate
- end date.- Throws:
BasicDataServiceException
-
removeChildGroup
void removeChildGroup(String groupId, String childGroupId) throws BasicDataServiceException
Removes child from group.- Parameters:
groupId
- parent group id.childGroupId
- child group id.- Throws:
BasicDataServiceException
-
saveGroupRequestWeb
SaveTemplateProfileResponse saveGroupRequestWeb(GroupRequestModel request)
Saves GroupRequestModel, this save saves GroupEntity and its attributes from model.- Parameters:
request
- GroupRequestModel object.- Returns:
- SaveTemplateProfileResponse object with status Success if everything went fine, otherwise it returns status failure.
-
validateEdit
void validateEdit(Group dto) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
validateDelete
void validateDelete(Group dto) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
canAddUserToGroup
void canAddUserToGroup(String groupId, String userId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
canRemoveUserFromGroup
void canRemoveUserFromGroup(String groupId, String userId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
reindexGroup
void reindexGroup(String id)
Force reindex of a group. Should NOT be called by production code. Exists for test purposes only- Parameters:
id
-
-
findBeans
List<Group> findBeans(SynchronizationRequestSearchBean searchBean)
-
saveBulkGroup
void saveBulkGroup(EntitlementBulkRequest groupBulkRequest) throws BasicDataServiceException
Bulk operation on Group objects, this method with save groups in bulk- Parameters:
groupBulkRequest
- EntitlementBulkRequest object that will be processed.- Throws:
BasicDataServiceException
-
-