Package com.atlassian.crowd.directory
Class AbstractForwardingDirectory
java.lang.Object
com.atlassian.crowd.directory.AbstractForwardingDirectory
- All Implemented Interfaces:
RemoteDirectory,Attributes
- Direct Known Subclasses:
DelegatedAuthenticationDirectory
@ParametersAreNonnullByDefault
public abstract class AbstractForwardingDirectory
extends Object
implements RemoteDirectory
A utility class which delegates (i.e. forwards) its method calls to an underlying
delegate directory
Concrete implementations can override any method requiring custom logic to the underlying directory
- Since:
- v2.9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGroup(GroupTemplate group) voidaddGroupToGroup(String childGroup, String parentGroup) addUser(UserTemplate user, PasswordCredential credential) addUser(UserTemplateWithAttributes user, PasswordCredential credential) voidaddUserToGroup(String username, String groupName) authenticate(String name, PasswordCredential credential) countDirectMembersOfGroup(String groupName, int querySizeHint) voidfindGroupByName(String name) findUserByExternalId(String externalId) findUserByName(String name) protected abstract RemoteDirectorylonggetKeys()getUserAvatarByName(String username, int sizeHint) booleanisEmpty()booleanisGroupDirectGroupMember(String childGroup, String parentGroup) booleanbooleanisUserDirectGroupMember(String username, String groupName) voidremoveGroup(String name) voidremoveGroupAttributes(String groupName, String attributeName) voidremoveGroupFromGroup(String childGroup, String parentGroup) voidremoveUser(String name) voidremoveUserAttributes(String username, String attributeName) voidremoveUserFromGroup(String username, String groupName) renameGroup(String oldName, String newName) renameUser(String oldName, String newName) <T> List<T>searchGroupRelationships(MembershipQuery<T> query) <T> List<T>searchGroups(EntityQuery<T> query) <T> List<T>searchUsers(EntityQuery<T> query) voidsetAttributes(Map<String, String> attributes) voidsetDirectoryId(long directoryId) voidvoidbooleanbooleanbooleanbooleanvoidupdateGroup(GroupTemplate group) updateUser(UserTemplate user) voidupdateUserCredential(String username, PasswordCredential credential) updateUserFromRemoteDirectory(User remoteUser) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.crowd.directory.RemoteDirectory
getLocallyFilteredGroupNames, userAuthenticated
-
Constructor Details
-
AbstractForwardingDirectory
public AbstractForwardingDirectory()
-
-
Method Details
-
getDirectoryId
public long getDirectoryId()- Specified by:
getDirectoryIdin interfaceRemoteDirectory
-
setDirectoryId
public void setDirectoryId(long directoryId) - Specified by:
setDirectoryIdin interfaceRemoteDirectory
-
getDescriptiveName
- Specified by:
getDescriptiveNamein interfaceRemoteDirectory
-
setAttributes
- Specified by:
setAttributesin interfaceRemoteDirectory
-
findUserByName
@Nonnull public User findUserByName(String name) throws UserNotFoundException, OperationFailedException - Specified by:
findUserByNamein interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
findUserWithAttributesByName
@Nonnull public UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException - Specified by:
findUserWithAttributesByNamein interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
findUserByExternalId
@Nonnull public User findUserByExternalId(String externalId) throws UserNotFoundException, OperationFailedException - Specified by:
findUserByExternalIdin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
authenticate
@Nonnull public User authenticate(String name, PasswordCredential credential) throws UserNotFoundException, InactiveAccountException, InvalidAuthenticationException, ExpiredCredentialException, OperationFailedException - Specified by:
authenticatein interfaceRemoteDirectory- Throws:
UserNotFoundExceptionInactiveAccountExceptionInvalidAuthenticationExceptionExpiredCredentialExceptionOperationFailedException
-
addUser
@Nonnull public User addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, UserAlreadyExistsException, OperationFailedException - Specified by:
addUserin interfaceRemoteDirectory- Throws:
InvalidUserExceptionInvalidCredentialExceptionUserAlreadyExistsExceptionOperationFailedException
-
addUser
public UserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, UserAlreadyExistsException, OperationFailedException - Specified by:
addUserin interfaceRemoteDirectory- Throws:
InvalidUserExceptionInvalidCredentialExceptionUserAlreadyExistsExceptionOperationFailedException
-
updateUser
@Nonnull public User updateUser(UserTemplate user) throws InvalidUserException, UserNotFoundException, OperationFailedException - Specified by:
updateUserin interfaceRemoteDirectory- Throws:
InvalidUserExceptionUserNotFoundExceptionOperationFailedException
-
updateUserCredential
public void updateUserCredential(String username, PasswordCredential credential) throws UserNotFoundException, InvalidCredentialException, OperationFailedException - Specified by:
updateUserCredentialin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionInvalidCredentialExceptionOperationFailedException
-
renameUser
@Nonnull public User renameUser(String oldName, String newName) throws UserNotFoundException, InvalidUserException, UserAlreadyExistsException, OperationFailedException - Specified by:
renameUserin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionInvalidUserExceptionUserAlreadyExistsExceptionOperationFailedException
-
storeUserAttributes
public void storeUserAttributes(String username, Map<String, Set<String>> attributes) throws UserNotFoundException, OperationFailedException- Specified by:
storeUserAttributesin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
removeUserAttributes
public void removeUserAttributes(String username, String attributeName) throws UserNotFoundException, OperationFailedException - Specified by:
removeUserAttributesin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
removeUser
- Specified by:
removeUserin interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
searchUsers
- Specified by:
searchUsersin interfaceRemoteDirectory- Throws:
OperationFailedException
-
findGroupByName
@Nonnull public Group findGroupByName(String name) throws GroupNotFoundException, OperationFailedException - Specified by:
findGroupByNamein interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionOperationFailedException
-
findGroupWithAttributesByName
@Nonnull public GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException - Specified by:
findGroupWithAttributesByNamein interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionOperationFailedException
-
addGroup
@Nonnull public Group addGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException - Specified by:
addGroupin interfaceRemoteDirectory- Throws:
InvalidGroupExceptionOperationFailedException
-
updateGroup
@Nonnull public Group updateGroup(GroupTemplate group) throws InvalidGroupException, GroupNotFoundException, ReadOnlyGroupException, OperationFailedException - Specified by:
updateGroupin interfaceRemoteDirectory- Throws:
InvalidGroupExceptionGroupNotFoundExceptionReadOnlyGroupExceptionOperationFailedException
-
renameGroup
@Nonnull public Group renameGroup(String oldName, String newName) throws GroupNotFoundException, InvalidGroupException, OperationFailedException - Specified by:
renameGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionInvalidGroupExceptionOperationFailedException
-
storeGroupAttributes
public void storeGroupAttributes(String groupName, Map<String, Set<String>> attributes) throws GroupNotFoundException, OperationFailedException- Specified by:
storeGroupAttributesin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionOperationFailedException
-
removeGroupAttributes
public void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException, OperationFailedException - Specified by:
removeGroupAttributesin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionOperationFailedException
-
removeGroup
public void removeGroup(String name) throws GroupNotFoundException, ReadOnlyGroupException, OperationFailedException - Specified by:
removeGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionReadOnlyGroupExceptionOperationFailedException
-
searchGroups
- Specified by:
searchGroupsin interfaceRemoteDirectory- Throws:
OperationFailedException
-
isUserDirectGroupMember
public boolean isUserDirectGroupMember(String username, String groupName) throws OperationFailedException - Specified by:
isUserDirectGroupMemberin interfaceRemoteDirectory- Throws:
OperationFailedException
-
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(String childGroup, String parentGroup) throws OperationFailedException - Specified by:
isGroupDirectGroupMemberin interfaceRemoteDirectory- Throws:
OperationFailedException
-
countDirectMembersOfGroup
@Nonnull public BoundedCount countDirectMembersOfGroup(String groupName, int querySizeHint) throws OperationFailedException - Specified by:
countDirectMembersOfGroupin interfaceRemoteDirectory- Throws:
OperationFailedException
-
addUserToGroup
public void addUserToGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, ReadOnlyGroupException, OperationFailedException, MembershipAlreadyExistsException - Specified by:
addUserToGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionUserNotFoundExceptionReadOnlyGroupExceptionOperationFailedExceptionMembershipAlreadyExistsException
-
addGroupToGroup
public void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, InvalidMembershipException, ReadOnlyGroupException, OperationFailedException, MembershipAlreadyExistsException - Specified by:
addGroupToGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionInvalidMembershipExceptionReadOnlyGroupExceptionOperationFailedExceptionMembershipAlreadyExistsException
-
removeUserFromGroup
public void removeUserFromGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, MembershipNotFoundException, ReadOnlyGroupException, OperationFailedException - Specified by:
removeUserFromGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionUserNotFoundExceptionMembershipNotFoundExceptionReadOnlyGroupExceptionOperationFailedException
-
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup, String parentGroup) throws GroupNotFoundException, InvalidMembershipException, MembershipNotFoundException, ReadOnlyGroupException, OperationFailedException - Specified by:
removeGroupFromGroupin interfaceRemoteDirectory- Throws:
GroupNotFoundExceptionInvalidMembershipExceptionMembershipNotFoundExceptionReadOnlyGroupExceptionOperationFailedException
-
searchGroupRelationships
@Nonnull public <T> List<T> searchGroupRelationships(MembershipQuery<T> query) throws OperationFailedException - Specified by:
searchGroupRelationshipsin interfaceRemoteDirectory- Throws:
OperationFailedException
-
testConnection
- Specified by:
testConnectionin interfaceRemoteDirectory- Throws:
OperationFailedException
-
supportsInactiveAccounts
public boolean supportsInactiveAccounts()- Specified by:
supportsInactiveAccountsin interfaceRemoteDirectory
-
supportsNestedGroups
public boolean supportsNestedGroups()- Specified by:
supportsNestedGroupsin interfaceRemoteDirectory
-
supportsPasswordExpiration
public boolean supportsPasswordExpiration()- Specified by:
supportsPasswordExpirationin interfaceRemoteDirectory
-
supportsSettingEncryptedCredential
public boolean supportsSettingEncryptedCredential()- Specified by:
supportsSettingEncryptedCredentialin interfaceRemoteDirectory
-
isRolesDisabled
public boolean isRolesDisabled()- Specified by:
isRolesDisabledin interfaceRemoteDirectory
-
getMemberships
- Specified by:
getMembershipsin interfaceRemoteDirectory- Throws:
OperationFailedException
-
getAuthoritativeDirectory
- Specified by:
getAuthoritativeDirectoryin interfaceRemoteDirectory
-
expireAllPasswords
- Specified by:
expireAllPasswordsin interfaceRemoteDirectory- Throws:
OperationFailedException
-
getValues
- Specified by:
getValuesin interfaceAttributes
-
getValue
- Specified by:
getValuein interfaceAttributes
-
getKeys
- Specified by:
getKeysin interfaceAttributes
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceAttributes
-
getUserAvatarByName
public AvatarReference getUserAvatarByName(String username, int sizeHint) throws UserNotFoundException, OperationFailedException - Specified by:
getUserAvatarByNamein interfaceRemoteDirectory- Throws:
UserNotFoundExceptionOperationFailedException
-
updateUserFromRemoteDirectory
public User updateUserFromRemoteDirectory(User remoteUser) throws OperationFailedException, UserNotFoundException - Specified by:
updateUserFromRemoteDirectoryin interfaceRemoteDirectory- Throws:
OperationFailedExceptionUserNotFoundException
-
getDelegate
- Returns:
- the directory to delegate method calls to
-