@Transactional public class ApplicationManagerGeneric extends Object implements ApplicationManager
| Constructor and Description |
|---|
ApplicationManagerGeneric(ApplicationDAO applicationDao,
PasswordEncoderFactory passwordEncoderFactory,
com.atlassian.event.api.EventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
Application |
add(Application application)
Will add the given Application to Crowd
|
void |
addDirectoryMapping(Application application,
Directory directory,
boolean allowAllToAuthenticate,
OperationType... operationTypes)
Will add a DirectoryMapping between the passed in Application and Directory.
|
void |
addGroupMapping(Application application,
Directory directory,
String groupName)
Will add a group mapping for the given application + directory mapping.
|
void |
addRemoteAddress(Application application,
RemoteAddress remoteAddress)
Will add a remote address to the current application
|
boolean |
authenticate(Application application,
PasswordCredential testCredential)
Takes an application, which contains a hashed credential, and compares that
to a hash of the supplied testCredential.
|
List<Application> |
findAll()
Retrieves all the applications in the Crowd system.
|
Application |
findById(long id)
Find an application by its ID.
|
Application |
findByName(String name)
Find an application by its name.
|
void |
remove(Application application)
Remove an application.
|
void |
removeDirectoryFromApplication(Directory directory,
Application application)
Will remove a directory from an application.
|
void |
removeGroupMapping(Application application,
Directory directory,
String groupName)
Will remove a group mapping for the given application + directory mapping.
|
void |
removeRemoteAddress(Application application,
RemoteAddress remoteAddress)
Will remove the passed in RemoteAddress from the application
|
List<Application> |
search(EntityQuery query)
Search applications.
|
Application |
update(Application application)
Updates an application's details.
|
void |
updateCredential(Application application,
PasswordCredential passwordCredential)
Takes an application with a List of credentials that are unencrypted, encrypts them
and then updates the application in the database with the encrypted credentials
|
void |
updateDirectoryMapping(Application application,
Directory directory,
boolean allowAllToAuthenticate)
Will update the Directory Mapping, setting to enable/disable allowing all users to authenticate for the given mapping (not taking group membership into consideration)
|
void |
updateDirectoryMapping(Application application,
Directory directory,
boolean allowAllToAuthenticate,
Set<OperationType> operationTypes)
Will update a directory mapping against the Application moving it to the selected position in the list of DirectoryMappings.
|
void |
updateDirectoryMapping(Application application,
Directory directory,
int position)
Will update a directory mapping against the Application moving it to the selected position in the list of DirectoryMappings.
|
public ApplicationManagerGeneric(ApplicationDAO applicationDao, PasswordEncoderFactory passwordEncoderFactory, com.atlassian.event.api.EventPublisher eventPublisher)
public Application add(Application application) throws InvalidCredentialException, ApplicationAlreadyExistsException
ApplicationManageradd in interface ApplicationManagerapplication - the Application to add.InvalidCredentialException - if there was an error encrypting the Applications passwordApplicationAlreadyExistsException - if an application with the same name already existspublic Application findById(long id) throws ApplicationNotFoundException
ApplicationManagerfindById in interface ApplicationManagerid - database ID.ApplicationNotFoundException - application with requested ID does not exist.public Application findByName(String name) throws ApplicationNotFoundException
ApplicationManagerfindByName in interface ApplicationManagername - name of application.ApplicationNotFoundException - application with requested name does not exist.public void remove(Application application) throws ApplicationManagerException
ApplicationManagerremove in interface ApplicationManagerapplication - application to remove.ApplicationManagerException - if the remove operation is not permitted on the given application.public void removeDirectoryFromApplication(Directory directory, Application application) throws ApplicationManagerException
ApplicationManagerremoveDirectoryFromApplication in interface ApplicationManagerdirectory - the directory you wish to disociateapplication - the application you wish to apply this dissociation tooApplicationManagerException - thrown if anything goes bad, updating the applicationpublic List<Application> search(EntityQuery query)
ApplicationManagersearch in interface ApplicationManagerquery - Application entity query.public List<Application> findAll()
ApplicationManagerfindAll in interface ApplicationManagerpublic Application update(Application application) throws ApplicationManagerException, ApplicationNotFoundException
ApplicationManagerupdate in interface ApplicationManagerapplication - modified application.ApplicationManagerException - error updating application, ie. if you try to rename a permanent application or try to deactivate the CROWD application.ApplicationNotFoundException - if the application could not be foundpublic void updateCredential(Application application, PasswordCredential passwordCredential) throws ApplicationManagerException, ApplicationNotFoundException
ApplicationManagerupdateCredential in interface ApplicationManagerapplication - an application with unencrypted password credentialspasswordCredential - unencrypted password.ApplicationManagerException - not allowed to update.ApplicationNotFoundException - if the application could not be foundpublic boolean authenticate(Application application, PasswordCredential testCredential) throws ApplicationNotFoundException
ApplicationManagerauthenticate in interface ApplicationManagerapplication - application to authenticate as.testCredential - credentials to authenticate with.true iff the testCredential matches the actual application credential.ApplicationNotFoundException - if the application could not be foundpublic void addDirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate, OperationType... operationTypes) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManageraddDirectoryMapping in interface ApplicationManagerapplication - the application in questiondirectory - the directory associated to the applicationallowAllToAuthenticate - to enable/disable the allow all to authenticate flagoperationTypes - The set of allowed operations for the given directory/application mappingApplicationNotFoundException - if the application could not be foundDirectoryNotFoundException - if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, int position) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManagerupdateDirectoryMapping in interface ApplicationManagerapplication - the application in questiondirectory - the directory associated to the applicationposition - This will recognise the need to shift a mapping either up or down in the. A -ve value will not result in an index shiftApplicationNotFoundException - if the application could not be foundDirectoryNotFoundException - if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManagerupdateDirectoryMapping in interface ApplicationManagerapplication - the application in questiondirectory - the directory associated to the applicationallowAllToAuthenticate - to enable/disable the allow all to authenticate flagApplicationNotFoundException - if the application could not be foundDirectoryNotFoundException - if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate, Set<OperationType> operationTypes) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManagerupdateDirectoryMapping in interface ApplicationManagerapplication - the application in questiondirectory - the directory associated to the applicationallowAllToAuthenticate - to enable/disable the allow all to authenticate flagoperationTypes - The set of allowed operations for the given directory/application mappingApplicationNotFoundException - if the application could not be foundDirectoryNotFoundException - if the directory could not be foundpublic void addRemoteAddress(Application application, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationManageraddRemoteAddress in interface ApplicationManagerapplication - the application to updateremoteAddress - the remote address to addApplicationNotFoundException - if the application could not be foundpublic void removeRemoteAddress(Application application, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationManagerremoveRemoteAddress in interface ApplicationManagerapplication - the application to updateremoteAddress - the remote address to removeApplicationNotFoundException - if the application could not be foundpublic void addGroupMapping(Application application, Directory directory, String groupName) throws ApplicationNotFoundException
ApplicationManageraddGroupMapping in interface ApplicationManagerapplication - the application to updatedirectory - the directory associated to the applicationgroupName - the group name to addApplicationNotFoundException - if the application could not be foundpublic void removeGroupMapping(Application application, Directory directory, String groupName) throws ApplicationNotFoundException
ApplicationManagerremoveGroupMapping in interface ApplicationManagerapplication - the application to updatedirectory - the directory associated to the applicationgroupName - the group name to removeApplicationNotFoundExceptionCopyright © 2017 Atlassian. All rights reserved.