Class CachingDirectory
- All Implemented Interfaces:
FastEntityCountProvider
,InternalRemoteDirectory
,MultiValuesQueriesSupport
,RemoteDirectory
,Attributes
- See Also:
-
Field Summary
Fields inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory
ATTRIBUTE_PASSWORD_COMPLEXITY_MESSAGE, ATTRIBUTE_PASSWORD_EXPIRATION_NOTIFICATION_PERIODS, ATTRIBUTE_PASSWORD_HISTORY_COUNT, ATTRIBUTE_PASSWORD_MAX_ATTEMPTS, ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME, ATTRIBUTE_PASSWORD_MINIMUM_DIGITS, ATTRIBUTE_PASSWORD_MINIMUM_LENGTH, ATTRIBUTE_PASSWORD_MINIMUM_LOWERCASE, ATTRIBUTE_PASSWORD_MINIMUM_RULES_MATCHED, ATTRIBUTE_PASSWORD_MINIMUM_SCORE, ATTRIBUTE_PASSWORD_MINIMUM_SPECIAL_CHARACTERS, ATTRIBUTE_PASSWORD_MINIMUM_UPPERCASE, ATTRIBUTE_PASSWORD_POLICY_PRESET, ATTRIBUTE_PASSWORD_REGEX, ATTRIBUTE_USER_ENCRYPTION_METHOD, attributes, CHARACTER_CLASS_CONSTRAINT_ATTRIBUTES, DESCRIPTIVE_NAME, directoryDao, directoryId, groupDao, internalDirectoryUtils, membershipDao, passwordEncoderFactory, tombstoneDao, userDao
-
Constructor Summary
ConstructorsConstructorDescriptionCachingDirectory
(InternalDirectoryUtils internalDirectoryUtils, PasswordEncoderFactory passwordEncoderFactory, DirectoryDao directoryDao, UserDao userDao, GroupDao groupDao, MembershipDao membershipDao, TombstoneDao tombstoneDao, PasswordConstraintsLoader passwordConstraints) -
Method Summary
Modifier and TypeMethodDescriptionaddAllGroups
(Set<GroupTemplate> groups) Adds a collection of groups to the directory.Adds a collection of users to the directory.addAllUsersToGroup
(Set<String> userNames, String groupName) Adds a collection of users to a group.addLocalGroup
(GroupTemplate group) Adds a "local" group to the directory.addUser
(UserTemplate user, PasswordCredential credential) Adds a user with no special added logic.addUser
(UserTemplateWithAttributes user, PasswordCredential credential) Adds a user without modifying it, including storing its attributes.boolean
Caching directories can be configured to support local user statuses.removeGroupsFromGroup
(Collection<String> childGroupNames, String groupName) Removes a collection of child groups from a group.removeUsersFromGroup
(Set<String> usernames, String groupName) Removes a collection of users from a group.updateUser
(UserTemplate user) Updates theuser
.Methods inherited from class com.atlassian.crowd.directory.AbstractInternalDirectory
addAllGroupsToGroup, addGroup, addGroupToGroup, addUserToGroup, addUserToGroups, authenticate, authenticate, calculatePostPasswordUpdateAttributes, countDirectMembersOfGroup, currentPrincipalInvalidPasswordAttempts, encryptedCredential, expireAllPasswords, findGroupByName, findGroupWithAttributesByName, findUserByExternalId, findUserByName, findUserWithAttributesByName, forceRenameUser, getAllUserExternalIds, getAuthoritativeDirectory, getDescriptiveName, getDirectoryId, getEncoder, getGroupCount, getKeys, getMemberships, getPasswordConstraints, getUserAvatarByName, getUserCount, getValue, getValues, isEmpty, isGroupDirectGroupMember, isRolesDisabled, isUserDirectGroupMember, removeAllGroups, removeAllUsers, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, requiresPasswordChange, searchGroupRelationships, searchGroupRelationshipsGroupedByName, searchGroups, searchUsers, setAttributes, setDirectoryId, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsNestedGroups, supportsPasswordExpiration, supportsSettingEncryptedCredential, testConnection, updateGroup, updateUserCredential, userAuthenticated
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.crowd.directory.RemoteDirectory
getLocallyFilteredGroupNames, updateUserFromRemoteDirectory
-
Constructor Details
-
CachingDirectory
public CachingDirectory(InternalDirectoryUtils internalDirectoryUtils, PasswordEncoderFactory passwordEncoderFactory, DirectoryDao directoryDao, UserDao userDao, GroupDao groupDao, MembershipDao membershipDao, TombstoneDao tombstoneDao, PasswordConstraintsLoader passwordConstraints)
-
-
Method Details
-
addUser
public User addUser(UserTemplate user, PasswordCredential credential) throws InvalidCredentialException, InvalidUserException, UserAlreadyExistsException, OperationFailedException Adds a user with no special added logic.- 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
- The supplied user is invalid.UserAlreadyExistsException
- The user already existsOperationFailedException
- underlying directory implementation failed to execute the operation.- See Also:
-
addUser
public UserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidCredentialException, InvalidUserException, UserAlreadyExistsException, OperationFailedException Adds a user without modifying it, including storing its attributes.- Specified by:
addUser
in interfaceRemoteDirectory
- Specified by:
addUser
in classAbstractInternalDirectory
- 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
- The supplied user is invalid.UserAlreadyExistsException
- The user already existsOperationFailedException
- underlying directory implementation failed to execute the operation.- See Also:
-
addLocalGroup
public Group addLocalGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException Description copied from interface:InternalRemoteDirectory
Adds a "local" group to the directory.This method can be used to store groups that aren't clones of "external" groups. For example, if an LDAP directory is cloned in an internal directory, it's possible to define "local" groups that exist internally but not in LDAP.
This functionality was added to meet the functionality that Confluence provided.
- Specified by:
addLocalGroup
in interfaceInternalRemoteDirectory
- Specified by:
addLocalGroup
in classAbstractInternalDirectory
- Parameters:
group
- template of the group to add.- Returns:
- the added group retrieved from the underlying store.
- Throws:
InvalidGroupException
- The supplied group is invalid.OperationFailedException
- underlying directory implementation failed to execute the operation.
-
addAllUsers
Description copied from interface:InternalRemoteDirectory
Adds a collection of users to the directory.The bulk adding of users may be significantly faster than adding users one-by-one for large collections.
Caller must ensure that the users don't already exist.
- Parameters:
users
- templates of users to add.- Returns:
- result containing both successful and failed users
-
addAllGroups
Description copied from interface:InternalRemoteDirectory
Adds a collection of groups to the directory.The bulk adding of groups may be significantly faster than adding groups one-by-one for large collections.
Caller must ensure that the users don't already exist.
- Parameters:
groups
- templates of groups to add.- Returns:
- result containing both successful and failed groups
-
addAllUsersToGroup
public BatchResult<String> addAllUsersToGroup(Set<String> userNames, String groupName) throws GroupNotFoundException Description copied from interface:InternalRemoteDirectory
Adds a collection of users to a group.Caller must ensure that the memberships don't already exist.
- Parameters:
userNames
- names of users to add to group.groupName
- name of group to add users to.- Returns:
- result containing both successful and failed users
- Throws:
GroupNotFoundException
- group with suppliedgroupName
does not exist.
-
removeUsersFromGroup
public BatchResult<String> removeUsersFromGroup(Set<String> usernames, String groupName) throws GroupNotFoundException Description copied from interface:InternalRemoteDirectory
Removes a collection of users from a group.- Specified by:
removeUsersFromGroup
in interfaceInternalRemoteDirectory
- Overrides:
removeUsersFromGroup
in classAbstractInternalDirectory
- Parameters:
usernames
- names of users to remove from group.groupName
- name of group to remove users from.- Returns:
- result containing both successful and failed users
- Throws:
GroupNotFoundException
- group with suppliedgroupName
does not exist
-
removeGroupsFromGroup
public BatchResult<String> removeGroupsFromGroup(Collection<String> childGroupNames, String groupName) throws GroupNotFoundException Description copied from interface:InternalRemoteDirectory
Removes a collection of child groups from a group.- Specified by:
removeGroupsFromGroup
in interfaceInternalRemoteDirectory
- Overrides:
removeGroupsFromGroup
in classAbstractInternalDirectory
- Parameters:
childGroupNames
- names of child groups to remove from group.groupName
- name of group to remove child groups from.- Returns:
- result containing both successful and failed child groups
- Throws:
GroupNotFoundException
- group with suppliedgroupName
cannot be found.
-
updateUser
Description copied from interface:RemoteDirectory
Updates theuser
.- Parameters:
user
- The user to update.- Returns:
- the updated user retrieved from the underlying store.
- Throws:
InvalidUserException
- the supplied user is invalid.UserNotFoundException
- the user does not exist in the directory store.
-
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:
-