public class DefaultJaacsService extends Object implements JaacsService
Constructor and Description |
---|
DefaultJaacsService(com.atlassian.crowd.manager.application.ApplicationManager applicationManager,
PermissionManager permissionManager,
I18nHelper.BeanFactory i18nFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
addRemoteAddress(JiraServiceContext jiraServiceContext,
String remoteAddress,
long applicationId)
Adding a new remote address.
|
void |
create(ApplicationUser remoteUser,
com.atlassian.crowd.model.application.Application application)
Creates a new Application
|
boolean |
deleteApplication(JiraServiceContext jiraServiceContext,
long applicationId)
Delete a remote address.
|
protected String |
displayName(ApplicationUser remoteUser,
Long applicationId)
Attempts to read the the Application with the given id from the database, and returns its display name.
|
protected void |
ensureIsAdmin(ApplicationUser remoteUser)
If the remote user is not an administrator, throws a ValidationFailureException with the appropriate error.
|
List<com.atlassian.crowd.model.application.Application> |
findAll(ApplicationUser remoteUser)
Returns a list containing all non-permanent Crowd applications.
|
com.atlassian.crowd.model.application.ApplicationImpl |
findById(ApplicationUser remoteUser,
Long applicationId)
Returns the Application having the given id.
|
Set<com.atlassian.crowd.model.application.RemoteAddress> |
getRemoteAddresses(JiraServiceContext jiraServiceContext,
long applicationId)
Retrieve a list of configured remote addresses.
|
protected I18nHelper |
i18n(ApplicationUser user)
Returns an I18nHelper for the given user.
|
boolean |
resetPassword(JiraServiceContext jiraServiceContext,
String password,
long applicationId)
Reset a password.
|
void |
update(ApplicationUser remoteUser,
com.atlassian.crowd.model.application.Application updatedApplication)
Updates an Application.
|
boolean |
validateAddRemoteAddress(JiraServiceContext jiraServiceContext,
String remoteAddress,
long applicationId)
Validate adding a new remote address.
|
protected void |
validateApplication(ApplicationUser user,
com.atlassian.crowd.model.application.Application application)
Validates the application's name, password, and remote addresses fields.
|
boolean |
validateDeleteApplication(JiraServiceContext jiraServiceContext,
long applicationId)
Validate deleting a remote address.
|
protected void |
validateJiraServiceContext(JiraServiceContext jiraServiceContext) |
boolean |
validateResetPassword(JiraServiceContext jiraServiceContext,
String password,
long applicationId)
Validate resetting a password.
|
public DefaultJaacsService(com.atlassian.crowd.manager.application.ApplicationManager applicationManager, PermissionManager permissionManager, I18nHelper.BeanFactory i18nFactory)
public Set<com.atlassian.crowd.model.application.RemoteAddress> getRemoteAddresses(JiraServiceContext jiraServiceContext, long applicationId)
JaacsService
getRemoteAddresses
in interface JaacsService
jiraServiceContext
- The service context.applicationId
- Application Idpublic boolean validateAddRemoteAddress(JiraServiceContext jiraServiceContext, String remoteAddress, long applicationId)
JaacsService
validateAddRemoteAddress
in interface JaacsService
jiraServiceContext
- The service context.remoteAddress
- A new address to addapplicationId
- Application Idpublic boolean addRemoteAddress(JiraServiceContext jiraServiceContext, String remoteAddress, long applicationId)
JaacsService
addRemoteAddress
in interface JaacsService
jiraServiceContext
- The service context.remoteAddress
- A new address to addapplicationId
- Application Idpublic boolean validateDeleteApplication(JiraServiceContext jiraServiceContext, long applicationId)
JaacsService
validateDeleteApplication
in interface JaacsService
jiraServiceContext
- The service context.applicationId
- Application Idpublic boolean deleteApplication(JiraServiceContext jiraServiceContext, long applicationId)
JaacsService
deleteApplication
in interface JaacsService
jiraServiceContext
- The service context.applicationId
- Application Idpublic boolean validateResetPassword(JiraServiceContext jiraServiceContext, String password, long applicationId)
JaacsService
validateResetPassword
in interface JaacsService
jiraServiceContext
- The service context.password
- A password stringapplicationId
- Application Idpublic boolean resetPassword(JiraServiceContext jiraServiceContext, String password, long applicationId)
JaacsService
resetPassword
in interface JaacsService
jiraServiceContext
- The service context.password
- A password stringapplicationId
- Application Idpublic List<com.atlassian.crowd.model.application.Application> findAll(ApplicationUser remoteUser)
JaacsService
findAll
in interface JaacsService
remoteUser
- a User representing the user on whose behalf to perform the callpublic com.atlassian.crowd.model.application.ApplicationImpl findById(ApplicationUser remoteUser, Long applicationId)
JaacsService
findById
in interface JaacsService
remoteUser
- a User representing the user on whose behalf to perform the callapplicationId
- a Long containing an application id, or null if it doesn't existpublic void create(ApplicationUser remoteUser, com.atlassian.crowd.model.application.Application application)
JaacsService
create
in interface JaacsService
remoteUser
- a User representing the user on whose behalf to perform the callapplication
- an Application to createpublic void update(ApplicationUser remoteUser, com.atlassian.crowd.model.application.Application updatedApplication)
JaacsService
update
in interface JaacsService
remoteUser
- a User representing the user on whose behalf to perform the callupdatedApplication
- an Application to updateprotected void validateJiraServiceContext(JiraServiceContext jiraServiceContext)
protected void ensureIsAdmin(ApplicationUser remoteUser) throws ValidationFailureException
remoteUser
- a User representing the user on whose behalf to perform the callValidationFailureException
- if the user is not an adminprotected void validateApplication(ApplicationUser user, com.atlassian.crowd.model.application.Application application) throws ValidationFailureException
user
- a User on whose behalfapplication
- the Application to validateValidationFailureException
- if any of the field values is not validprotected String displayName(ApplicationUser remoteUser, Long applicationId)
remoteUser
- the User on whose behalf this service is operatingapplicationId
- a Long containing an application idprotected I18nHelper i18n(ApplicationUser user)
user
- a UserCopyright © 2002-2019 Atlassian. All Rights Reserved.