|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.manager.GenericManager
com.atlassian.crowd.manager.application.ApplicationServiceGeneric
public class ApplicationServiceGeneric
| Field Summary |
|---|
| Fields inherited from class com.atlassian.crowd.manager.GenericManager |
|---|
cacheManager, directoryManager, i18nHelper, logger, propertyManager, tokenDAO, tokenFactory |
| Constructor Summary | |
|---|---|
ApplicationServiceGeneric()
|
|
| Method Summary | |
|---|---|
Group |
addGroup(Application application,
GroupTemplate group)
Adds the group to ALL the permissible directories. |
void |
addGroupToGroup(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
Makes groups matching the given name (childGroup) direct members of the group (parentGroup) across ALL directories. |
User |
addUser(Application application,
UserTemplate user,
PasswordCredential credential)
Adds the user to ALL the permissible directories. |
void |
addUserToGroup(Application application,
java.lang.String username,
java.lang.String groupName)
Makes users matching the given name direct members of the group across ALL directories. |
Token |
authenticateApplication(ApplicationAuthenticationContext authenticationContext)
Authenticates an application and generates an authentication token. |
Token |
authenticateUser(UserAuthenticationContext authenticateContext)
Authenticates a user and and generates an authentication token. |
Token |
authenticateUser(UserAuthenticationContext authenticationContext,
boolean validatePassword,
boolean ignoreCache)
|
Token |
authenticateUserWithoutValidatingPassword(UserAuthenticationContext authenticateContext)
Feigns the authentication process for a user and creates a token for the authentication without validating the password. |
java.util.List<Application> |
findAuthorisedApplications(User user)
Returns a list of applications a user is authorised to authenticate with. |
Group |
findGroupByName(Application application,
java.lang.String name)
Returns the first group with the matching groupname from all the directories assigned to the application. |
GroupWithAttributes |
findGroupWithAttributesByName(Application application,
java.lang.String name)
Returns the first group with the matching groupname from all the directories assigned to the application. |
User |
findUserByName(Application application,
java.lang.String name)
Returns the first user with the matching username from all the directories assigned to the application. |
UserWithAttributes |
findUserWithAttributesByName(Application application,
java.lang.String name)
Returns the first user with the matching username from all the directories assigned to the application. |
boolean |
isGroupDirectGroupMember(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
Returns true if the childGroup is a direct member of the parentGroup in any of the application's assigned directories. |
boolean |
isGroupNestedGroupMember(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
Returns true if the childGroup is a direct or indirect (nested) member of the parentGroup in any of the application's assigned directories. |
boolean |
isUserDirectGroupMember(Application application,
java.lang.String username,
java.lang.String groupName)
Returns true if the user is a direct member of the group in any of the application's assigned directories. |
boolean |
isUserNestedGroupMember(Application application,
java.lang.String username,
java.lang.String groupName)
Returns true if the user is a direct or indirect (nested) member of the group in any of the application's assigned directories. |
void |
removeGroup(Application application,
java.lang.String groupname)
Removes ALL groups from each of the application's assigned directories. |
void |
removeGroupAttributes(Application application,
java.lang.String groupname,
java.lang.String attributeName)
Removes a group's attribute values for all permissible directories assigned to the application. |
void |
removeGroupFromGroup(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
Makes child group matching the given name not members of the parent group across ALL directories. |
void |
removeUser(Application application,
java.lang.String username)
Removes ALL users from each of the application's assigned directories. |
void |
removeUserAttributes(Application application,
java.lang.String username,
java.lang.String attributeName)
Removes a user's attribute values for all permissible directories assigned to the application. |
void |
removeUserFromGroup(Application application,
java.lang.String username,
java.lang.String groupName)
Makes users matching the given name not members of the group across ALL directories. |
void |
resetUserCredential(Application application,
java.lang.String username)
Resets the credentials of the first matching user in the application's directories. |
java.util.List |
searchDirectGroupRelationships(Application application,
MembershipQuery query)
Searches for direct group relationships in any of the application's assigned directories. |
java.util.List |
searchGroups(Application application,
EntityQuery query)
Returns a List |
java.util.List |
searchNestedGroupRelationships(Application application,
MembershipQuery query)
Searches for direct and indirect (nested) group relationships in any of the application's assigned directories. |
java.util.List |
searchUsers(Application application,
EntityQuery query)
Returns a List |
void |
setApplicationDAO(ApplicationDAO applicationDAO)
|
void |
setDirectoryManager(DirectoryManager directoryManager)
|
void |
setEventManager(com.atlassian.event.EventManager eventManager)
|
void |
setPasswordEncoderFactory(PasswordEncoderFactory passwordEncoderFactory)
|
void |
setPermissionManager(PermissionManager permissionManager)
|
void |
storeGroupAttributes(Application application,
java.lang.String groupname,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
Adds or updates a group's attributes with the new Map of attribute values for all permissible directories assigned to the application. |
void |
storeUserAttributes(Application application,
java.lang.String username,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
Adds or updates a user's attributes with the new Map of attribute values for all permissible directories assigned to the application. |
Group |
updateGroup(Application application,
GroupTemplate group)
Updates the group in ALL the permissible directories. |
User |
updateUser(Application application,
UserTemplate user)
Updates the user in ALL the permissible directories. |
void |
updateUserCredential(Application application,
java.lang.String username,
PasswordCredential credential)
Updates the credentials of the first matching user in the application's assigned directories. |
Token |
validateApplicationToken(java.lang.String tokenKey,
ValidationFactor[] clientValidationFactors)
Validates an application token key given validation factors. |
Token |
validateUserToken(java.lang.String userTokenKey,
ValidationFactor[] validationFactors,
java.lang.String applicationName)
Validates a user token key given validation factors and checks that the user is allowed to authenticate with the specified application |
| Methods inherited from class com.atlassian.crowd.manager.GenericManager |
|---|
generateApplicationToken, generateUserToken, genericValidateToken, isAllowedToAuthenticate, isAllowedToAuthenticate, isAllowedToAuthenticate, isExpired, setCacheManager, setI18nHelper, setPropertyManager, setTokenDAO, setTokenFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ApplicationServiceGeneric()
| Method Detail |
|---|
public java.util.List<Application> findAuthorisedApplications(User user)
ApplicationService
findAuthorisedApplications in interface ApplicationServiceuser - user to search for.
public Token authenticateApplication(ApplicationAuthenticationContext authenticationContext)
throws InvalidAuthenticationException
ApplicationService
authenticateApplication in interface ApplicationServiceauthenticationContext - application authentication credentials.
InvalidAuthenticationException - authentication was not successful because either the application does not exist, the password is incorrect, the application is inactive or there was a problem generating the authentication token.
public Token authenticateUser(UserAuthenticationContext authenticationContext,
boolean validatePassword,
boolean ignoreCache)
throws InvalidAuthenticationException,
DirectoryAccessException,
InactiveAccountException,
ApplicationAccessDeniedException
InvalidAuthenticationException
DirectoryAccessException
InactiveAccountException
ApplicationAccessDeniedException
public Token authenticateUser(UserAuthenticationContext authenticateContext)
throws InvalidAuthenticationException,
DirectoryAccessException,
InactiveAccountException,
ApplicationAccessDeniedException
ApplicationServiceRemoteDirectory.authenticate(String, com.atlassian.crowd.integration.authentication.PasswordCredential) method is
iteratively called for each assigned directory. If the user does not exist in one directory, the directory is skipped and the next one is examined. If the user does
not exist in any of the assigned directories then an InvalidAuthenticationException is thrown.
authenticateUser in interface ApplicationServiceauthenticateContext - The authentication details for the user.
InvalidAuthenticationException - The authentication was not successful.
DirectoryAccessException - error thrown by directory implementation when attempting to find or authenticate the user.
InactiveAccountException - user account is inactive.
ApplicationAccessDeniedException - user does not have access to authenticate with application.
public Token authenticateUserWithoutValidatingPassword(UserAuthenticationContext authenticateContext)
throws InvalidAuthenticationException,
DirectoryAccessException,
InactiveAccountException,
ApplicationAccessDeniedException
ApplicationServiceApplicationService.authenticateUser(com.atlassian.crowd.integration.authentication.UserAuthenticationContext) method.
authenticateUserWithoutValidatingPassword in interface ApplicationServiceauthenticateContext - The authentication details for the user.
InvalidAuthenticationException - The authentication was not successful.
DirectoryAccessException - error thrown by directory implementation when attempting to find or authenticate the user.
InactiveAccountException - user account is inactive.
ApplicationAccessDeniedException - user does not have access to authenticate with application.
public Token validateApplicationToken(java.lang.String tokenKey,
ValidationFactor[] clientValidationFactors)
throws InvalidTokenException
ApplicationService
validateApplicationToken in interface ApplicationServicetokenKey - returns a valid token corresponding to the tokenKey.clientValidationFactors - validation factors for generating the token hash.
InvalidTokenException - if the tokenKey or corresponding client validation factors do not represent a valid application token.
public Token validateUserToken(java.lang.String userTokenKey,
ValidationFactor[] validationFactors,
java.lang.String applicationName)
throws InvalidTokenException,
ApplicationAccessDeniedException,
DirectoryAccessException
ApplicationService
validateUserToken in interface ApplicationServiceuserTokenKey - returns a valid token corresponding to the tokenKey.validationFactors - validation factors for generating the token hash.applicationName - name of application to authenticate with.
InvalidTokenException - if the userTokenKey or corresponding validationFactors do not represent a valid SSO token.
ApplicationAccessDeniedException - the user is not allowed to authenticate with the application.
DirectoryAccessException - there was an error communicating with an underlying directory when determining if a user is allowed to authenticate with the application (eg. if a user has the appropriate group memberships).
public User findUserByName(Application application,
java.lang.String name)
throws ObjectNotFoundException,
DirectoryAccessException
ApplicationService
findUserByName in interface ApplicationServiceapplication - search application's assigned directories.name - the username of the user to find.
ObjectNotFoundException - user not found in any of the directories.
DirectoryAccessException - there was an error executing the request with any underlying directory.
public UserWithAttributes findUserWithAttributesByName(Application application,
java.lang.String name)
throws ObjectNotFoundException,
DirectoryAccessException
ApplicationService
findUserWithAttributesByName in interface ApplicationServiceapplication - search application's assigned directories.name - the username of the user to find.
ObjectNotFoundException - user not found in any of the directories.
DirectoryAccessException - there was an error executing the request with any underlying directory.
public User addUser(Application application,
UserTemplate user,
PasswordCredential credential)
throws InvalidUserException,
DirectoryAccessException,
InvalidCredentialException,
ApplicationPermissionException
ApplicationServiceInvalidUserException will be thrown.
If the add operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the add operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
Returns the user from the first directory containing
the user.
addUser in interface ApplicationServiceapplication - add to application's assigned directories.user - a template of the user to be added. The directoryId of the UserTemplate is ignored, and will be mutated for each directoryMapping.credential - the password credential of the user (unencrypted).
ApplicationService.findUserByName(com.atlassian.crowd.model.application.Application , String).
InvalidUserException - if the user already exists in ANY associated directory or the user template does not have the required properties populated.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
InvalidCredentialException - if the user's credential does not meet the validation requirements for an associated directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.CREATE_USER.
public User updateUser(Application application,
UserTemplate user)
throws InvalidUserException,
DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
Returns the user from the first directory containing
the user.
updateUser in interface ApplicationServiceapplication - application with assigned directories to operate on.user - a template of the user to be added. The directoryId of the UserTemplate is ignored, and will be mutated for each directoryMapping.
ApplicationService.findUserByName(com.atlassian.crowd.model.application.Application , String).
InvalidUserException - if the user already exists in ANY associated directory or the user template does not have the required properties populated.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_USER.
ObjectNotFoundException - user does not exist in any of the associated directories of the application.
public void updateUserCredential(Application application,
java.lang.String username,
PasswordCredential credential)
throws DirectoryAccessException,
ObjectNotFoundException,
InvalidCredentialException,
ApplicationPermissionException
ApplicationService
updateUserCredential in interface ApplicationServiceapplication - update in application's assigned directories.username - name of user.credential - new (unencrypted) credentials.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ObjectNotFoundException - if no user with the given name exists in ANY assigned directory.
InvalidCredentialException - if the user's credential does not meet the validation requirements for an associated directory.
ApplicationPermissionException - if the first directory in which the user is found doesn't have the permission to perform operations of type OperationType.UPDATE_USER.
public void resetUserCredential(Application application,
java.lang.String username)
throws DirectoryAccessException,
ObjectNotFoundException,
InvalidCredentialException,
ApplicationPermissionException,
InvalidEmailAddressException
ApplicationService
resetUserCredential in interface ApplicationServiceapplication - update in application's assigned directories.username - name of user.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ObjectNotFoundException - if no user with the given name exists in ANY assigned directory, or the associated directory does not exist
InvalidCredentialException - if the generated credential does not meet the validation requirements for an associated directory.
ApplicationPermissionException - if the first directory in which the user is found doesn't have the permission to perform operations of type OperationType.UPDATE_USER.
InvalidEmailAddressException - if the user doesn't have a valid email address and can't be notified.
public void storeUserAttributes(Application application,
java.lang.String username,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
throws DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
storeUserAttributes in interface ApplicationServiceapplication - application with assigned directories to operate on.username - username of the user to update.attributes - map of one-to-many attribute-values. All attribute keys are treated as new or updated attributes.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory..
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_USER.
ObjectNotFoundException - if the user with the supplied username does not exist in ANY assigned directory.
public void removeUserAttributes(Application application,
java.lang.String username,
java.lang.String attributeName)
throws DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
removeUserAttributes in interface ApplicationServiceapplication - application with assigned directories to operate on.username - username of the user to update.attributeName - all attribute values for this key will be removed from the user.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_USER.
ObjectNotFoundException - if the user with the supplied username does not exist in ANY assigned directory.
public void removeUser(Application application,
java.lang.String username)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException
ApplicationService
removeUser in interface ApplicationServiceapplication - remove from application's assigned directories.username - the name of the user to remove.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ObjectNotFoundException - if user with given name does not exist in ANY assigned directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.DELETE_USER.
public java.util.List searchUsers(Application application,
EntityQuery query)
throws DirectoryAccessException
ApplicationService
searchUsers in interface ApplicationServiceapplication - search application's assigned directories.query - the search query.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
public Group findGroupByName(Application application,
java.lang.String name)
throws ObjectNotFoundException,
DirectoryAccessException
ApplicationService
findGroupByName in interface ApplicationServiceapplication - search application's assigned directories.name - the groupname of the group to find.
ObjectNotFoundException - group not found in any of the directories.
DirectoryAccessException - there was an error executing the request with any underlying directory.
public GroupWithAttributes findGroupWithAttributesByName(Application application,
java.lang.String name)
throws ObjectNotFoundException,
DirectoryAccessException
ApplicationService
findGroupWithAttributesByName in interface ApplicationServiceapplication - search application's assigned directories.name - the groupname of the group to find.
ObjectNotFoundException - group not found in any of the directories.
DirectoryAccessException - there was an error executing the request with any underlying directory.
public Group addGroup(Application application,
GroupTemplate group)
throws InvalidGroupException,
DirectoryAccessException,
ApplicationPermissionException
ApplicationServiceInvalidGroupException will be thrown.
If the add operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the add operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
Returns the group from the first directory containing
the group.
addGroup in interface ApplicationServiceapplication - add to application's assigned directories.group - a template of the group to be added. The directoryId of the GroupTemplate is ignored, and will be mutated for each directoryMapping.
ApplicationService.findGroupByName(com.atlassian.crowd.model.application.Application , String).
InvalidGroupException - if the group already exists in ANY associated directory or the group template does not have the required properties populated.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.CREATE_GROUP.
public Group updateGroup(Application application,
GroupTemplate group)
throws InvalidGroupException,
DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
Returns the group from the first directory containing
the group.
updateGroup in interface ApplicationServiceapplication - application with assigned directories to operate on.group - a template of the group to be added. The directoryId of the GroupTemplate is ignored, and will be mutated for each directoryMapping.
ApplicationService.findGroupByName(com.atlassian.crowd.model.application.Application , String).
InvalidGroupException - if the group already exists in ANY associated directory or the group template does not have the required properties populated.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
ObjectNotFoundException - group does not exist in any of the associated directories of the application.
public void storeGroupAttributes(Application application,
java.lang.String groupname,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)
throws DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
storeGroupAttributes in interface ApplicationServiceapplication - application with assigned directories to operate on.groupname - groupname of the group to update.attributes - map of one-to-many attribute-values. All attribute keys are treated as new or updated attributes.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory..
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
ObjectNotFoundException - if the group with the supplied groupname does not exist in ANY assigned directory.
public void removeGroupAttributes(Application application,
java.lang.String groupname,
java.lang.String attributeName)
throws DirectoryAccessException,
ApplicationPermissionException,
ObjectNotFoundException
ApplicationServiceObjectNotFoundException will be thrown.
If the update operation fails on a directory because of
permissioning restrictions, an INFO message is logged.
If ALL directories permissions fail, an
ApplicationPermissionException is thrown.
If the update operation fails on a directory for any other reason,
such as directory failure, update failure, etc., an Exception
is thrown immediately.
removeGroupAttributes in interface ApplicationServiceapplication - application with assigned directories to operate on.groupname - groupname of the group to update.attributeName - all attribute values for this key will be removed from the group.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
ObjectNotFoundException - if the group with the supplied groupname does not exist in ANY assigned directory.
public void removeGroup(Application application,
java.lang.String groupname)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException
ApplicationService
removeGroup in interface ApplicationServiceapplication - remove from application's assigned directories.groupname - the name of the group to remove.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
ObjectNotFoundException - if group with given name does not exist in ANY assigned directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.DELETE_GROUP.
public java.util.List searchGroups(Application application,
EntityQuery query)
throws DirectoryAccessException
ApplicationService
searchGroups in interface ApplicationServiceapplication - search application's assigned directories.query - the search query.
DirectoryAccessException - if there was an error performing the operation or instantiating the backend directory.
public void addUserToGroup(Application application,
java.lang.String username,
java.lang.String groupName)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException
ApplicationService
addUserToGroup in interface ApplicationServiceapplication - modify groups in application's assigned directories.username - username of the user.groupName - name of the group.
DirectoryAccessException - if there was an error executing the update or instantiating the RemoteDirectory.
ObjectNotFoundException - when the user cannot be found in ANY directory OR when ALL users are in directories which don't have the requested group.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
public void addGroupToGroup(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException
ApplicationService
addGroupToGroup in interface ApplicationServiceapplication - modify groups in application's assigned directories.childGroup - name of child group.parentGroup - name of parent group.
DirectoryAccessException - if there was an error executing the update or instantiating the RemoteDirectory.
ObjectNotFoundException - when the child group cannot be found in ANY directory OR when ALL child groups are in directories which don't have the requested parent group.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
public void removeUserFromGroup(Application application,
java.lang.String username,
java.lang.String groupName)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException,
MembershipNotFoundException
ApplicationService
removeUserFromGroup in interface ApplicationServiceapplication - modify groups in application's assigned directories.username - username of the user.groupName - name of the group.
DirectoryAccessException - if there was an error executing the update or instantiating the RemoteDirectory.
ObjectNotFoundException - when the user cannot be found in ANY directory OR when ALL users are in directories which don't have the requested group.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
MembershipNotFoundException - if the user is not a direct member of the group in an assigned directory.
public void removeGroupFromGroup(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
throws DirectoryAccessException,
ObjectNotFoundException,
ApplicationPermissionException,
MembershipNotFoundException
ApplicationService
removeGroupFromGroup in interface ApplicationServiceapplication - modify groups in application's assigned directories.childGroup - name of child group.parentGroup - name of parent group.
DirectoryAccessException - if there was an error executing the update or instantiating the RemoteDirectory.
ObjectNotFoundException - when the child group cannot be found in ANY directory OR when ALL child groups are in directories which don't have the requested parent group.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
MembershipNotFoundException - if the user is not a direct member of the group in an assigned directory.
public boolean isUserDirectGroupMember(Application application,
java.lang.String username,
java.lang.String groupName)
throws DirectoryAccessException
ApplicationServicetrue if the user is a direct member of the group in any of the application's assigned directories.
isUserDirectGroupMember in interface ApplicationServiceapplication - search groups in application's assigned directories.username - name of the user to inspect.groupName - name of the group to inspect.
true if and only if the user is a direct member of the group. If the group or user does not exist in any directory, false is returned.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.
public boolean isGroupDirectGroupMember(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
throws DirectoryAccessException
ApplicationServicetrue if the childGroup is a direct member of the parentGroup in any of the application's assigned directories.
isGroupDirectGroupMember in interface ApplicationServiceapplication - search groups in application's assigned directories.childGroup - name of the group to inspect.parentGroup - name of the group to inspect.
true if and only if the childGroup is a direct member of the parentGroup. If either group does not exist in any directory, false is returned.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.
public boolean isUserNestedGroupMember(Application application,
java.lang.String username,
java.lang.String groupName)
throws DirectoryAccessException
ApplicationServicetrue if the user is a direct or indirect (nested) member of the group in any of the application's assigned directories.
If the directory does not support nested groups, this call will be equivalent to DirectoryManager.isUserDirectGroupMember(long, String, String).
WARNING: this method could be very slow if the underlying RemoteDirectory does not employ caching.
See CWD-1485 for explanation of logic in amalgamation.
isUserNestedGroupMember in interface ApplicationServiceapplication - search groups in application's assigned directories.username - name of the user to inspect.groupName - name of the group to inspect.
true if and only if the user is a direct or indirect (nested) member of the group. If the group or user does not exist in the directory, false is returned.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.
public boolean isGroupNestedGroupMember(Application application,
java.lang.String childGroup,
java.lang.String parentGroup)
throws DirectoryAccessException
ApplicationServicetrue if the childGroup is a direct or indirect (nested) member of the parentGroup in any of the application's assigned directories.
If the directory does not support nested groups, this call will be equivalent to DirectoryManager.isGroupDirectGroupMember(long, String, String).
WARNING: this method could be very slow if the underlying RemoteDirectory does not employ caching.
See CWD-1485 for explanation of logic in amalgamation.
isGroupNestedGroupMember in interface ApplicationServiceapplication - search groups in application's assigned directories.childGroup - name of the user to inspect.parentGroup - name of the group to inspect.
true if and only if the childGroup is a direct or indirect (nested) member of the parentGruop. If either group does not exist in the directory, false is returned.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.
public java.util.List searchDirectGroupRelationships(Application application,
MembershipQuery query)
throws DirectoryAccessException
ApplicationService
searchDirectGroupRelationships in interface ApplicationServiceapplication - search groups in application's assigned directories.query - membership query.
User entities,
Group entites,
String usernames or String group names matching the query criteria.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.
public java.util.List searchNestedGroupRelationships(Application application,
MembershipQuery query)
throws DirectoryAccessException
ApplicationServiceDirectoryManager.searchDirectGroupRelationships(long, com.atlassian.crowd.search.query.membership.MembershipQuery).
WARNING: this method could be very slow if the underlying RemoteDirectory does not employ caching.
See CWD-1485 for explanation of logic in amalgamation.
searchNestedGroupRelationships in interface ApplicationServiceapplication - search groups in application's assigned directories.query - membership query.
User entities,
Group entites,
String usernames or String group names matching the query criteria.
DirectoryAccessException - if there was an error executing the search or instantiating the RemoteDirectory.public void setApplicationDAO(ApplicationDAO applicationDAO)
public void setPasswordEncoderFactory(PasswordEncoderFactory passwordEncoderFactory)
public void setDirectoryManager(DirectoryManager directoryManager)
setDirectoryManager in class GenericManagerpublic void setPermissionManager(PermissionManager permissionManager)
public void setEventManager(com.atlassian.event.EventManager eventManager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||