public class DefaultGroupService extends Object implements GroupService
Default implementation of the group service that retrieves group information from AnyWorkObject
s
of type WorkObjectTypes.GROUP_TYPE
via AnyWorkObjectService
.
All group fields that are derived from work object variables are fetched from the local variables only. This optimization is possible since it is a pre-condition that each group work object has values defined for all these variables.
GroupService.GroupSearchScope
Constructor and Description |
---|
DefaultGroupService(AnyWorkObjectService anyWorkObjectService,
SystemDefinitionHelper systemDefinitionHelper,
CurrentUserService currentUserService,
CurrentTenantService currentTenantService) |
Modifier and Type | Method and Description |
---|---|
String |
createGroup(Group group)
|
Optional<Group> |
findGroup(Predicate predicate,
GroupService.GroupSearchScope searchScope)
Finds the
Group that matches the given predicate. |
com.google.common.collect.ImmutableList<Group> |
findGroups(Predicate predicate,
GroupService.GroupSearchScope searchScope)
Finds the
Group s that match the given predicate. |
Group |
getGroup(String groupId)
Returns the
Group with the given id. |
SystemGroups |
getSystemGroups(String tenantId)
Returns the ids of the system groups for the specified tenant.
|
String |
updateGroup(Group group)
Updates an already persisted group.
|
public DefaultGroupService(AnyWorkObjectService anyWorkObjectService, SystemDefinitionHelper systemDefinitionHelper, CurrentUserService currentUserService, CurrentTenantService currentTenantService)
public Group getGroup(String groupId)
GroupService
Returns the Group
with the given id.
getGroup
in interface GroupService
groupId
- the group id, not null@Cacheable(value="edorasOne-systemGroupsByTenantId") public SystemGroups getSystemGroups(String tenantId)
GroupService
Returns the ids of the system groups for the specified tenant.
getSystemGroups
in interface GroupService
tenantId
- the tenant id for which the system groups are returned, not nullpublic Optional<Group> findGroup(Predicate predicate, GroupService.GroupSearchScope searchScope)
GroupService
Finds the Group
that matches the given predicate.
findGroup
in interface GroupService
predicate
- the predicate to apply, never nullsearchScope
- the boundaries within which to searchpublic com.google.common.collect.ImmutableList<Group> findGroups(Predicate predicate, GroupService.GroupSearchScope searchScope)
GroupService
Finds the Group
s that match the given predicate.
findGroups
in interface GroupService
predicate
- the predicate to apply, never nullsearchScope
- the boundaries within which to searchpublic String createGroup(Group group)
GroupService
Persists the given Group
object as an AnyWorkObject
with type WorkObjectTypes.GROUP_TYPE
.
createGroup
in interface GroupService
group
- the group to be created, not nullpublic String updateGroup(Group group)
GroupService
Updates an already persisted group. All group properties are updated except the following id’s:
<ul>
<li>Group.id
</li>
<li>Group.externalId
</li>
<li>Group.tenantId
</li>
</ul>
updateGroup
in interface GroupService
group
- the group to be updated, not nullCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.