Class LocalGroupHandler
java.lang.Object
com.atlassian.crowd.directory.hybrid.InternalGroupHandler
com.atlassian.crowd.directory.hybrid.LocalGroupHandler
Manages local group creation and mutation.
A local group is an accessible group that does NOT exist in LDAP. If local groups is enabled, then all mutation operations execute on local groups.
Any group in the internal directory section of a
DbCachingRemoteDirectory
with the shadow attribute set to "false" is an local group.
-
Field Summary
Fields inherited from class com.atlassian.crowd.directory.hybrid.InternalGroupHandler
SHADOW_ATTRIBUTE_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGroupToGroup
(String parentGroup, String childGroup) void
addUserToLocalGroup
(String username, String groupName) createLocalGroup
(GroupTemplate groupTemplate) Creates a local group with the supplied template.findLocalGroup
(String groupName) Finds a local group.void
removeGroupFromGroup
(String childGroup, String parentGroup) void
removeUserFromLocalGroup
(String username, String groupName) updateLocalGroup
(GroupTemplate groupTemplate) Updates a local group.Methods inherited from class com.atlassian.crowd.directory.hybrid.InternalGroupHandler
getInternalDirectory, isLocalGroupsEnabled
-
Constructor Details
-
LocalGroupHandler
-
-
Method Details
-
findLocalGroup
Finds a local group.- Parameters:
groupName
- name of group.- Returns:
- local group.
- Throws:
GroupNotFoundException
- local group with supplied name does not exist.ReadOnlyGroupException
- when the group exists in cache but is not local.
-
createLocalGroup
public Group createLocalGroup(GroupTemplate groupTemplate) throws InvalidGroupException, OperationFailedException, DirectoryNotFoundException Creates a local group with the supplied template.NOTE: if a local group with the same name of groupTemplate already exists, then the underlying directory may throw an Exception (in accordance with the InternalDirectory.addGroup implementations).
- Parameters:
groupTemplate
- group to add.- Returns:
- added group.
- Throws:
InvalidGroupException
- group already exists, either as a local group or as a shadow, with the same name.OperationFailedException
- underlying directory implementation failed to execute the operation.DirectoryNotFoundException
-
updateLocalGroup
public Group updateLocalGroup(GroupTemplate groupTemplate) throws OperationFailedException, GroupNotFoundException, ReadOnlyGroupException, InvalidGroupException Updates a local group.If the group found is shadow group or does not exist, a GroupNotFoundException will be thrown.
- Parameters:
groupTemplate
- group to update.- Returns:
- updated group.
- Throws:
OperationFailedException
- underlying directory implementation failed to execute the operation.GroupNotFoundException
ReadOnlyGroupException
InvalidGroupException
-
addUserToLocalGroup
public void addUserToLocalGroup(String username, String groupName) throws OperationFailedException, GroupNotFoundException, ReadOnlyGroupException, UserNotFoundException, MembershipAlreadyExistsException -
removeUserFromLocalGroup
public void removeUserFromLocalGroup(String username, String groupName) throws OperationFailedException, GroupNotFoundException, MembershipNotFoundException, ReadOnlyGroupException, UserNotFoundException -
addGroupToGroup
public void addGroupToGroup(String parentGroup, String childGroup) throws GroupNotFoundException, OperationFailedException, ReadOnlyGroupException, MembershipAlreadyExistsException, InvalidMembershipException -
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup, String parentGroup) throws GroupNotFoundException, OperationFailedException, ReadOnlyGroupException, MembershipNotFoundException, InvalidMembershipException
-