public class RemoteCrowdDirectory extends Object implements RemoteDirectory
RemoteDirectory that allows integration with a remote Crowd server.
This class performs all directory operations against a remote Crowd server. The remote Crowd server sees this class as an application.
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_NAME
Directory attribute key for application name
|
static String |
APPLICATION_PASSWORD
Directory attribute key for application password
|
protected AttributeValuesHolder |
attributes |
static String |
AUTHENTICATION_METHOD_ATTRIBUTE
Directory attribute key for the authentication method (
AuthenticationMethod). |
static String |
CROWD_HTTP_MAX_CONNECTIONS
Directory attribute key for max connections.
|
static String |
CROWD_HTTP_PROXY_HOST
Directory attribute key for http proxy host.
|
static String |
CROWD_HTTP_PROXY_PASSWORD
Directory attribute key for http proxy password.
|
static String |
CROWD_HTTP_PROXY_PORT
Directory attribute key for http proxy port.
|
static String |
CROWD_HTTP_PROXY_USERNAME
Directory attribute key for http proxy username.
|
static String |
CROWD_HTTP_TIMEOUT
Directory attribute key for http timeout.
|
static String |
CROWD_SERVER_URL
Directory attribute key for remote Crowd server URL
|
static String |
DESCRIPTIVE_NAME |
| Constructor and Description |
|---|
RemoteCrowdDirectory(com.atlassian.crowd.service.factory.CrowdClientFactory crowdClientFactory)
Creates a new RemoteCrowdDirectory using the given CrowdClientFactory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocallyFilteredGroupNames, getUserAvatarByName, updateUserFromRemoteDirectorypublic static final String DESCRIPTIVE_NAME
public static final String APPLICATION_NAME
public static final String APPLICATION_PASSWORD
public static final String CROWD_SERVER_URL
public static final String AUTHENTICATION_METHOD_ATTRIBUTE
AuthenticationMethod).public static final String CROWD_HTTP_TIMEOUT
public static final String CROWD_HTTP_MAX_CONNECTIONS
public static final String CROWD_HTTP_PROXY_HOST
public static final String CROWD_HTTP_PROXY_PORT
public static final String CROWD_HTTP_PROXY_USERNAME
public static final String CROWD_HTTP_PROXY_PASSWORD
protected AttributeValuesHolder attributes
public RemoteCrowdDirectory(com.atlassian.crowd.service.factory.CrowdClientFactory crowdClientFactory)
crowdClientFactory - factory for creating a CrowdClientpublic long getDirectoryId()
getDirectoryId in interface RemoteDirectorypublic void setDirectoryId(long directoryId)
setDirectoryId in interface RemoteDirectorypublic User findUserByName(String name) throws UserNotFoundException, OperationFailedException
findUserByName in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException
findUserWithAttributesByName in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic User findUserByExternalId(String externalId) throws UserNotFoundException, OperationFailedException
findUserByExternalId in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic User authenticate(String username, PasswordCredential credential) throws UserNotFoundException, InactiveAccountException, InvalidAuthenticationException, ExpiredCredentialException, OperationFailedException
authenticate in interface RemoteDirectoryUserNotFoundExceptionInactiveAccountExceptionInvalidAuthenticationExceptionExpiredCredentialExceptionOperationFailedExceptionpublic User addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
addUser in interface RemoteDirectoryInvalidUserExceptionInvalidCredentialExceptionOperationFailedExceptionpublic UserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
addUser in interface RemoteDirectoryInvalidUserExceptionInvalidCredentialExceptionOperationFailedExceptionpublic void expireAllPasswords()
throws OperationFailedException
expireAllPasswords in interface RemoteDirectoryOperationFailedExceptionpublic User updateUser(UserTemplate user) throws InvalidUserException, UserNotFoundException, OperationFailedException
updateUser in interface RemoteDirectoryInvalidUserExceptionUserNotFoundExceptionOperationFailedExceptionpublic void updateUserCredential(String username, PasswordCredential credential) throws UserNotFoundException, InvalidCredentialException, OperationFailedException
updateUserCredential in interface RemoteDirectoryUserNotFoundExceptionInvalidCredentialExceptionOperationFailedExceptionpublic User renameUser(String oldName, String newName) throws UserNotFoundException, InvalidUserException, OperationFailedException
renameUser in interface RemoteDirectoryUserNotFoundExceptionInvalidUserExceptionOperationFailedExceptionpublic void storeUserAttributes(String username, Map<String,Set<String>> attributes) throws UserNotFoundException, OperationFailedException
storeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic void removeUserAttributes(String username, String attributeName) throws UserNotFoundException, OperationFailedException
removeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic void removeUser(String username) throws UserNotFoundException, OperationFailedException
removeUser in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic <T> List<T> searchUsers(EntityQuery<T> query) throws OperationFailedException
searchUsers in interface RemoteDirectoryOperationFailedExceptionpublic Group findGroupByName(String name) throws GroupNotFoundException, OperationFailedException
findGroupByName in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException
findGroupWithAttributesByName in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic Group addGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException
addGroup in interface RemoteDirectoryInvalidGroupExceptionOperationFailedExceptionpublic Group updateGroup(GroupTemplate group) throws InvalidGroupException, GroupNotFoundException, OperationFailedException
updateGroup in interface RemoteDirectoryInvalidGroupExceptionGroupNotFoundExceptionOperationFailedExceptionpublic Group renameGroup(String oldName, String newName) throws GroupNotFoundException, InvalidGroupException, OperationFailedException
renameGroup in interface RemoteDirectoryGroupNotFoundExceptionInvalidGroupExceptionOperationFailedExceptionpublic void storeGroupAttributes(String groupName, Map<String,Set<String>> attributes) throws GroupNotFoundException, OperationFailedException
storeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException, OperationFailedException
removeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic void removeGroup(String groupname) throws GroupNotFoundException, OperationFailedException
removeGroup in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic <T> List<T> searchGroups(EntityQuery<T> query) throws OperationFailedException
searchGroups in interface RemoteDirectoryOperationFailedExceptionpublic boolean isUserDirectGroupMember(String username, String groupName) throws OperationFailedException
isUserDirectGroupMember in interface RemoteDirectoryOperationFailedExceptionpublic boolean isGroupDirectGroupMember(String childGroup, String parentGroup) throws OperationFailedException
isGroupDirectGroupMember in interface RemoteDirectoryOperationFailedExceptionpublic BoundedCount countDirectMembersOfGroup(String groupName, int querySizeHint) throws OperationFailedException
countDirectMembersOfGroup in interface RemoteDirectoryOperationFailedExceptionpublic void addUserToGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, OperationFailedException, MembershipAlreadyExistsException
addUserToGroup in interface RemoteDirectoryGroupNotFoundExceptionUserNotFoundExceptionOperationFailedExceptionMembershipAlreadyExistsExceptionpublic void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, InvalidMembershipException, OperationFailedException, MembershipAlreadyExistsException
addGroupToGroup in interface RemoteDirectoryGroupNotFoundExceptionInvalidMembershipExceptionOperationFailedExceptionMembershipAlreadyExistsExceptionpublic void removeUserFromGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, MembershipNotFoundException, OperationFailedException
removeUserFromGroup in interface RemoteDirectoryGroupNotFoundExceptionUserNotFoundExceptionMembershipNotFoundExceptionOperationFailedExceptionpublic void removeGroupFromGroup(String childGroup, String parentGroup) throws GroupNotFoundException, InvalidMembershipException, MembershipNotFoundException, OperationFailedException
removeGroupFromGroup in interface RemoteDirectoryGroupNotFoundExceptionInvalidMembershipExceptionMembershipNotFoundExceptionOperationFailedExceptionpublic <T> List<T> searchGroupRelationships(MembershipQuery<T> query) throws OperationFailedException
searchGroupRelationships in interface RemoteDirectoryOperationFailedExceptionpublic String getCurrentEventToken() throws OperationFailedException, IncrementalSynchronisationNotAvailableException
If the event token has not changed since the last call to this method, it is guaranteed that no new events have been received.
The format of event token is implementation specific and can change without a warning.
UnsupportedCrowdApiException - if the remote server does not support this operationOperationFailedException - if the operation has failed for any other reason, including invalid argumentsIncrementalSynchronisationNotAvailableException - if the application cannot provide incremental synchronisationpublic Events getNewEvents(String eventToken) throws EventTokenExpiredException, OperationFailedException
eventToken was generated.
If for any reason event store is unable to retrieve events that happened
after the event token was generated, an
EventTokenExpiredException will be thrown. The caller is then
expected to call getCurrentEventToken() again before asking for
new events.
eventToken - event token that was retrieved by a call to getCurrentEventToken() or getNewEvents(String)eventToken was generatedEventTokenExpiredException - if events that happened after the event token was generated can not be retrievedUnsupportedCrowdApiException - if the remote server does not support this operationOperationFailedException - if the operation has failed for any other reason, including invalid argumentspublic void testConnection()
throws OperationFailedException
testConnection in interface RemoteDirectoryOperationFailedExceptionpublic boolean supportsInactiveAccounts()
supportsInactiveAccounts in interface RemoteDirectorypublic boolean supportsNestedGroups()
supportsNestedGroups in interface RemoteDirectorypublic boolean supportsPasswordExpiration()
supportsPasswordExpiration in interface RemoteDirectorypublic boolean supportsSettingEncryptedCredential()
supportsSettingEncryptedCredential in interface RemoteDirectorypublic boolean isRolesDisabled()
isRolesDisabled in interface RemoteDirectorypublic String getDescriptiveName()
getDescriptiveName in interface RemoteDirectorypublic 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 RemoteDirectory getAuthoritativeDirectory()
getAuthoritativeDirectory in interface RemoteDirectoryprotected com.atlassian.crowd.service.client.ClientProperties getClientProperties()
public com.atlassian.crowd.service.client.CrowdClient getCrowdClient() throws OperationFailedException
OperationFailedExceptionpublic Iterable<Membership> getMemberships() throws OperationFailedException
getMemberships in interface RemoteDirectoryOperationFailedExceptionpublic User userAuthenticated(String username) throws OperationFailedException, UserNotFoundException, InactiveAccountException
userAuthenticated in interface RemoteDirectoryOperationFailedExceptionUserNotFoundExceptionInactiveAccountExceptionCopyright © 2023 Atlassian. All rights reserved.