public class LocalGroupHandler extends InternalGroupHandler
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.
SHADOW_ATTRIBUTE_KEY
Constructor and Description |
---|
LocalGroupHandler(InternalRemoteDirectory internalDirectory) |
Modifier and Type | Method and Description |
---|---|
void |
addUserToLocalGroup(String username,
String groupName) |
Group |
createLocalGroup(GroupTemplate groupTemplate)
Creates a local group with the supplied template.
|
Group |
findLocalGroup(String groupName)
Finds a local group.
|
void |
removeUserFromLocalGroup(String username,
String groupName) |
Group |
updateLocalGroup(GroupTemplate groupTemplate)
Updates a local group.
|
getInternalDirectory, isLocalGroupsEnabled
public LocalGroupHandler(InternalRemoteDirectory internalDirectory)
public Group findLocalGroup(String groupName) throws GroupNotFoundException, OperationFailedException
groupName
- name of group.GroupNotFoundException
- local group with supplied name does not exist.OperationFailedException
- underlying directory implementation failed to execute the operation.public Group createLocalGroup(GroupTemplate groupTemplate) throws InvalidGroupException, OperationFailedException, DirectoryNotFoundException
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).
groupTemplate
- group to add.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
public Group updateLocalGroup(GroupTemplate groupTemplate) throws OperationFailedException, GroupNotFoundException, ReadOnlyGroupException, InvalidGroupException
If the group found is shadow group or does not exist, a GroupNotFoundException will be thrown.
groupTemplate
- group to update.OperationFailedException
- underlying directory implementation failed to execute the operation.GroupNotFoundException
ReadOnlyGroupException
InvalidGroupException
public void addUserToLocalGroup(String username, String groupName) throws OperationFailedException, GroupNotFoundException, ReadOnlyGroupException, UserNotFoundException, MembershipAlreadyExistsException
public void removeUserFromLocalGroup(String username, String groupName) throws OperationFailedException, GroupNotFoundException, MembershipNotFoundException, ReadOnlyGroupException, UserNotFoundException
Copyright © 2020 Atlassian. All rights reserved.