com.atlassian.crowd.directory
Class AbstractInternalDirectory

java.lang.Object
  extended by com.atlassian.crowd.directory.AbstractInternalDirectory
All Implemented Interfaces:
InternalRemoteDirectory, RemoteDirectory, Attributes
Direct Known Subclasses:
CachingDirectory, InternalDirectory

public abstract class AbstractInternalDirectory
extends java.lang.Object
implements InternalRemoteDirectory

This class holds methods that are common to both InternalDirectory and CachingDirectory.


Field Summary
static java.lang.String ATTRIBUTE_PASSWORD_HISTORY_COUNT
           
static java.lang.String ATTRIBUTE_PASSWORD_MAX_ATTEMPTS
           
static java.lang.String ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME
           
static java.lang.String ATTRIBUTE_PASSWORD_REGEX
           
static java.lang.String ATTRIBUTE_USER_ENCRYPTION_METHOD
           
protected  AttributeValuesHolder attributes
           
static java.lang.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)
           
 
Method Summary
 Group addGroup(GroupTemplate group)
          Adds a group to the directory store.
 void addGroupToGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Adds a group as a member of a parent group.
abstract  Group addLocalGroup(GroupTemplate group)
           
abstract  User addUser(UserTemplate user, PasswordCredential credential)
          Adds a user to the directory store.
 void addUserToGroup(java.lang.String username, java.lang.String groupName)
          Adds a user as a member of a group.
 User authenticate(java.lang.String name, PasswordCredential credential)
          Authenticates a user with the directory store.
protected  long currentPrincipalInvalidPasswordAttempts(UserWithAttributes user)
           
protected  void encryptCredential(PasswordCredential passwordCredential)
           
 InternalDirectoryGroup findGroupByName(java.lang.String name)
          Finds the group that matches the supplied name.
 GroupWithAttributes findGroupWithAttributesByName(java.lang.String name)
          Finds the group that matches the supplied name.
 TimestampedUser findUserByName(java.lang.String name)
          Finds the user that matches the supplied name.
 UserWithAttributes findUserWithAttributesByName(java.lang.String name)
          Finds the user that matches the supplied name.
 java.lang.String getDescriptiveName()
          Returns a descriptive name for the type of directory.
 long getDirectoryId()
          Gets the internal unique directoryId of the directory store.
protected  PasswordEncoder getEncoder()
           
 java.util.Set<java.lang.String> getKeys()
          Gets all the keys of the attributes.
 java.lang.String getValue(java.lang.String name)
          Returns the value associated with the given key, returns null if there is no value, or throws an exception if there is more than one value.
 java.util.Set<java.lang.String> getValues(java.lang.String name)
          Get all the values associated with a given key.
 boolean isEmpty()
           
 boolean isGroupDirectGroupMember(java.lang.String childGroup, java.lang.String parentGroup)
          Determines if a group is a direct member of another group.
 boolean isRolesDisabled()
          Expose whether the directory has roles disabled.
 boolean isUserDirectGroupMember(java.lang.String username, java.lang.String groupName)
          Determines if a user is a direct member of a group.
 void removeAllGroups(java.util.Set<java.lang.String> groupNames)
           
 void removeAllUsers(java.util.Set<java.lang.String> userNames)
           
 void removeGroup(java.lang.String name)
          Removes the group that matches the supplied name.
 void removeGroupAttributes(java.lang.String groupName, java.lang.String attributeName)
          Removes all the values for a single attribute key for a group.
 void removeGroupFromGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Removes a group as a member of a parent group.
 void removeUser(java.lang.String name)
          Removes the user that matches the supplied name.
 void removeUserAttributes(java.lang.String username, java.lang.String attributeName)
          Removes all the values for a single attribute key for a user.
 void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
          Removes a user as a member of a group.
 Group renameGroup(java.lang.String oldName, java.lang.String newName)
          Renames a group.
 User renameUser(java.lang.String oldName, java.lang.String newName)
          Renames a user.
protected  boolean requiresPasswordChange(UserWithAttributes user)
           
<T> java.util.List<T>
searchGroupRelationships(MembershipQuery<T> query)
          Searches for membership information.
<T> java.util.List<T>
searchGroups(EntityQuery<T> query)
          Searches for groups that match the supplied query criteria.
<T> java.util.List<T>
searchUsers(EntityQuery<T> query)
          Searches for users that match the supplied query criteria.
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          Called by the DirectoryInstanceLoader after constructing an InternalDirectory.
 void setDirectoryId(long id)
          Called by the DirectoryInstanceLoader after constructing an InternalDirectory.
 void storeGroupAttributes(java.lang.String groupName, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
          Adds or updates a group's attributes with the new Map of attribute values in the directory specified by the passed in directoryId.
 void storeUserAttributes(java.lang.String username, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
          Adds or updates a user's attributes with the new Map of attribute values in the directory specified by the passed in directoryId.
 boolean supportsInactiveAccounts()
          Internal directories always support inactive accounts.
 boolean supportsNestedGroups()
          Allows us to only display nested-group related UI for directories that support it.
 void testConnection()
          Does nothing, connection is determined by the ability to communicate with the database.
 Group updateGroup(GroupTemplate group)
          Updates the group.
 User updateUser(UserTemplate user)
          Updates the user.
 void updateUserCredential(java.lang.String name, PasswordCredential newCredential)
          Updates the password for a user.
 
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
 

Field Detail

DESCRIPTIVE_NAME

public static final java.lang.String DESCRIPTIVE_NAME
See Also:
Constant Field Values

ATTRIBUTE_PASSWORD_REGEX

public static final java.lang.String ATTRIBUTE_PASSWORD_REGEX
See Also:
Constant Field Values

ATTRIBUTE_PASSWORD_MAX_ATTEMPTS

public static final java.lang.String ATTRIBUTE_PASSWORD_MAX_ATTEMPTS
See Also:
Constant Field Values

ATTRIBUTE_PASSWORD_HISTORY_COUNT

public static final java.lang.String ATTRIBUTE_PASSWORD_HISTORY_COUNT
See Also:
Constant Field Values

ATTRIBUTE_USER_ENCRYPTION_METHOD

public static final java.lang.String ATTRIBUTE_USER_ENCRYPTION_METHOD
See Also:
Constant Field Values

ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME

public static final java.lang.String ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME
See Also:
Constant Field Values

directoryId

protected long directoryId

attributes

protected AttributeValuesHolder attributes

passwordEncoderFactory

protected final PasswordEncoderFactory passwordEncoderFactory

directoryDao

protected final DirectoryDao directoryDao

userDao

protected final UserDao userDao

groupDao

protected final GroupDao groupDao

membershipDao

protected final MembershipDao membershipDao

internalDirectoryUtils

protected final InternalDirectoryUtils internalDirectoryUtils
Constructor Detail

AbstractInternalDirectory

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

getDirectoryId

public long getDirectoryId()
Description copied from interface: RemoteDirectory
Gets the internal unique directoryId of the directory store.

Specified by:
getDirectoryId in interface RemoteDirectory
Returns:
The directoryId.

setDirectoryId

public void setDirectoryId(long id)
Called by the DirectoryInstanceLoader after constructing an InternalDirectory.

Specified by:
setDirectoryId in interface RemoteDirectory
Parameters:
id - The unique id of the Directory stored in the database.

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Called by the DirectoryInstanceLoader after constructing an InternalDirectory.

Specified by:
setAttributes in interface RemoteDirectory
Parameters:
attributes - attributes map.

getValues

public java.util.Set<java.lang.String> getValues(java.lang.String name)
Description copied from interface: Attributes
Get all the values associated with a given key. Duplicate values are not allowed, and this should be enforced case-insensitively to match the behaviour of LDAP servers. Will return null if the key does not exist.

Specified by:
getValues in interface Attributes
Parameters:
name - the key to retrieve the values for
Returns:
the values associated with the given key, or null if the key does not exist.

getValue

public java.lang.String getValue(java.lang.String name)
Description copied from interface: Attributes
Returns the value associated with the given key, returns null if there is no value, or throws an exception if there is more than one value.

Specified by:
getValue in interface Attributes
Parameters:
name - the key to retrieve the value for
Returns:
the value associated with the given key, or null if there is no value

getKeys

public java.util.Set<java.lang.String> getKeys()
Description copied from interface: Attributes
Gets all the keys of the attributes. Warning: case-insensitive keys are currently no enforced, however this is the case for LDAP, so this may be implemented in the future.

Specified by:
getKeys in interface Attributes
Returns:
a set of all the keys.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Attributes
Returns:
true if there are no attributes

getDescriptiveName

public java.lang.String getDescriptiveName()
Description copied from interface: RemoteDirectory
Returns a descriptive name for the type of directory.

Specified by:
getDescriptiveName in interface RemoteDirectory
Returns:
descriptive name.

findUserByName

public TimestampedUser findUserByName(java.lang.String name)
                               throws UserNotFoundException
Description copied from interface: RemoteDirectory
Finds the user that matches the supplied name.

Specified by:
findUserByName in interface InternalRemoteDirectory
Specified by:
findUserByName in interface RemoteDirectory
Parameters:
name - the name of the user (username).
Returns:
user entity.
Throws:
UserNotFoundException - a user with the supplied name does not exist.

findUserWithAttributesByName

public UserWithAttributes findUserWithAttributesByName(java.lang.String name)
                                                throws UserNotFoundException
Description copied from interface: RemoteDirectory
Finds the user that matches the supplied name.

Specified by:
findUserWithAttributesByName in interface RemoteDirectory
Parameters:
name - the name of the user (username).
Returns:
user entity with attributes.
Throws:
UserNotFoundException - a user with the supplied name does not exist.

authenticate

public User authenticate(java.lang.String name,
                         PasswordCredential credential)
                  throws InactiveAccountException,
                         InvalidAuthenticationException,
                         ExpiredCredentialException,
                         UserNotFoundException
Description copied from interface: RemoteDirectory
Authenticates a user with the directory store.

Specified by:
authenticate in interface RemoteDirectory
Parameters:
name - The name of the user (username).
credential - The supplied credentials (password).
Returns:
user entity.
Throws:
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.

currentPrincipalInvalidPasswordAttempts

protected long currentPrincipalInvalidPasswordAttempts(UserWithAttributes user)
Parameters:
user - user with attributes.
Returns:
long value of the invalid password attempts attribute on the user.

requiresPasswordChange

protected boolean requiresPasswordChange(UserWithAttributes user)
Parameters:
user - user with attributes.
Returns:
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).

addUser

public abstract User addUser(UserTemplate user,
                             PasswordCredential credential)
                      throws InvalidCredentialException,
                             InvalidUserException
Description copied from interface: RemoteDirectory
Adds a user to the directory store.

Specified by:
addUser in interface RemoteDirectory
Parameters:
user - template of the user to add.
credential - password. May be null, since JIRA creates a user in two steps (user THEN password)
Returns:
the added user retrieved from the underlying store.
Throws:
InvalidCredentialException - The supplied credential is invalid.
InvalidUserException - The supplied user is invalid.

encryptCredential

protected void encryptCredential(PasswordCredential passwordCredential)

getEncoder

protected PasswordEncoder getEncoder()

updateUser

public User updateUser(UserTemplate user)
                throws InvalidUserException,
                       UserNotFoundException
Description copied from interface: RemoteDirectory
Updates the user.

Specified by:
updateUser in interface RemoteDirectory
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.

updateUserCredential

public void updateUserCredential(java.lang.String name,
                                 PasswordCredential newCredential)
                          throws InvalidCredentialException,
                                 UserNotFoundException
Description copied from interface: RemoteDirectory
Updates the password for a user.

Specified by:
updateUserCredential in interface RemoteDirectory
Parameters:
name - The name of the user (username).
newCredential - The new credential (password).
Throws:
InvalidCredentialException - The supplied credential is invalid.
UserNotFoundException - The user does not exist.

renameUser

public User renameUser(java.lang.String oldName,
                       java.lang.String newName)
                throws InvalidUserException,
                       UserNotFoundException
Description copied from interface: RemoteDirectory
Renames a user.

Specified by:
renameUser in interface RemoteDirectory
Parameters:
oldName - name of existing user.
newName - desired name of user.
Returns:
renamed user.
Throws:
InvalidUserException - if the new username is invalid or already exists in the directory.
UserNotFoundException - if the user with the existing name does not exist.

storeUserAttributes

public void storeUserAttributes(java.lang.String username,
                                java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                         throws UserNotFoundException
Description copied from interface: RemoteDirectory
Adds or updates a user's attributes with the new Map of attribute values in the directory specified by the passed in directoryId.

The attributes map represents new or updated attributes and does not replace existing attributes unless the key of an attribute matches the key of an existing

Attributes with values of empty sets are not added (these attributes are effectively removed).

Specified by:
storeUserAttributes in interface RemoteDirectory
Parameters:
username - name of user to update.
attributes - new or updated attributes (attributes that don't need changing should not appear in this Map).
Throws:
UserNotFoundException - user with supplied username does not exist.

removeUserAttributes

public void removeUserAttributes(java.lang.String username,
                                 java.lang.String attributeName)
                          throws UserNotFoundException
Description copied from interface: RemoteDirectory
Removes all the values for a single attribute key for a user. If the attribute key does not exist nothing will happen.

Specified by:
removeUserAttributes in interface RemoteDirectory
Parameters:
username - name of the user to update.
attributeName - name of attribute to remove.
Throws:
UserNotFoundException - user with supplied username does not exist.

removeUser

public void removeUser(java.lang.String name)
                throws UserNotFoundException
Description copied from interface: RemoteDirectory
Removes the user that matches the supplied name.

Specified by:
removeUser in interface RemoteDirectory
Parameters:
name - The name of the user (username).
Throws:
UserNotFoundException - The user does not exist.

removeAllUsers

public void removeAllUsers(java.util.Set<java.lang.String> userNames)
Specified by:
removeAllUsers in interface InternalRemoteDirectory

removeAllGroups

public void removeAllGroups(java.util.Set<java.lang.String> groupNames)
                     throws GroupNotFoundException
Specified by:
removeAllGroups in interface InternalRemoteDirectory
Throws:
GroupNotFoundException

searchUsers

public <T> java.util.List<T> searchUsers(EntityQuery<T> query)
Description copied from interface: RemoteDirectory
Searches for users that match the supplied query criteria.

Specified by:
searchUsers in interface RemoteDirectory
Parameters:
query - EntityQuery for Entity.USER.
Returns:
List<User> or List<String> of users/usernames matching the search criteria. An empty List will be returned if no users matching the criteria are found.

findGroupByName

public InternalDirectoryGroup findGroupByName(java.lang.String name)
                                       throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Finds the group that matches the supplied name.

Specified by:
findGroupByName in interface InternalRemoteDirectory
Specified by:
findGroupByName in interface RemoteDirectory
Parameters:
name - the name of the group.
Returns:
group entity.
Throws:
GroupNotFoundException - a group with the supplied name does not exist.

findGroupWithAttributesByName

public GroupWithAttributes findGroupWithAttributesByName(java.lang.String name)
                                                  throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Finds the group that matches the supplied name.

Specified by:
findGroupWithAttributesByName in interface RemoteDirectory
Parameters:
name - the name of the group.
Returns:
group entity with attributes.
Throws:
GroupNotFoundException - a group with the supplied name does not exist.

addGroup

public Group addGroup(GroupTemplate group)
               throws InvalidGroupException,
                      GroupNotFoundException
Description copied from interface: RemoteDirectory
Adds a group to the directory store.

Specified by:
addGroup in interface RemoteDirectory
Parameters:
group - template of the group to add.
Returns:
the added group retrieved from the underlying store.
Throws:
InvalidGroupException - The supplied group is invalid.
GroupNotFoundException - The group could not be looked up after creation

addLocalGroup

public abstract Group addLocalGroup(GroupTemplate group)
                             throws InvalidGroupException
Specified by:
addLocalGroup in interface InternalRemoteDirectory
Throws:
InvalidGroupException

updateGroup

public Group updateGroup(GroupTemplate group)
                  throws InvalidGroupException,
                         GroupNotFoundException
Description copied from interface: RemoteDirectory
Updates the group.

Specified by:
updateGroup in interface RemoteDirectory
Parameters:
group - The group to update.
Returns:
the updated group retrieved from the underlying store.
Throws:
InvalidGroupException - the supplied group is invalid.
GroupNotFoundException - the group does not exist in the directory store.

renameGroup

public Group renameGroup(java.lang.String oldName,
                         java.lang.String newName)
                  throws InvalidGroupException,
                         GroupNotFoundException
Description copied from interface: RemoteDirectory
Renames a group.

Specified by:
renameGroup in interface RemoteDirectory
Parameters:
oldName - name of existing group.
newName - desired name of group.
Returns:
renamed group.
Throws:
InvalidGroupException - if the new groupname is invalid or already exists in the directory.
GroupNotFoundException - if the group with the existing name does not exist.

storeGroupAttributes

public void storeGroupAttributes(java.lang.String groupName,
                                 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                          throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Adds or updates a group's attributes with the new Map of attribute values in the directory specified by the passed in directoryId.

The attributes map represents new or updated attributes and does not replace existing attributes unless the key of an attribute matches the key of an existing

Attributes with values of empty sets are not added (these attributes are effectively removed).

Specified by:
storeGroupAttributes in interface RemoteDirectory
Parameters:
groupName - name of group to update.
attributes - new or updated attributes (attributes that don't need changing should not appear in this Map).
Throws:
GroupNotFoundException - group with supplied groupName does not exist.

removeGroupAttributes

public void removeGroupAttributes(java.lang.String groupName,
                                  java.lang.String attributeName)
                           throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Removes all the values for a single attribute key for a group.

Specified by:
removeGroupAttributes in interface RemoteDirectory
Parameters:
groupName - name of the group to update.
attributeName - name of attribute to remove.
Throws:
GroupNotFoundException - group with supplied groupName does not exist.

removeGroup

public void removeGroup(java.lang.String name)
                 throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Removes the group that matches the supplied name.

Specified by:
removeGroup in interface RemoteDirectory
Parameters:
name - The name of the group.
Throws:
GroupNotFoundException - The group does not exist.

searchGroups

public <T> java.util.List<T> searchGroups(EntityQuery<T> query)
Description copied from interface: RemoteDirectory
Searches for groups that match the supplied query criteria.

Specified by:
searchGroups in interface RemoteDirectory
Parameters:
query - EntityQuery for Entity.GROUP.
Returns:
List or List of groups/groupnames matching the search criteria. An empty List will be returned if no groups matching the criteria are found.

isUserDirectGroupMember

public boolean isUserDirectGroupMember(java.lang.String username,
                                       java.lang.String groupName)
Description copied from interface: RemoteDirectory
Determines if a user is a direct member of a group. The directory is NOT expected to resolve any transitive group relationships.

Specified by:
isUserDirectGroupMember in interface RemoteDirectory
Parameters:
username - name of user.
groupName - name of group.
Returns:
true iff the user is a direct member of the group.

isGroupDirectGroupMember

public boolean isGroupDirectGroupMember(java.lang.String childGroup,
                                        java.lang.String parentGroup)
Description copied from interface: RemoteDirectory
Determines if a group is a direct member of another group. The directory is NOT expected to resolve any transitive group relationships.

Specified by:
isGroupDirectGroupMember in interface RemoteDirectory
Parameters:
childGroup - name of child group.
parentGroup - name of parent group.
Returns:
true iff the childGroup is a direct member of the parentGroup.

addUserToGroup

public void addUserToGroup(java.lang.String username,
                           java.lang.String groupName)
                    throws UserNotFoundException,
                           GroupNotFoundException
Description copied from interface: RemoteDirectory
Adds a user as a member of a group. This means that all user members of childGroup will appear as members of parentGroup to querying applications.

Specified by:
addUserToGroup in interface RemoteDirectory
Parameters:
username - The user that will become a member of groupName
groupName - The group that will gain a new member.
Throws:
UserNotFoundException - If the user cannot be found.
GroupNotFoundException - If the group cannot be found.

addGroupToGroup

public void addGroupToGroup(java.lang.String childGroup,
                            java.lang.String parentGroup)
                     throws InvalidMembershipException,
                            GroupNotFoundException
Description copied from interface: RemoteDirectory
Adds a group as a member of a parent group.

Specified by:
addGroupToGroup in interface RemoteDirectory
Parameters:
childGroup - The group that will become a member of parentGroup
parentGroup - The group that will gain a new member
Throws:
InvalidMembershipException - if the childGroup and parentGroup exist but are of different GroupTypes.
GroupNotFoundException - One or both of the groups cannot be found.

removeUserFromGroup

public void removeUserFromGroup(java.lang.String username,
                                java.lang.String groupName)
                         throws MembershipNotFoundException,
                                GroupNotFoundException,
                                UserNotFoundException
Description copied from interface: RemoteDirectory
Removes a user as a member of a group.

Specified by:
removeUserFromGroup in interface RemoteDirectory
Parameters:
username - The user that will be removed from parentGroup
groupName - The group that will lose the member.
Throws:
MembershipNotFoundException - if the user is not a direct member of the group.
GroupNotFoundException - If the group cannot be found.
UserNotFoundException - If the user cannot be found.

removeGroupFromGroup

public void removeGroupFromGroup(java.lang.String childGroup,
                                 java.lang.String parentGroup)
                          throws InvalidMembershipException,
                                 MembershipNotFoundException,
                                 GroupNotFoundException
Description copied from interface: RemoteDirectory
Removes a group as a member of a parent group.

Specified by:
removeGroupFromGroup in interface RemoteDirectory
Parameters:
childGroup - The group that will be removed from parentGroup
parentGroup - The group that will lose the member.
Throws:
InvalidMembershipException - if the childGroup and parentGroup exist but are of different GroupTypes.
MembershipNotFoundException - if the childGroup is not a direct member of the parentGroup.
GroupNotFoundException - One or both of the groups cannot be found.

searchGroupRelationships

public <T> java.util.List<T> searchGroupRelationships(MembershipQuery<T> query)
Description copied from interface: RemoteDirectory
Searches for membership information.

Specified by:
searchGroupRelationships in interface RemoteDirectory
Parameters:
query - query for memberships.
Returns:
a List of Users or Groups or Strings depending on the query criteria. An empty List if there are no results.

testConnection

public void testConnection()
                    throws OperationFailedException
Does nothing, connection is determined by the ability to communicate with the database. Crowd wouldn't have started if the database connection failed.

Specified by:
testConnection in interface RemoteDirectory
Throws:
OperationFailedException - underlying directory implementation failed to execute the operation.

supportsInactiveAccounts

public boolean supportsInactiveAccounts()
Internal directories always support inactive accounts.

Specified by:
supportsInactiveAccounts in interface RemoteDirectory
Returns:
true

supportsNestedGroups

public boolean supportsNestedGroups()
Description copied from interface: RemoteDirectory
Allows us to only display nested-group related UI for directories that support it.

Specified by:
supportsNestedGroups in interface RemoteDirectory
Returns:
true because Internal Directories support nested groups as of Crowd 2.0.

isRolesDisabled

public boolean isRolesDisabled()
Description copied from interface: RemoteDirectory
Expose whether the directory has roles disabled. Always true for directory that don't allow disabling.

Specified by:
isRolesDisabled in interface RemoteDirectory
Returns:
true if the directory has roles manually disabled.


Copyright © 2010 Atlassian. All Rights Reserved.