|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.manager.application.ApplicationManagerGeneric
public class ApplicationManagerGeneric
Constructor Summary | |
---|---|
ApplicationManagerGeneric(ApplicationDAO applicationDao,
PasswordEncoderFactory passwordEncoderFactory,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationManagerGeneric(ApplicationDAO applicationDao, PasswordEncoderFactory passwordEncoderFactory, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
public Application add(Application application) throws InvalidCredentialException
ApplicationManager
add
in interface ApplicationManager
application
- the Application to add.
InvalidCredentialException
- if there was an error encrypting the Applications passwordpublic Application findById(long id) throws ApplicationNotFoundException
ApplicationManager
findById
in interface ApplicationManager
id
- database ID.
ApplicationNotFoundException
- application with requested ID does not exist.public Application findByName(String name) throws ApplicationNotFoundException
ApplicationManager
findByName
in interface ApplicationManager
name
- name of application.
ApplicationNotFoundException
- application with requested name does not exist.public void remove(Application application) throws ApplicationManagerException
ApplicationManager
remove
in interface ApplicationManager
application
- application to remove.
ApplicationManagerException
- if the remove operation is not permitted on the given application.public void removeDirectoryFromApplication(Directory directory, Application application) throws ApplicationManagerException
ApplicationManager
removeDirectoryFromApplication
in interface ApplicationManager
directory
- the directory you wish to disociateapplication
- the application you wish to apply this dissociation too
ApplicationManagerException
- thrown if anything goes bad, updating the applicationpublic List<Application> search(EntityQuery query)
ApplicationManager
search
in interface ApplicationManager
query
- Application entity query.
public List<Application> findAll()
ApplicationManager
findAll
in interface ApplicationManager
public Application update(Application application) throws ApplicationManagerException, ApplicationNotFoundException
ApplicationManager
update
in interface ApplicationManager
application
- 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
ApplicationManager
updateCredential
in interface ApplicationManager
application
- 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
ApplicationManager
authenticate
in interface ApplicationManager
application
- 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
ApplicationManager
addDirectoryMapping
in interface ApplicationManager
application
- 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 mapping
ApplicationNotFoundException
- if the application could not be found
DirectoryNotFoundException
- if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, int position) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManager
updateDirectoryMapping
in interface ApplicationManager
application
- 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 shift
ApplicationNotFoundException
- if the application could not be found
DirectoryNotFoundException
- if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManager
updateDirectoryMapping
in interface ApplicationManager
application
- the application in questiondirectory
- the directory associated to the applicationallowAllToAuthenticate
- to enable/disable the allow all to authenticate flag
ApplicationNotFoundException
- if the application could not be found
DirectoryNotFoundException
- if the directory could not be foundpublic void updateDirectoryMapping(Application application, Directory directory, boolean allowAllToAuthenticate, Set<OperationType> operationTypes) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationManager
updateDirectoryMapping
in interface ApplicationManager
application
- 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 mapping
ApplicationNotFoundException
- if the application could not be found
DirectoryNotFoundException
- if the directory could not be foundpublic void addRemoteAddress(Application application, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationManager
addRemoteAddress
in interface ApplicationManager
application
- the application to updateremoteAddress
- the remote address to add
ApplicationNotFoundException
- if the application could not be foundpublic void removeRemoteAddress(Application application, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationManager
removeRemoteAddress
in interface ApplicationManager
application
- the application to updateremoteAddress
- the remote address to remove
ApplicationNotFoundException
- if the application could not be foundpublic void addGroupMapping(Application application, Directory directory, String groupName) throws ApplicationNotFoundException
ApplicationManager
addGroupMapping
in interface ApplicationManager
application
- the application to updatedirectory
- the directory associated to the applicationgroupName
- the group name to add
ApplicationNotFoundException
- if the application could not be foundpublic void removeGroupMapping(Application application, Directory directory, String groupName) throws ApplicationNotFoundException
ApplicationManager
removeGroupMapping
in interface ApplicationManager
application
- the application to updatedirectory
- the directory associated to the applicationgroupName
- the group name to remove
ApplicationNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |