|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.directory.AbstractInternalDirectory
public abstract class AbstractInternalDirectory
This class holds methods that are common to both InternalDirectory and CachingDirectory.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
AbstractInternalDirectory(InternalDirectoryUtils internalDirectoryUtils,
PasswordEncoderFactory passwordEncoderFactory,
DirectoryDao directoryDao,
UserDao userDao,
GroupDao groupDao,
MembershipDao membershipDao,
PasswordConstraintsLoader passwordConstraints)
|
|
| 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.InternalRemoteDirectory |
|---|
addAllGroups, addAllUsers, addAllUsersToGroup, isLocalUserStatusEnabled |
| Methods inherited from interface com.atlassian.crowd.directory.RemoteDirectory |
|---|
updateUser |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public AbstractInternalDirectory(InternalDirectoryUtils internalDirectoryUtils,
PasswordEncoderFactory passwordEncoderFactory,
DirectoryDao directoryDao,
UserDao userDao,
GroupDao groupDao,
MembershipDao membershipDao,
PasswordConstraintsLoader passwordConstraints)
| Method Detail |
|---|
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 RemoteDirectory
public TimestampedUser findUserByName(String name)
throws UserNotFoundException
findUserByName in interface InternalRemoteDirectoryfindUserByName in interface RemoteDirectoryUserNotFoundException
public TimestampedUser findUserByExternalId(String externalId)
throws UserNotFoundException
findUserByExternalId in interface InternalRemoteDirectoryfindUserByExternalId in interface RemoteDirectoryUserNotFoundException
public UserWithAttributes findUserWithAttributesByName(String name)
throws UserNotFoundException
findUserWithAttributesByName in interface RemoteDirectoryUserNotFoundException
public 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.protected 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 User addUser(UserTemplate user,
PasswordCredential credential)
throws InvalidCredentialException,
InvalidUserException,
UserAlreadyExistsException,
OperationFailedException
addUser in interface RemoteDirectoryInvalidCredentialException
InvalidUserException
UserAlreadyExistsException
OperationFailedExceptionprotected PasswordCredential encryptedCredential(PasswordCredential passwordCredential)
protected PasswordEncoder getEncoder()
public void updateUserCredential(String name,
PasswordCredential newCredential)
throws InvalidCredentialException,
UserNotFoundException
updateUserCredential in interface RemoteDirectoryInvalidCredentialException
UserNotFoundExceptionprotected static Map<String,Set<String>> calculatePostPasswordUpdateAttributes()
public User renameUser(String oldName,
String newName)
throws InvalidUserException,
UserNotFoundException,
UserAlreadyExistsException
renameUser in interface RemoteDirectoryInvalidUserException
UserNotFoundException
UserAlreadyExistsException
public 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 InternalRemoteDirectoryOperationFailedException
public long getUserCount()
throws OperationFailedException
getUserCount in interface InternalRemoteDirectoryOperationFailedException
public void storeUserAttributes(String username,
Map<String,Set<String>> attributes)
throws UserNotFoundException
storeUserAttributes in interface RemoteDirectoryUserNotFoundException
public void removeUserAttributes(String username,
String attributeName)
throws UserNotFoundException
removeUserAttributes in interface RemoteDirectoryUserNotFoundException
public 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 RemoteDirectory
public InternalDirectoryGroup findGroupByName(String name)
throws GroupNotFoundException
findGroupByName in interface InternalRemoteDirectoryfindGroupByName in interface RemoteDirectoryGroupNotFoundException
public GroupWithAttributes findGroupWithAttributesByName(String name)
throws GroupNotFoundException
findGroupWithAttributesByName in interface RemoteDirectoryGroupNotFoundException
public Group addGroup(GroupTemplate group)
throws InvalidGroupException,
OperationFailedException
addGroup in interface RemoteDirectoryInvalidGroupException
OperationFailedException
public abstract Group addLocalGroup(GroupTemplate group)
throws InvalidGroupException,
OperationFailedException
addLocalGroup in interface InternalRemoteDirectoryInvalidGroupException
OperationFailedException
public Group updateGroup(GroupTemplate group)
throws InvalidGroupException,
GroupNotFoundException
updateGroup in interface RemoteDirectoryInvalidGroupException
GroupNotFoundException
public Group renameGroup(String oldName,
String newName)
throws InvalidGroupException,
GroupNotFoundException
renameGroup in interface RemoteDirectoryInvalidGroupException
GroupNotFoundException
public void storeGroupAttributes(String groupName,
Map<String,Set<String>> attributes)
throws GroupNotFoundException
storeGroupAttributes in interface RemoteDirectoryGroupNotFoundException
public void removeGroupAttributes(String groupName,
String attributeName)
throws GroupNotFoundException
removeGroupAttributes in interface RemoteDirectoryGroupNotFoundException
public void removeGroup(String name)
throws GroupNotFoundException
removeGroup in interface RemoteDirectoryGroupNotFoundExceptionpublic <T> List<T> searchGroups(EntityQuery<T> query)
searchGroups in interface RemoteDirectory
public boolean isUserDirectGroupMember(String username,
String groupName)
isUserDirectGroupMember in interface RemoteDirectory
public boolean isGroupDirectGroupMember(String childGroup,
String parentGroup)
isGroupDirectGroupMember in interface RemoteDirectory
public void addUserToGroup(String username,
String groupName)
throws UserNotFoundException,
GroupNotFoundException,
MembershipAlreadyExistsException
addUserToGroup in interface RemoteDirectoryUserNotFoundException
GroupNotFoundException
MembershipAlreadyExistsException
public void addGroupToGroup(String childGroup,
String parentGroup)
throws InvalidMembershipException,
GroupNotFoundException,
MembershipAlreadyExistsException
addGroupToGroup in interface RemoteDirectoryInvalidMembershipException
GroupNotFoundException
MembershipAlreadyExistsException
public void removeUserFromGroup(String username,
String groupName)
throws MembershipNotFoundException,
GroupNotFoundException,
UserNotFoundException
removeUserFromGroup in interface RemoteDirectoryMembershipNotFoundException
GroupNotFoundException
UserNotFoundException
public void removeGroupFromGroup(String childGroup,
String parentGroup)
throws InvalidMembershipException,
MembershipNotFoundException,
GroupNotFoundException
removeGroupFromGroup in interface RemoteDirectoryInvalidMembershipException
MembershipNotFoundException
GroupNotFoundException
public BoundedCount countDirectMembersOfGroup(String groupName,
int querySizeHint)
countDirectMembersOfGroup in interface RemoteDirectorypublic <T> List<T> searchGroupRelationships(MembershipQuery<T> query)
searchGroupRelationships in interface RemoteDirectory
public 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 RemoteDirectory
public Iterable<Membership> getMemberships()
throws OperationFailedException
getMemberships in interface RemoteDirectoryOperationFailedExceptionpublic RemoteDirectory getAuthoritativeDirectory()
getAuthoritativeDirectory in interface RemoteDirectorypublic void expireAllPasswords()
expireAllPasswords in interface RemoteDirectory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||