com.atlassian.crowd.manager.application
Class ApplicationServiceGeneric
java.lang.Object
com.atlassian.crowd.manager.application.ApplicationServiceGeneric
- All Implemented Interfaces:
- ApplicationService
@Transactional
public class ApplicationServiceGeneric
- extends Object
- implements ApplicationService
|
Method Summary |
void |
addAllUsers(Application application,
Collection<UserTemplateWithCredentialAndAttributes> userTemplates)
|
Group |
addGroup(Application application,
GroupTemplate group)
|
void |
addGroupToGroup(Application application,
String childGroupName,
String parentGroupName)
|
User |
addUser(Application application,
UserTemplate user,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
|
void |
addUserToGroup(Application application,
String username,
String groupName)
|
User |
authenticateUser(Application application,
String username,
com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential)
|
Group |
findGroupByName(Application application,
String name)
|
GroupWithAttributes |
findGroupWithAttributesByName(Application application,
String name)
|
User |
findUserByName(Application application,
String name)
|
UserWithAttributes |
findUserWithAttributesByName(Application application,
String name)
|
Webhook |
findWebhookById(Application application,
long webhookId)
|
String |
getCurrentEventToken(Application application)
|
Events |
getNewEvents(Application application,
String eventToken)
|
boolean |
isGroupDirectGroupMember(Application application,
String childGroup,
String parentGroup)
|
boolean |
isGroupNestedGroupMember(Application application,
String childGroup,
String parentGroup)
|
boolean |
isUserAuthorised(Application application,
String username)
|
boolean |
isUserDirectGroupMember(Application application,
String username,
String groupName)
|
boolean |
isUserNestedGroupMember(Application application,
String username,
String groupName)
|
Webhook |
registerWebhook(Application application,
String endpointUrl,
String token)
|
void |
removeGroup(Application application,
String groupname)
|
void |
removeGroupAttributes(Application application,
String groupname,
String attributeName)
|
void |
removeGroupFromGroup(Application application,
String childGroup,
String parentGroup)
|
void |
removeUser(Application application,
String username)
|
void |
removeUserAttributes(Application application,
String username,
String attributeName)
|
void |
removeUserFromGroup(Application application,
String username,
String groupName)
|
User |
renameUser(Application application,
String oldUserName,
String newUsername)
|
void |
resetUserCredential(Application application,
String username)
Deprecated. |
|
searchDirectGroupRelationships(Application application,
MembershipQuery<T> query)
|
|
searchGroups(Application application,
EntityQuery<T> query)
|
|
searchNestedGroupRelationships(Application application,
MembershipQuery<T> query)
|
|
searchUsers(Application application,
EntityQuery<T> query)
|
List<User> |
searchUsersAllowingDuplicateNames(Application application,
EntityQuery<User> query)
|
void |
setAllowShadowedUsersInMembershipQueryResults(boolean allow)
Whether to allow shadowed users to be returned when executing searches for all users that are members of a
particular group for a given application. |
void |
storeGroupAttributes(Application application,
String groupname,
Map<String,Set<String>> attributes)
|
void |
storeUserAttributes(Application application,
String username,
Map<String,Set<String>> attributes)
|
void |
unregisterWebhook(Application application,
long webhookId)
|
Group |
updateGroup(Application application,
GroupTemplate group)
|
User |
updateUser(Application application,
UserTemplate user)
|
void |
updateUserCredential(Application application,
String username,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApplicationServiceGeneric
public ApplicationServiceGeneric(DirectoryManager directoryManager,
PermissionManager permissionManager,
DirectoryInstanceLoader directoryInstanceLoader,
com.atlassian.event.api.EventPublisher eventPublisher,
EventStore eventStore,
WebhookRegistry webhookRegistry)
authenticateUser
public User authenticateUser(Application application,
String username,
com.atlassian.crowd.embedded.api.PasswordCredential passwordCredential)
throws OperationFailedException,
InactiveAccountException,
InvalidAuthenticationException,
ExpiredCredentialException,
UserNotFoundException
- Specified by:
authenticateUser in interface ApplicationService
- Throws:
OperationFailedException
InactiveAccountException
InvalidAuthenticationException
ExpiredCredentialException
UserNotFoundException
isUserAuthorised
public boolean isUserAuthorised(Application application,
String username)
- Specified by:
isUserAuthorised in interface ApplicationService
addAllUsers
public void addAllUsers(Application application,
Collection<UserTemplateWithCredentialAndAttributes> userTemplates)
throws ApplicationPermissionException,
OperationFailedException,
BulkAddFailedException
- Specified by:
addAllUsers in interface ApplicationService
- Throws:
ApplicationPermissionException
OperationFailedException
BulkAddFailedException
findUserByName
public User findUserByName(Application application,
String name)
throws UserNotFoundException
- Specified by:
findUserByName in interface ApplicationService
- Throws:
UserNotFoundException
findUserWithAttributesByName
public UserWithAttributes findUserWithAttributesByName(Application application,
String name)
throws UserNotFoundException
- Specified by:
findUserWithAttributesByName in interface ApplicationService
- Throws:
UserNotFoundException
addUser
public User addUser(Application application,
UserTemplate user,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
throws InvalidUserException,
OperationFailedException,
InvalidCredentialException,
ApplicationPermissionException
- Specified by:
addUser in interface ApplicationService
- Throws:
InvalidUserException
OperationFailedException
InvalidCredentialException
ApplicationPermissionException
updateUser
public User updateUser(Application application,
UserTemplate user)
throws InvalidUserException,
OperationFailedException,
ApplicationPermissionException,
UserNotFoundException
- Specified by:
updateUser in interface ApplicationService
- Throws:
InvalidUserException
OperationFailedException
ApplicationPermissionException
UserNotFoundException
renameUser
public User renameUser(Application application,
String oldUserName,
String newUsername)
throws UserNotFoundException,
OperationFailedException,
ApplicationPermissionException,
InvalidUserException
- Specified by:
renameUser in interface ApplicationService
- Throws:
UserNotFoundException
OperationFailedException
ApplicationPermissionException
InvalidUserException
updateUserCredential
public void updateUserCredential(Application application,
String username,
com.atlassian.crowd.embedded.api.PasswordCredential credential)
throws OperationFailedException,
InvalidCredentialException,
ApplicationPermissionException,
UserNotFoundException
- Specified by:
updateUserCredential in interface ApplicationService
- Throws:
OperationFailedException
InvalidCredentialException
ApplicationPermissionException
UserNotFoundException
resetUserCredential
@Deprecated
public void resetUserCredential(Application application,
String username)
throws OperationFailedException,
InvalidCredentialException,
ApplicationPermissionException,
InvalidEmailAddressException,
UserNotFoundException
- Deprecated.
- Specified by:
resetUserCredential in interface ApplicationService
- Throws:
OperationFailedException
InvalidCredentialException
ApplicationPermissionException
InvalidEmailAddressException
UserNotFoundException
storeUserAttributes
public void storeUserAttributes(Application application,
String username,
Map<String,Set<String>> attributes)
throws OperationFailedException,
ApplicationPermissionException,
UserNotFoundException
- Specified by:
storeUserAttributes in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
UserNotFoundException
removeUserAttributes
public void removeUserAttributes(Application application,
String username,
String attributeName)
throws OperationFailedException,
ApplicationPermissionException,
UserNotFoundException
- Specified by:
removeUserAttributes in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
UserNotFoundException
removeUser
public void removeUser(Application application,
String username)
throws OperationFailedException,
ApplicationPermissionException,
UserNotFoundException
- Specified by:
removeUser in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
UserNotFoundException
searchUsers
public <T> List<T> searchUsers(Application application,
EntityQuery<T> query)
- Specified by:
searchUsers in interface ApplicationService
searchUsersAllowingDuplicateNames
public List<User> searchUsersAllowingDuplicateNames(Application application,
EntityQuery<User> query)
- Specified by:
searchUsersAllowingDuplicateNames in interface ApplicationService
findGroupByName
public Group findGroupByName(Application application,
String name)
throws GroupNotFoundException
- Specified by:
findGroupByName in interface ApplicationService
- Throws:
GroupNotFoundException
findGroupWithAttributesByName
public GroupWithAttributes findGroupWithAttributesByName(Application application,
String name)
throws GroupNotFoundException
- Specified by:
findGroupWithAttributesByName in interface ApplicationService
- Throws:
GroupNotFoundException
addGroup
public Group addGroup(Application application,
GroupTemplate group)
throws InvalidGroupException,
OperationFailedException,
ApplicationPermissionException
- Specified by:
addGroup in interface ApplicationService
- Throws:
InvalidGroupException
OperationFailedException
ApplicationPermissionException
updateGroup
public Group updateGroup(Application application,
GroupTemplate group)
throws InvalidGroupException,
OperationFailedException,
ApplicationPermissionException,
GroupNotFoundException
- Specified by:
updateGroup in interface ApplicationService
- Throws:
InvalidGroupException
OperationFailedException
ApplicationPermissionException
GroupNotFoundException
storeGroupAttributes
public void storeGroupAttributes(Application application,
String groupname,
Map<String,Set<String>> attributes)
throws OperationFailedException,
ApplicationPermissionException,
GroupNotFoundException
- Specified by:
storeGroupAttributes in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
GroupNotFoundException
removeGroupAttributes
public void removeGroupAttributes(Application application,
String groupname,
String attributeName)
throws OperationFailedException,
ApplicationPermissionException,
GroupNotFoundException
- Specified by:
removeGroupAttributes in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
GroupNotFoundException
removeGroup
public void removeGroup(Application application,
String groupname)
throws OperationFailedException,
ApplicationPermissionException,
GroupNotFoundException
- Specified by:
removeGroup in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
GroupNotFoundException
searchGroups
public <T> List<T> searchGroups(Application application,
EntityQuery<T> query)
- Specified by:
searchGroups in interface ApplicationService
addUserToGroup
public void addUserToGroup(Application application,
String username,
String groupName)
throws OperationFailedException,
ApplicationPermissionException,
UserNotFoundException,
GroupNotFoundException,
MembershipAlreadyExistsException
- Specified by:
addUserToGroup in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
UserNotFoundException
GroupNotFoundException
MembershipAlreadyExistsException
addGroupToGroup
public void addGroupToGroup(Application application,
String childGroupName,
String parentGroupName)
throws OperationFailedException,
ApplicationPermissionException,
GroupNotFoundException,
InvalidMembershipException,
MembershipAlreadyExistsException
- Specified by:
addGroupToGroup in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
GroupNotFoundException
InvalidMembershipException
MembershipAlreadyExistsException
removeUserFromGroup
public void removeUserFromGroup(Application application,
String username,
String groupName)
throws OperationFailedException,
ApplicationPermissionException,
MembershipNotFoundException,
UserNotFoundException,
GroupNotFoundException
- Specified by:
removeUserFromGroup in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
MembershipNotFoundException
UserNotFoundException
GroupNotFoundException
removeGroupFromGroup
public void removeGroupFromGroup(Application application,
String childGroup,
String parentGroup)
throws OperationFailedException,
ApplicationPermissionException,
MembershipNotFoundException,
GroupNotFoundException
- Specified by:
removeGroupFromGroup in interface ApplicationService
- Throws:
OperationFailedException
ApplicationPermissionException
MembershipNotFoundException
GroupNotFoundException
isUserDirectGroupMember
public boolean isUserDirectGroupMember(Application application,
String username,
String groupName)
- Specified by:
isUserDirectGroupMember in interface ApplicationService
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(Application application,
String childGroup,
String parentGroup)
- Specified by:
isGroupDirectGroupMember in interface ApplicationService
isUserNestedGroupMember
public boolean isUserNestedGroupMember(Application application,
String username,
String groupName)
- Specified by:
isUserNestedGroupMember in interface ApplicationService
isGroupNestedGroupMember
public boolean isGroupNestedGroupMember(Application application,
String childGroup,
String parentGroup)
- Specified by:
isGroupNestedGroupMember in interface ApplicationService
searchDirectGroupRelationships
public <T> List<T> searchDirectGroupRelationships(Application application,
MembershipQuery<T> query)
- Specified by:
searchDirectGroupRelationships in interface ApplicationService
searchNestedGroupRelationships
public <T> List<T> searchNestedGroupRelationships(Application application,
MembershipQuery<T> query)
- Specified by:
searchNestedGroupRelationships in interface ApplicationService
setAllowShadowedUsersInMembershipQueryResults
public void setAllowShadowedUsersInMembershipQueryResults(boolean allow)
- Whether to allow shadowed users to be returned when executing searches for all users that are members of a
particular group for a given application.
When this is false, by default, the affected queries will be slower but the results returned will be consistent
with the rules that apply to authentication and permission checking (shadowed users are not allowed to
authenticate and their group memberships are not considered).
getCurrentEventToken
public String getCurrentEventToken(Application application)
throws IncrementalSynchronisationNotAvailableException
- Specified by:
getCurrentEventToken in interface ApplicationService
- Throws:
IncrementalSynchronisationNotAvailableException
getNewEvents
public Events getNewEvents(Application application,
String eventToken)
throws EventTokenExpiredException,
OperationFailedException
- Specified by:
getNewEvents in interface ApplicationService
- Throws:
EventTokenExpiredException
OperationFailedException
findWebhookById
public Webhook findWebhookById(Application application,
long webhookId)
throws WebhookNotFoundException,
ApplicationPermissionException
- Specified by:
findWebhookById in interface ApplicationService
- Throws:
WebhookNotFoundException
ApplicationPermissionException
registerWebhook
public Webhook registerWebhook(Application application,
String endpointUrl,
@Nullable
String token)
throws InvalidWebhookEndpointException
- Specified by:
registerWebhook in interface ApplicationService
- Throws:
InvalidWebhookEndpointException
unregisterWebhook
public void unregisterWebhook(Application application,
long webhookId)
throws ApplicationPermissionException,
WebhookNotFoundException
- Specified by:
unregisterWebhook in interface ApplicationService
- Throws:
ApplicationPermissionException
WebhookNotFoundException
Copyright © 2014 Atlassian. All Rights Reserved.