@Transactional(propagation=REQUIRED) public abstract class UserGroupMemberManagementBase extends Object implements UserGroupMemberManagement
Spring Service base class for
com.communote.server.service.user.UserGroupMemberManagement
, provides access to all
services and entities referenced by this service.
UserGroupMemberManagement
Constructor and Description |
---|
UserGroupMemberManagementBase() |
Modifier and Type | Method and Description |
---|---|
void |
addGroup(Long targetGroupId,
Long groupId)
Add a group to a group if it is not already contained.
|
void |
addUser(Long groupId,
Long userId)
Add a user to a group
|
void |
addUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Adds a user to an external group.
|
boolean |
containsEntityDirectly(Long groupId,
Long entityId)
Returns true if the group or user is a direct member of the group.
|
boolean |
containsUser(Long groupId,
Long userId)
Returns true if the user is a direct or indirect member of the group.
|
boolean |
containsUserDirectly(Long groupId,
Long userId)
Returns true if the user is a direct member of the group.
|
protected Principal |
getPrincipal()
Gets the current
principal if one has been set, otherwise returns
null . |
List<UserData> |
getUsersOfGroup(Long groupId)
Return all users who are direct members of a group.
|
protected abstract void |
handleAddGroup(Long targetGroupId,
Long groupId)
Add a group to a group if it is not already contained.
|
protected abstract void |
handleAddUser(Long groupId,
Long userId)
Performs the core logic for
addUser(Long, Long) |
protected abstract void |
handleAddUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Performs the core logic for
addUserForExternal(Long, Long, String) |
protected abstract boolean |
handleContainsEntityDirectly(Long groupId,
Long entityId)
Performs the core logic for
containsEntityDirectly(Long, Long) |
protected abstract boolean |
handleContainsUser(Long groupId,
Long userId)
Performs the core logic for
containsUser(Long, Long) |
protected abstract boolean |
handleContainsUserDirectly(Long groupId,
Long userId)
Performs the core logic for
containsUserDirectly(Long, Long) |
protected abstract List<UserData> |
handleGetUsersOfGroup(Long groupId)
Performs the core logic for
getUsersOfGroup(Long) |
protected abstract void |
handleRemoveEntityFromGroup(Long groupId,
Long entityId)
Performs the core logic for
removeEntityFromGroup(Long, Long) |
protected abstract void |
handleRemoveGroupFromAllGroups(Long entityId)
Performs the core logic for
removeGroupFromAllGroups(Long) |
protected abstract void |
handleRemoveUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Performs the core logic for
removeUserForExternal(Long, Long, String) |
protected abstract void |
handleRemoveUserFromAllGroups(Long userId)
Performs the core logic for
removeUserFromAllGroups(Long) |
void |
removeEntityFromGroup(Long groupId,
Long entityId)
This method removes an entity from a group.
|
void |
removeGroupFromAllGroups(Long entityId)
Remove a group from all groups it is a member of.
|
void |
removeUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Removes a user from an external group.
|
void |
removeUserFromAllGroups(Long userId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countMembers, getUsersOfGroup, removeGroupFromAllExternalGroups
public void addGroup(Long targetGroupId, Long groupId) throws GroupNotFoundException, CantAddParentAsChildException, AuthorizationException
UserGroupMemberManagement
addGroup
in interface UserGroupMemberManagement
targetGroupId
- ID of the target group the other group should be added togroupId
- ID of the group to addGroupNotFoundException
- in case the target group or the group to add does not existCantAddParentAsChildException
- in case adding the group would lead to a cyclic group hierarchyGroupOperationNotPermittedException
- in case the target group is an external groupAuthorizationException
- in case the current user is not client managerpublic void addUser(Long groupId, Long userId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException
UserGroupMemberManagement
addUser
in interface UserGroupMemberManagement
groupId
- the ID of the group to add the user touserId
- the ID of the user to addGroupNotFoundException
- in case the group does not existUserNotFoundException
- in case the user does not existGroupOperationNotPermittedException
- in case the group is an external groupAuthorizationException
- in case the current user is not client managerpublic void addUserForExternal(Long groupId, Long userId, String externalSystemId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException
UserGroupMemberManagement
addUserForExternal
in interface UserGroupMemberManagement
groupId
- the ID of the external group to add the user touserId
- the ID of the user to addexternalSystemId
- the ID of the external system the group should belong toGroupNotFoundException
- in case the group does not existUserNotFoundException
- in case the user does not existGroupOperationNotPermittedException
- in case the group is not a group from the external system identified by the
externalSystemIdAuthorizationException
- in case the current user is not the internal system user@Transactional(readOnly=true) public boolean containsEntityDirectly(Long groupId, Long entityId) throws GroupNotFoundException
UserGroupMemberManagement
Returns true if the group or user is a direct member of the group.
containsEntityDirectly
in interface UserGroupMemberManagement
GroupNotFoundException
UserGroupMemberManagement.containsEntityDirectly(Long,
Long)
@Transactional(readOnly=true) public boolean containsUser(Long groupId, Long userId) throws GroupNotFoundException
UserGroupMemberManagement
Returns true if the user is a direct or indirect member of the group.
containsUser
in interface UserGroupMemberManagement
GroupNotFoundException
UserGroupMemberManagement.containsUser(Long, Long)
@Transactional(readOnly=true) public boolean containsUserDirectly(Long groupId, Long userId) throws GroupNotFoundException
UserGroupMemberManagement
Returns true if the user is a direct member of the group.
containsUserDirectly
in interface UserGroupMemberManagement
GroupNotFoundException
UserGroupMemberManagement.containsUserDirectly(Long,
Long)
protected Principal getPrincipal()
principal
if one has been set, otherwise returns
null
.@Transactional(readOnly=true) public List<UserData> getUsersOfGroup(Long groupId) throws GroupNotFoundException
UserGroupMemberManagement
getUsersOfGroup
in interface UserGroupMemberManagement
groupId
- Id of the group.GroupNotFoundException
- in case the group does not existUserGroupMemberManagement.getUsersOfGroup(Long)
protected abstract void handleAddGroup(Long targetGroupId, Long groupId) throws GroupOperationNotPermittedException, GroupNotFoundException, CantAddParentAsChildException, AuthorizationException
targetGroupId
- ID of the target group the other group should be added togroupId
- ID of the group to addGroupOperationNotPermittedException
- in case the target group is an external groupGroupNotFoundException
- in case the target group or the group to add does not existCantAddParentAsChildException
- in case adding the group would lead to a cyclic group hierarchyAuthorizationException
- in case the current user is not client managerprotected abstract void handleAddUser(Long groupId, Long userId) throws GroupNotFoundException, UserNotFoundException, GroupOperationNotPermittedException, AuthorizationException
addUser(Long, Long)
AuthorizationException
- in case the current user is not client managerGroupNotFoundException
UserNotFoundException
GroupOperationNotPermittedException
protected abstract void handleAddUserForExternal(Long groupId, Long userId, String externalSystemId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException
addUserForExternal(Long, Long, String)
protected abstract boolean handleContainsEntityDirectly(Long groupId, Long entityId) throws GroupNotFoundException
containsEntityDirectly(Long, Long)
GroupNotFoundException
protected abstract boolean handleContainsUser(Long groupId, Long userId) throws GroupNotFoundException
containsUser(Long, Long)
GroupNotFoundException
protected abstract boolean handleContainsUserDirectly(Long groupId, Long userId) throws GroupNotFoundException
containsUserDirectly(Long, Long)
GroupNotFoundException
protected abstract List<UserData> handleGetUsersOfGroup(Long groupId) throws GroupNotFoundException
getUsersOfGroup(Long)
GroupNotFoundException
protected abstract void handleRemoveEntityFromGroup(Long groupId, Long entityId) throws GroupOperationNotPermittedException, GroupNotFoundException
removeEntityFromGroup(Long, Long)
protected abstract void handleRemoveGroupFromAllGroups(Long entityId) throws GroupNotFoundException, AuthorizationException
removeGroupFromAllGroups(Long)
protected abstract void handleRemoveUserForExternal(Long groupId, Long userId, String externalSystemId) throws AuthorizationException
removeUserForExternal(Long, Long, String)
AuthorizationException
protected abstract void handleRemoveUserFromAllGroups(Long userId) throws UserNotFoundException
removeUserFromAllGroups(Long)
UserNotFoundException
public void removeEntityFromGroup(Long groupId, Long entityId) throws GroupOperationNotPermittedException, GroupNotFoundException
UserGroupMemberManagement
This method removes an entity from a group.
removeEntityFromGroup
in interface UserGroupMemberManagement
GroupOperationNotPermittedException
GroupNotFoundException
UserGroupMemberManagement.removeEntityFromGroup(Long,
Long)
public void removeGroupFromAllGroups(Long entityId) throws GroupNotFoundException, AuthorizationException
UserGroupMemberManagement
removeGroupFromAllGroups
in interface UserGroupMemberManagement
entityId
- The id of the group to removeGroupNotFoundException
- in case the group does not existAuthorizationException
- in case the current user is not client manager or the internal system userpublic void removeUserForExternal(Long groupId, Long userId, String externalSystemId) throws AuthorizationException
UserGroupMemberManagement
removeUserForExternal
in interface UserGroupMemberManagement
groupId
- the ID of the external groupuserId
- the ID of the user to removeexternalSystemId
- the ID of the external system the group originated fromAuthorizationException
- in case the current user is not the internal system userpublic void removeUserFromAllGroups(Long userId) throws UserNotFoundException
removeUserFromAllGroups
in interface UserGroupMemberManagement
UserNotFoundException
UserGroupMemberManagement.removeUserFromAllGroups(Long)
Copyright © 2019 Communote team. All rights reserved.