com.atlassian.crowd.directory
Class CachingDirectory
java.lang.Object
com.atlassian.crowd.directory.AbstractInternalDirectory
com.atlassian.crowd.directory.CachingDirectory
- All Implemented Interfaces:
- InternalRemoteDirectory, RemoteDirectory, Attributes
public class CachingDirectory
- extends AbstractInternalDirectory
This InternalDirectory is used for locally caching Users and Groups from an external Directory.
- See Also:
InternalDirectory
Fields inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory |
ATTRIBUTE_PASSWORD_HISTORY_COUNT, ATTRIBUTE_PASSWORD_MAX_ATTEMPTS, ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME, ATTRIBUTE_PASSWORD_REGEX, ATTRIBUTE_USER_ENCRYPTION_METHOD, attributes, DESCRIPTIVE_NAME, directoryDao, directoryId, groupDao, internalDirectoryUtils, membershipDao, passwordEncoderFactory, userDao |
Methods inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory |
addGroup, addGroupToGroup, addUserToGroup, authenticate, currentPrincipalInvalidPasswordAttempts, encryptCredential, findGroupByName, findGroupWithAttributesByName, findUserByName, findUserWithAttributesByName, getDescriptiveName, getDirectoryId, getEncoder, getKeys, getValue, getValues, isEmpty, isGroupDirectGroupMember, isRolesDisabled, isUserDirectGroupMember, removeAllGroups, removeAllUsers, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, requiresPasswordChange, searchGroupRelationships, searchGroups, searchUsers, setAttributes, setDirectoryId, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsNestedGroups, testConnection, updateGroup, updateUserCredential |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingDirectory
public CachingDirectory(InternalDirectoryUtils internalDirectoryUtils,
PasswordEncoderFactory passwordEncoderFactory,
DirectoryDao directoryDao,
UserDao userDao,
GroupDao groupDao,
MembershipDao membershipDao)
addUser
public User addUser(UserTemplate user,
PasswordCredential credential)
throws InvalidCredentialException,
InvalidUserException
- Adds a user with no special added logic.
- Specified by:
addUser
in interface RemoteDirectory
- Specified by:
addUser
in class AbstractInternalDirectory
- Parameters:
user
- template of the user to add.credential
- password. May be null, since JIRA creates a user in two steps
- Returns:
- added user.
- Throws:
UserNotFoundException
- the user could not be looked up after creation
DirectoryNotFoundException
- the directory with the ID of user.directoryId
does not exist.
InvalidCredentialException
- the password does not match the regular
expression standard defined by the directory.
InvalidUserException
- The supplied user is invalid.
addLocalGroup
public Group addLocalGroup(GroupTemplate group)
throws InvalidGroupException
- Specified by:
addLocalGroup
in interface InternalRemoteDirectory
- Specified by:
addLocalGroup
in class AbstractInternalDirectory
- Throws:
InvalidGroupException
addAllUsers
public java.util.Collection<User> addAllUsers(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
addAllGroups
public java.util.Collection<Group> addAllGroups(java.util.Set<GroupTemplate> groups)
throws DirectoryNotFoundException
- Throws:
DirectoryNotFoundException
addAllUsersToGroup
public java.util.Collection<java.lang.String> addAllUsersToGroup(java.util.Set<java.lang.String> userNames,
java.lang.String groupName)
throws GroupNotFoundException
- Throws:
GroupNotFoundException
updateUser
public User updateUser(UserTemplate user)
throws InvalidUserException
- Description copied from interface:
RemoteDirectory
- Updates the
user
.
- Specified by:
updateUser
in interface RemoteDirectory
- Overrides:
updateUser
in class AbstractInternalDirectory
- Parameters:
user
- The user to update.
- Returns:
- the updated user retrieved from the underlying store.
- Throws:
InvalidUserException
- the supplied user is invalid.
Copyright © 2010 Atlassian. All Rights Reserved.