com.atlassian.crowd.directory
Class CachingDirectory

java.lang.Object
  extended by com.atlassian.crowd.directory.AbstractInternalDirectory
      extended by 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

Field Summary
 
Fields inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory
ATTRIBUTE_PASSWORD_COMPLEXITY_MESSAGE, ATTRIBUTE_PASSWORD_HISTORY_COUNT, ATTRIBUTE_PASSWORD_MAX_ATTEMPTS, ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME, ATTRIBUTE_PASSWORD_MINIMUM_LENGTH, ATTRIBUTE_PASSWORD_MINIMUM_SCORE, ATTRIBUTE_PASSWORD_REGEX, ATTRIBUTE_USER_ENCRYPTION_METHOD, attributes, DESCRIPTIVE_NAME, directoryDao, directoryId, groupDao, internalDirectoryUtils, membershipDao, passwordEncoderFactory, userDao
 
Constructor Summary
CachingDirectory(InternalDirectoryUtils internalDirectoryUtils, PasswordEncoderFactory passwordEncoderFactory, DirectoryDao directoryDao, UserDao userDao, GroupDao groupDao, MembershipDao membershipDao, PasswordConstraintsLoader passwordConstraints)
           
 
Method Summary
 BatchResult<Group> addAllGroups(Set<GroupTemplate> groups)
           
 BatchResult<User> addAllUsers(Set<UserTemplateWithCredentialAndAttributes> users)
           
 BatchResult<String> addAllUsersToGroup(Set<String> userNames, String groupName)
           
 Group addLocalGroup(GroupTemplate group)
           
 User addUser(UserTemplate user, PasswordCredential credential)
          Adds a user with no special added logic.
 boolean isLocalUserStatusEnabled()
          Caching directories can be configured to support local user statuses.
 User updateUser(UserTemplate user)
           
 
Methods inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory
addGroup, addGroupToGroup, addUserToGroup, authenticate, calculatePostPasswordUpdateAttributes, countDirectMembersOfGroup, currentPrincipalInvalidPasswordAttempts, encryptedCredential, expireAllPasswords, findGroupByName, findGroupWithAttributesByName, findUserByExternalId, findUserByName, findUserWithAttributesByName, forceRenameUser, getAllUserExternalIds, getAuthoritativeDirectory, getDescriptiveName, getDirectoryId, getEncoder, getKeys, getMemberships, getPasswordConstraints, getUserCount, 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, supportsPasswordExpiration, supportsSettingEncryptedCredential, testConnection, updateGroup, updateUserCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingDirectory

public CachingDirectory(InternalDirectoryUtils internalDirectoryUtils,
                        PasswordEncoderFactory passwordEncoderFactory,
                        DirectoryDao directoryDao,
                        UserDao userDao,
                        GroupDao groupDao,
                        MembershipDao membershipDao,
                        PasswordConstraintsLoader passwordConstraints)
Method Detail

addUser

public User addUser(UserTemplate user,
                    PasswordCredential credential)
             throws InvalidCredentialException,
                    InvalidUserException,
                    UserAlreadyExistsException,
                    OperationFailedException
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:
InvalidCredentialException - the password does not match the regular expression standard defined by the directory.
InvalidUserException
UserAlreadyExistsException
OperationFailedException

addLocalGroup

public Group addLocalGroup(GroupTemplate group)
                    throws InvalidGroupException,
                           OperationFailedException
Specified by:
addLocalGroup in interface InternalRemoteDirectory
Specified by:
addLocalGroup in class AbstractInternalDirectory
Throws:
InvalidGroupException
OperationFailedException

addAllUsers

public BatchResult<User> addAllUsers(Set<UserTemplateWithCredentialAndAttributes> users)

addAllGroups

public BatchResult<Group> addAllGroups(Set<GroupTemplate> groups)

addAllUsersToGroup

public BatchResult<String> addAllUsersToGroup(Set<String> userNames,
                                              String groupName)
                                       throws GroupNotFoundException
Throws:
GroupNotFoundException

updateUser

public User updateUser(UserTemplate user)
                throws InvalidUserException,
                       UserNotFoundException
Throws:
InvalidUserException
UserNotFoundException

isLocalUserStatusEnabled

public boolean isLocalUserStatusEnabled()
Caching directories can be configured to support local user statuses. By default, local user statuses are disabled.

Returns:
true if the local user status configuration is enabled
See Also:
upgrade.tasks.UpgradeTask622


Copyright © 2016 Atlassian. All Rights Reserved.