public abstract class AbstractInternalDirectory extends Object implements InternalRemoteDirectory
InternalDirectory and CachingDirectory.| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_PASSWORD_COMPLEXITY_MESSAGE |
static String |
ATTRIBUTE_PASSWORD_HISTORY_COUNT |
static String |
ATTRIBUTE_PASSWORD_MAX_ATTEMPTS |
static String |
ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME |
static String |
ATTRIBUTE_PASSWORD_MINIMUM_LENGTH
The minimum length a password can have for users in this directory, stored as a non-negative integer
|
static String |
ATTRIBUTE_PASSWORD_MINIMUM_SCORE
The minimum password score allowed for new passwords for users in this directory, stored as
PasswordScore.getRanking(). |
static String |
ATTRIBUTE_PASSWORD_REGEX |
static String |
ATTRIBUTE_USER_ENCRYPTION_METHOD |
protected AttributeValuesHolder |
attributes |
static String |
DESCRIPTIVE_NAME |
protected DirectoryDao |
directoryDao |
protected long |
directoryId |
protected GroupDao |
groupDao |
protected InternalDirectoryUtils |
internalDirectoryUtils |
protected MembershipDao |
membershipDao |
protected PasswordEncoderFactory |
passwordEncoderFactory |
protected UserDao |
userDao |
| Constructor and Description |
|---|
AbstractInternalDirectory(InternalDirectoryUtils internalDirectoryUtils,
PasswordEncoderFactory passwordEncoderFactory,
DirectoryDao directoryDao,
UserDao userDao,
GroupDao groupDao,
MembershipDao membershipDao,
PasswordConstraintsLoader passwordConstraints) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAllGroups, addAllUsers, addAllUsersToGroup, isLocalUserStatusEnabledaddUser, updateUser, updateUserFromRemoteDirectorypublic static final String DESCRIPTIVE_NAME
public static final String ATTRIBUTE_PASSWORD_REGEX
public static final String ATTRIBUTE_PASSWORD_COMPLEXITY_MESSAGE
public static final String ATTRIBUTE_PASSWORD_MAX_ATTEMPTS
public static final String ATTRIBUTE_PASSWORD_HISTORY_COUNT
public static final String ATTRIBUTE_USER_ENCRYPTION_METHOD
public static final String ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME
public static final String ATTRIBUTE_PASSWORD_MINIMUM_LENGTH
public static final String ATTRIBUTE_PASSWORD_MINIMUM_SCORE
PasswordScore.getRanking().protected long directoryId
protected AttributeValuesHolder attributes
protected final PasswordEncoderFactory passwordEncoderFactory
protected final DirectoryDao directoryDao
protected final UserDao userDao
protected final GroupDao groupDao
protected final MembershipDao membershipDao
protected final InternalDirectoryUtils internalDirectoryUtils
public AbstractInternalDirectory(InternalDirectoryUtils internalDirectoryUtils, PasswordEncoderFactory passwordEncoderFactory, DirectoryDao directoryDao, UserDao userDao, GroupDao groupDao, MembershipDao membershipDao, PasswordConstraintsLoader passwordConstraints)
public long getDirectoryId()
getDirectoryId in interface RemoteDirectorypublic void setDirectoryId(long id)
DirectoryInstanceLoader after
constructing an InternalDirectory.setDirectoryId in interface RemoteDirectoryid - The unique id of the Directory stored in the database.public void setAttributes(Map<String,String> attributes)
DirectoryInstanceLoader after
constructing an InternalDirectory.setAttributes in interface RemoteDirectoryattributes - attributes map.public Set<String> getValues(String name)
getValues in interface Attributespublic String getValue(String name)
getValue in interface Attributespublic Set<String> getKeys()
getKeys in interface Attributespublic boolean isEmpty()
isEmpty in interface Attributespublic String getDescriptiveName()
getDescriptiveName in interface RemoteDirectorypublic TimestampedUser findUserByName(String name) throws UserNotFoundException
findUserByName in interface InternalRemoteDirectoryfindUserByName in interface RemoteDirectoryUserNotFoundExceptionpublic TimestampedUser findUserByExternalId(String externalId) throws UserNotFoundException
findUserByExternalId in interface InternalRemoteDirectoryfindUserByExternalId in interface RemoteDirectoryUserNotFoundExceptionpublic UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException
findUserWithAttributesByName in interface RemoteDirectoryUserNotFoundExceptionpublic User authenticate(String name, PasswordCredential credential) throws InactiveAccountException, InvalidAuthenticationException, ExpiredCredentialException, UserNotFoundException
authenticate in interface RemoteDirectoryname - The name of the user (username).credential - The supplied credentials (password).InactiveAccountException - The supplied user is inactive.InvalidAuthenticationException - Authentication with the provided credentials failed OR the user has exceeded the maximum number of failed authentication attempts.UserNotFoundException - The user wth the supplied name does not exist.ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.public User userAuthenticated(String username) throws OperationFailedException, UserNotFoundException, InactiveAccountException
userAuthenticated in interface RemoteDirectoryOperationFailedExceptionUserNotFoundExceptionInactiveAccountExceptionprotected long currentPrincipalInvalidPasswordAttempts(UserWithAttributes user)
user - user with attributes.protected boolean requiresPasswordChange(UserWithAttributes user)
user - user with attributes.true if the requires password change attribute on the user is set to true, or if
the password last changed attribute on the user exceeds the password max change time attribute on the
directory (ie. password timeout).public abstract UserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidCredentialException, InvalidUserException, UserAlreadyExistsException, OperationFailedException
addUser in interface RemoteDirectoryInvalidCredentialExceptionInvalidUserExceptionUserAlreadyExistsExceptionOperationFailedExceptionprotected PasswordCredential encryptedCredential(PasswordCredential passwordCredential)
protected PasswordEncoder getEncoder()
public void updateUserCredential(String name, PasswordCredential newCredential) throws InvalidCredentialException, UserNotFoundException
updateUserCredential in interface RemoteDirectoryInvalidCredentialExceptionUserNotFoundExceptionprotected static Map<String,Set<String>> calculatePostPasswordUpdateAttributes()
public User renameUser(String oldName, String newName) throws InvalidUserException, UserNotFoundException, UserAlreadyExistsException
renameUser in interface RemoteDirectoryInvalidUserExceptionUserNotFoundExceptionUserAlreadyExistsExceptionpublic User forceRenameUser(@Nonnull User oldUser, @Nonnull String newName) throws UserNotFoundException
forceRenameUser in interface InternalRemoteDirectoryUserNotFoundExceptionprotected final Set<PasswordConstraint> getPasswordConstraints()
@Nonnull public Set<String> getAllUserExternalIds() throws OperationFailedException
getAllUserExternalIds in interface InternalRemoteDirectoryOperationFailedExceptionpublic long getUserCount()
throws OperationFailedException
getUserCount in interface InternalRemoteDirectoryOperationFailedExceptionpublic void storeUserAttributes(String username, Map<String,Set<String>> attributes) throws UserNotFoundException
storeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionpublic void removeUserAttributes(String username, String attributeName) throws UserNotFoundException
removeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionpublic void removeUser(String name) throws UserNotFoundException
removeUser in interface RemoteDirectoryUserNotFoundExceptionpublic BatchResult<String> removeAllUsers(Set<String> userNames)
removeAllUsers in interface InternalRemoteDirectorypublic BatchResult<String> removeAllGroups(Set<String> groupNames)
removeAllGroups in interface InternalRemoteDirectorypublic <T> List<T> searchUsers(EntityQuery<T> query)
searchUsers in interface RemoteDirectorypublic InternalDirectoryGroup findGroupByName(String name) throws GroupNotFoundException
findGroupByName in interface InternalRemoteDirectoryfindGroupByName in interface RemoteDirectoryGroupNotFoundExceptionpublic GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException
findGroupWithAttributesByName in interface RemoteDirectoryGroupNotFoundExceptionpublic Group addGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException
addGroup in interface RemoteDirectoryInvalidGroupExceptionOperationFailedExceptionpublic abstract Group addLocalGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException
addLocalGroup in interface InternalRemoteDirectoryInvalidGroupExceptionOperationFailedExceptionpublic Group updateGroup(GroupTemplate group) throws InvalidGroupException, GroupNotFoundException
updateGroup in interface RemoteDirectoryInvalidGroupExceptionGroupNotFoundExceptionpublic Group renameGroup(String oldName, String newName) throws InvalidGroupException, GroupNotFoundException
renameGroup in interface RemoteDirectoryInvalidGroupExceptionGroupNotFoundExceptionpublic void storeGroupAttributes(String groupName, Map<String,Set<String>> attributes) throws GroupNotFoundException
storeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionpublic void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException
removeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionpublic void removeGroup(String name) throws GroupNotFoundException
removeGroup in interface RemoteDirectoryGroupNotFoundExceptionpublic <T> List<T> searchGroups(EntityQuery<T> query)
searchGroups in interface RemoteDirectorypublic boolean isUserDirectGroupMember(String username, String groupName)
isUserDirectGroupMember in interface RemoteDirectorypublic boolean isGroupDirectGroupMember(String childGroup, String parentGroup)
isGroupDirectGroupMember in interface RemoteDirectorypublic void addUserToGroup(String username, String groupName) throws UserNotFoundException, GroupNotFoundException, MembershipAlreadyExistsException
addUserToGroup in interface RemoteDirectoryUserNotFoundExceptionGroupNotFoundExceptionMembershipAlreadyExistsExceptionpublic void addGroupToGroup(String childGroup, String parentGroup) throws InvalidMembershipException, GroupNotFoundException, MembershipAlreadyExistsException
addGroupToGroup in interface RemoteDirectoryInvalidMembershipExceptionGroupNotFoundExceptionMembershipAlreadyExistsExceptionpublic void removeUserFromGroup(String username, String groupName) throws MembershipNotFoundException, GroupNotFoundException, UserNotFoundException
removeUserFromGroup in interface RemoteDirectoryMembershipNotFoundExceptionGroupNotFoundExceptionUserNotFoundExceptionpublic void removeGroupFromGroup(String childGroup, String parentGroup) throws InvalidMembershipException, MembershipNotFoundException, GroupNotFoundException
removeGroupFromGroup in interface RemoteDirectoryInvalidMembershipExceptionMembershipNotFoundExceptionGroupNotFoundExceptionpublic BoundedCount countDirectMembersOfGroup(String groupName, int querySizeHint)
countDirectMembersOfGroup in interface RemoteDirectorypublic <T> List<T> searchGroupRelationships(MembershipQuery<T> query)
searchGroupRelationships in interface RemoteDirectorypublic void testConnection()
throws OperationFailedException
testConnection in interface RemoteDirectoryOperationFailedExceptionpublic boolean supportsInactiveAccounts()
supportsInactiveAccounts in interface RemoteDirectorytrue, alwayspublic boolean supportsNestedGroups()
supportsNestedGroups in interface RemoteDirectorytrue because Internal Directories support nested groups as of Crowd 2.0.public boolean supportsPasswordExpiration()
supportsPasswordExpiration in interface RemoteDirectorytrue, always.public boolean supportsSettingEncryptedCredential()
supportsSettingEncryptedCredential in interface RemoteDirectorytrue, always.public boolean isRolesDisabled()
isRolesDisabled in interface RemoteDirectorypublic Iterable<Membership> getMemberships() throws OperationFailedException
getMemberships in interface RemoteDirectoryOperationFailedExceptionpublic RemoteDirectory getAuthoritativeDirectory()
getAuthoritativeDirectory in interface RemoteDirectorypublic void expireAllPasswords()
expireAllPasswords in interface RemoteDirectorypublic AvatarReference getUserAvatarByName(String username, int sizeHint) throws OperationFailedException
getUserAvatarByName in interface RemoteDirectoryOperationFailedExceptionCopyright © 2018 Atlassian. All rights reserved.