Class ApplicationServiceGeneric
java.lang.Object
com.atlassian.crowd.manager.application.ApplicationServiceGeneric
- All Implemented Interfaces:
ApplicationService
- Direct Known Subclasses:
RecoveryModeAwareApplicationService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.crowd.manager.application.ApplicationService
ApplicationService.MembershipsIterable -
Constructor Summary
ConstructorsConstructorDescriptionApplicationServiceGeneric(DirectoryManager directoryManager, SearchStrategyFactory searchStrategyFactory, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, EventStore eventStore, WebhookRegistry webhookRegistry, AvatarProvider avatarProvider, AuthenticationOrderOptimizer authenticationOrderOptimizer, ApplicationFactory applicationFactory, AccessFilterFactory accessFilterFactory, CrowdDarkFeatureManager crowdDarkFeatureManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllUsers(Application application, Collection<UserTemplateWithCredentialAndAttributes> userTemplates) addGroup(Application application, GroupTemplate group) voidaddGroupToGroup(Application application, String childGroupName, String parentGroupName) addUser(Application application, UserTemplate user, PasswordCredential credential) addUser(Application application, UserTemplateWithAttributes user, PasswordCredential credential) voidaddUserToGroup(Application application, String username, String groupName) authenticateUser(Application application, String username, PasswordCredential passwordCredential) <T> PagedSearcher<T>createPagedGroupSearcher(Application application, EntityQuery<T> query) <T> PagedSearcher<T>createPagedUserSearcher(Application application, EntityQuery<T> query) voidexpireAllPasswords(Application application) findGroupByName(Application application, String name) findGroupWithAttributesByName(Application application, String name) findRemoteUserByName(Application application, String username) findUserByKey(Application application, String key) findUserByName(Application application, String name) findUserWithAttributesByKey(Application application, String key) findUserWithAttributesByName(Application application, String name) findWebhookById(Application application, long webhookId) getActiveDirectories(Application application) Given anapplication, retrieve all active directories associated with it.getCapabilitiesForNewUsers(Application application) getCurrentEventToken(Application application) getMemberships(Application application) getNewEvents(Application application, String eventToken) getUserAvatar(Application application, String username, int sizeHint) getUserAvatarLink(Application application, String username, int sizeHint) booleanisGroupDirectGroupMember(Application application, String childGroup, String parentGroup) booleanisGroupNestedGroupMember(Application application, String childGroup, String parentGroup) booleanisUserAuthorised(Application application, User user) booleanisUserAuthorised(Application application, String username) booleanisUserDirectGroupMember(Application application, String username, String groupName) booleanisUserNestedGroupMember(Application application, String username, String groupName) registerWebhook(Application application, String endpointUrl, String token) voidremoveGroup(Application application, String groupname) voidremoveGroupAttributes(Application application, String groupname, String attributeName) voidremoveGroupFromGroup(Application application, String childGroupName, String parentGroupName) voidremoveUser(Application application, String username) voidremoveUserAttributes(Application application, String username, String attributeName) voidremoveUserFromGroup(Application application, String username, String groupName) renameUser(Application application, String oldUserName, String newUsername) <T> List<T>searchDirectGroupRelationships(Application application, MembershipQuery<T> query) <T> List<T>searchGroups(Application application, EntityQuery<T> query) <T> List<T>searchNestedGroupRelationships(Application application, MembershipQuery<T> query) <T> List<T>searchUsers(Application application, EntityQuery<T> query) voidstoreGroupAttributes(Application application, String groupname, Map<String, Set<String>> attributes) voidstoreUserAttributes(Application application, String username, Map<String, Set<String>> attributes) voidunregisterWebhook(Application application, long webhookId) updateGroup(Application application, GroupTemplate group) updateUser(Application application, UserTemplate user) voidupdateUserCredential(Application application, String username, PasswordCredential credential) userAuthenticated(Application application, String username)
-
Constructor Details
-
ApplicationServiceGeneric
public ApplicationServiceGeneric(DirectoryManager directoryManager, SearchStrategyFactory searchStrategyFactory, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, EventStore eventStore, WebhookRegistry webhookRegistry, AvatarProvider avatarProvider, AuthenticationOrderOptimizer authenticationOrderOptimizer, ApplicationFactory applicationFactory, AccessFilterFactory accessFilterFactory, CrowdDarkFeatureManager crowdDarkFeatureManager)
-
-
Method Details
-
authenticateUser
public User authenticateUser(Application application, String username, PasswordCredential passwordCredential) throws OperationFailedException, InactiveAccountException, InvalidAuthenticationException, ExpiredCredentialException, UserNotFoundException - Specified by:
authenticateUserin interfaceApplicationService- Throws:
OperationFailedExceptionInactiveAccountExceptionInvalidAuthenticationExceptionExpiredCredentialExceptionUserNotFoundException
-
isUserAuthorised
- Specified by:
isUserAuthorisedin interfaceApplicationService
-
isUserAuthorised
- Specified by:
isUserAuthorisedin interfaceApplicationService
-
addAllUsers
public void addAllUsers(Application application, Collection<UserTemplateWithCredentialAndAttributes> userTemplates) throws ApplicationPermissionException, OperationFailedException, BulkAddFailedException - Specified by:
addAllUsersin interfaceApplicationService- Throws:
ApplicationPermissionExceptionOperationFailedExceptionBulkAddFailedException
-
findUserByName
- Specified by:
findUserByNamein interfaceApplicationService- Throws:
UserNotFoundException
-
findRemoteUserByName
public User findRemoteUserByName(Application application, String username) throws UserNotFoundException - Specified by:
findRemoteUserByNamein interfaceApplicationService- Throws:
UserNotFoundException
-
findUserByKey
- Specified by:
findUserByKeyin interfaceApplicationService- Throws:
UserNotFoundException
-
findUserWithAttributesByKey
public UserWithAttributes findUserWithAttributesByKey(Application application, String key) throws UserNotFoundException - Specified by:
findUserWithAttributesByKeyin interfaceApplicationService- Throws:
UserNotFoundException
-
findUserWithAttributesByName
public UserWithAttributes findUserWithAttributesByName(Application application, String name) throws UserNotFoundException - Specified by:
findUserWithAttributesByNamein interfaceApplicationService- Throws:
UserNotFoundException
-
addUser
public User addUser(Application application, UserTemplate user, PasswordCredential credential) throws InvalidUserException, OperationFailedException, InvalidCredentialException, ApplicationPermissionException - Specified by:
addUserin interfaceApplicationService- Throws:
InvalidUserExceptionOperationFailedExceptionInvalidCredentialExceptionApplicationPermissionException
-
addUser
public UserWithAttributes addUser(Application application, UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, OperationFailedException, InvalidCredentialException, ApplicationPermissionException - Specified by:
addUserin interfaceApplicationService- Throws:
InvalidUserExceptionOperationFailedExceptionInvalidCredentialExceptionApplicationPermissionException
-
updateUser
public User updateUser(Application application, UserTemplate user) throws InvalidUserException, OperationFailedException, ApplicationPermissionException, UserNotFoundException - Specified by:
updateUserin interfaceApplicationService- Throws:
InvalidUserExceptionOperationFailedExceptionApplicationPermissionExceptionUserNotFoundException
-
renameUser
public User renameUser(Application application, String oldUserName, String newUsername) throws UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidUserException - Specified by:
renameUserin interfaceApplicationService- Throws:
UserNotFoundExceptionOperationFailedExceptionApplicationPermissionExceptionInvalidUserException
-
updateUserCredential
public void updateUserCredential(Application application, String username, PasswordCredential credential) throws OperationFailedException, InvalidCredentialException, ApplicationPermissionException, UserNotFoundException - Specified by:
updateUserCredentialin interfaceApplicationService- Throws:
OperationFailedExceptionInvalidCredentialExceptionApplicationPermissionExceptionUserNotFoundException
-
storeUserAttributes
public void storeUserAttributes(Application application, String username, Map<String, Set<String>> attributes) throws OperationFailedException, ApplicationPermissionException, UserNotFoundException- Specified by:
storeUserAttributesin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionUserNotFoundException
-
removeUserAttributes
public void removeUserAttributes(Application application, String username, String attributeName) throws OperationFailedException, ApplicationPermissionException, UserNotFoundException - Specified by:
removeUserAttributesin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionUserNotFoundException
-
removeUser
public void removeUser(Application application, String username) throws OperationFailedException, ApplicationPermissionException, UserNotFoundException - Specified by:
removeUserin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionUserNotFoundException
-
searchUsers
- Specified by:
searchUsersin interfaceApplicationService
-
findGroupByName
- Specified by:
findGroupByNamein interfaceApplicationService- Throws:
GroupNotFoundException
-
findGroupWithAttributesByName
public GroupWithAttributes findGroupWithAttributesByName(Application application, String name) throws GroupNotFoundException - Specified by:
findGroupWithAttributesByNamein interfaceApplicationService- Throws:
GroupNotFoundException
-
addGroup
public Group addGroup(Application application, GroupTemplate group) throws InvalidGroupException, OperationFailedException, ApplicationPermissionException - Specified by:
addGroupin interfaceApplicationService- Throws:
InvalidGroupExceptionOperationFailedExceptionApplicationPermissionException
-
updateGroup
public Group updateGroup(Application application, GroupTemplate group) throws InvalidGroupException, OperationFailedException, ApplicationPermissionException, GroupNotFoundException - Specified by:
updateGroupin interfaceApplicationService- Throws:
InvalidGroupExceptionOperationFailedExceptionApplicationPermissionExceptionGroupNotFoundException
-
storeGroupAttributes
public void storeGroupAttributes(Application application, String groupname, Map<String, Set<String>> attributes) throws OperationFailedException, ApplicationPermissionException, GroupNotFoundException- Specified by:
storeGroupAttributesin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionGroupNotFoundException
-
removeGroupAttributes
public void removeGroupAttributes(Application application, String groupname, String attributeName) throws OperationFailedException, ApplicationPermissionException, GroupNotFoundException - Specified by:
removeGroupAttributesin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionGroupNotFoundException
-
removeGroup
public void removeGroup(Application application, String groupname) throws OperationFailedException, ApplicationPermissionException, GroupNotFoundException - Specified by:
removeGroupin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionGroupNotFoundException
-
searchGroups
- Specified by:
searchGroupsin interfaceApplicationService
-
addUserToGroup
public void addUserToGroup(Application application, String username, String groupName) throws OperationFailedException, ApplicationPermissionException, UserNotFoundException, GroupNotFoundException, MembershipAlreadyExistsException - Specified by:
addUserToGroupin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionUserNotFoundExceptionGroupNotFoundExceptionMembershipAlreadyExistsException
-
addGroupToGroup
public void addGroupToGroup(Application application, String childGroupName, String parentGroupName) throws OperationFailedException, ApplicationPermissionException, GroupNotFoundException, InvalidMembershipException, MembershipAlreadyExistsException -
removeUserFromGroup
public void removeUserFromGroup(Application application, String username, String groupName) throws OperationFailedException, ApplicationPermissionException, MembershipNotFoundException, UserNotFoundException, GroupNotFoundException - Specified by:
removeUserFromGroupin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionMembershipNotFoundExceptionUserNotFoundExceptionGroupNotFoundException
-
removeGroupFromGroup
public void removeGroupFromGroup(Application application, String childGroupName, String parentGroupName) throws OperationFailedException, ApplicationPermissionException, MembershipNotFoundException, GroupNotFoundException - Specified by:
removeGroupFromGroupin interfaceApplicationService- Throws:
OperationFailedExceptionApplicationPermissionExceptionMembershipNotFoundExceptionGroupNotFoundException
-
isUserDirectGroupMember
- Specified by:
isUserDirectGroupMemberin interfaceApplicationService
-
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(Application application, String childGroup, String parentGroup) - Specified by:
isGroupDirectGroupMemberin interfaceApplicationService
-
isUserNestedGroupMember
- Specified by:
isUserNestedGroupMemberin interfaceApplicationService
-
isGroupNestedGroupMember
public boolean isGroupNestedGroupMember(Application application, String childGroup, String parentGroup) - Specified by:
isGroupNestedGroupMemberin interfaceApplicationService
-
searchDirectGroupRelationships
public <T> List<T> searchDirectGroupRelationships(Application application, MembershipQuery<T> query) - Specified by:
searchDirectGroupRelationshipsin interfaceApplicationService
-
searchNestedGroupRelationships
public <T> List<T> searchNestedGroupRelationships(Application application, MembershipQuery<T> query) - Specified by:
searchNestedGroupRelationshipsin interfaceApplicationService
-
getCurrentEventToken
public String getCurrentEventToken(Application application) throws IncrementalSynchronisationNotAvailableException - Specified by:
getCurrentEventTokenin interfaceApplicationService- Throws:
IncrementalSynchronisationNotAvailableException
-
getNewEvents
public Events getNewEvents(Application application, String eventToken) throws EventTokenExpiredException, OperationFailedException - Specified by:
getNewEventsin interfaceApplicationService- Throws:
EventTokenExpiredExceptionOperationFailedException
-
findWebhookById
public Webhook findWebhookById(Application application, long webhookId) throws WebhookNotFoundException, ApplicationPermissionException - Specified by:
findWebhookByIdin interfaceApplicationService- Throws:
WebhookNotFoundExceptionApplicationPermissionException
-
registerWebhook
public Webhook registerWebhook(Application application, String endpointUrl, @Nullable String token) throws InvalidWebhookEndpointException - Specified by:
registerWebhookin interfaceApplicationService- Throws:
InvalidWebhookEndpointException
-
unregisterWebhook
public void unregisterWebhook(Application application, long webhookId) throws ApplicationPermissionException, WebhookNotFoundException - Specified by:
unregisterWebhookin interfaceApplicationService- Throws:
ApplicationPermissionExceptionWebhookNotFoundException
-
getCapabilitiesForNewUsers
- Specified by:
getCapabilitiesForNewUsersin interfaceApplicationService
-
getActiveDirectories
Given anapplication, retrieve all active directories associated with it.- Parameters:
application- application to query- Returns:
- list of active directories associated with
application - Since:
- 2.7.2
-
getUserAvatarLink
@Nullable public URI getUserAvatarLink(Application application, String username, int sizeHint) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException - Specified by:
getUserAvatarLinkin interfaceApplicationService- Throws:
UserNotFoundExceptionDirectoryNotFoundExceptionOperationFailedException
-
getUserAvatar
@Nullable public AvatarReference getUserAvatar(Application application, String username, int sizeHint) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException - Specified by:
getUserAvatarin interfaceApplicationService- Throws:
UserNotFoundExceptionDirectoryNotFoundExceptionOperationFailedException
-
expireAllPasswords
- Specified by:
expireAllPasswordsin interfaceApplicationService- Throws:
OperationFailedException
-
userAuthenticated
public User userAuthenticated(Application application, String username) throws UserNotFoundException, OperationFailedException, InactiveAccountException - Specified by:
userAuthenticatedin interfaceApplicationService- Throws:
UserNotFoundExceptionOperationFailedExceptionInactiveAccountException
-
getMemberships
- Specified by:
getMembershipsin interfaceApplicationService
-
createPagedUserSearcher
public <T> PagedSearcher<T> createPagedUserSearcher(Application application, EntityQuery<T> query) throws PagingNotSupportedException - Specified by:
createPagedUserSearcherin interfaceApplicationService- Throws:
PagingNotSupportedException
-
createPagedGroupSearcher
public <T> PagedSearcher<T> createPagedGroupSearcher(Application application, EntityQuery<T> query) throws PagingNotSupportedException - Specified by:
createPagedGroupSearcherin interfaceApplicationService- Throws:
PagingNotSupportedException
-