|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.util.persistence.hibernate.HibernateDao com.atlassian.crowd.dao.application.ApplicationDAOHibernate
public class ApplicationDAOHibernate
Field Summary |
---|
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
---|
batchFinder, batchProcessor, logger, sessionFactory |
Constructor Summary | |
---|---|
ApplicationDAOHibernate()
|
Method Summary | |
---|---|
ApplicationImpl |
add(Application application,
PasswordCredential passwordCredential)
Will only create the core attributes to an application, i.e. |
void |
addDirectoryMapping(long applicationId,
long directoryId,
boolean allowAllToAuthenticate,
OperationType... operationTypes)
Adds a mapping between application and directory. |
void |
addGroupMapping(long applicationId,
long directoryId,
String groupName)
Adds a group mapping. |
void |
addRemoteAddress(long applicationId,
RemoteAddress remoteAddress)
Associates a remote address to the given application. |
List<Application> |
findAuthorisedApplications(long directoryId,
List<String> groupNames)
Finds all applications that are authorised for authentication given the directory id and group memberships of a user. |
ApplicationImpl |
findById(long id)
Finds application by application id. |
ApplicationImpl |
findByName(String name)
Finds application by application name, in a case-insensitive way. |
Class |
getPersistentClass()
All subclasses of HibernateDao must implement this method for HibernateDao.load(long) to work correctly. |
void |
remove(Application application)
Removes the application. |
void |
removeDirectoryMapping(long applicationId,
long directoryId)
Removes a mapping between application and directory. |
void |
removeDirectoryMappings(long directoryId)
Removes all the mappings associated with the given directory identified by directory id. |
void |
removeGroupMapping(long applicationId,
long directoryId,
String groupName)
Removes a group mapping. |
void |
removeGroupMappings(long directoryId,
String groupName)
Removes group mappings. |
void |
removeRemoteAddress(long applicationId,
RemoteAddress remoteAddress)
Dissociates the given remote address from the given application. |
void |
renameGroupMappings(long directoryId,
String oldGroupName,
String newGroupName)
Renames group mappings. |
List<Application> |
search(EntityQuery<Application> query)
Will search for all the applications which qualify for the given EntityQuery . |
void |
setAliasDao(AliasDAO aliasDao)
|
void |
setDirectoryDao(DirectoryDao directoryDao)
|
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
|
ApplicationImpl |
update(Application application)
Will only update the core attributes to an application, i.e. |
void |
updateCredential(Application application,
PasswordCredential passwordCredential)
Updates credential of the given application. |
void |
updateDirectoryMapping(long applicationId,
long directoryId,
boolean allowAllToAuthenticate)
Updates a directory mapping. |
void |
updateDirectoryMapping(long applicationId,
long directoryId,
boolean allowAllToAuthenticate,
Set<OperationType> operationTypes)
Updates a directory mapping. |
void |
updateDirectoryMapping(long applicationId,
long directoryId,
int position)
Updates the ordering of directory mappings for an application. |
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
---|
createHibernateQuery, load, load, loadReference, loadReference, remove, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setSessionFactory, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationDAOHibernate()
Method Detail |
---|
public ApplicationImpl add(Application application, PasswordCredential passwordCredential)
ApplicationDAO
add
in interface ApplicationDAO
application
- The application.passwordCredential
- Credential.
public void addDirectoryMapping(long applicationId, long directoryId, boolean allowAllToAuthenticate, OperationType... operationTypes) throws DirectoryNotFoundException, ApplicationNotFoundException
ApplicationDAO
addDirectoryMapping
in interface ApplicationDAO
applicationId
- Application id.directoryId
- Directory id.allowAllToAuthenticate
- True if all users in the directory are allowed to authenticate against the application.operationTypes
- The collection of permissible operation types.
DirectoryNotFoundException
- if the directory specified by the directoryId does not exist.
ApplicationNotFoundException
- if the application specified by the applicationId does not exist.public void addGroupMapping(long applicationId, long directoryId, String groupName) throws ApplicationNotFoundException
ApplicationDAO
addGroupMapping
in interface ApplicationDAO
applicationId
- Application id.directoryId
- Directory id.groupName
- Group name.
ApplicationNotFoundException
- If the application cannot be found.public void addRemoteAddress(long applicationId, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationDAO
addRemoteAddress
in interface ApplicationDAO
applicationId
- Application id.remoteAddress
- Remote address.
ApplicationNotFoundException
- If the application cannot be found.public List<Application> findAuthorisedApplications(long directoryId, List<String> groupNames)
ApplicationDAO
findAuthorisedApplications
in interface ApplicationDAO
directoryId
- directory id of the user.groupNames
- group memberships of the user in the particular directory.
public ApplicationImpl findById(long id) throws ApplicationNotFoundException
ApplicationDAO
findById
in interface ApplicationDAO
id
- Application id.
ApplicationNotFoundException
- If application of the specified id does not exist.public ApplicationImpl findByName(String name) throws ApplicationNotFoundException
ApplicationDAO
findByName
in interface ApplicationDAO
name
- Application name.
ApplicationNotFoundException
- If application of the specified name does not exist.public Class getPersistentClass()
HibernateDao
HibernateDao.load(long)
to work correctly.
getPersistentClass
in class HibernateDao
public void remove(Application application)
ApplicationDAO
remove
in interface ApplicationDAO
application
- The application.public void removeDirectoryMapping(long applicationId, long directoryId) throws ApplicationNotFoundException
ApplicationDAO
removeDirectoryMapping
in interface ApplicationDAO
applicationId
- Application id.directoryId
- Directory id.
ApplicationNotFoundException
- If the application cannot be found.public void removeDirectoryMappings(long directoryId)
ApplicationDAO
removeDirectoryMappings
in interface ApplicationDAO
directoryId
- Directory id.public void removeGroupMapping(long applicationId, long directoryId, String groupName) throws ApplicationNotFoundException
ApplicationDAO
removeGroupMapping
in interface ApplicationDAO
applicationId
- Application id.directoryId
- Directory id.groupName
- Group name.
ApplicationNotFoundException
public void removeGroupMappings(long directoryId, String groupName)
ApplicationDAO
removeGroupMappings
in interface ApplicationDAO
directoryId
- Directory id.groupName
- Group name.public void removeRemoteAddress(long applicationId, RemoteAddress remoteAddress) throws ApplicationNotFoundException
ApplicationDAO
removeRemoteAddress
in interface ApplicationDAO
applicationId
- Application id.remoteAddress
- Remote address, not null.
ApplicationNotFoundException
- If the application cannot be found.public void renameGroupMappings(long directoryId, String oldGroupName, String newGroupName)
ApplicationDAO
renameGroupMappings
in interface ApplicationDAO
directoryId
- Directory id.oldGroupName
- old group name.newGroupName
- new group name.public List<Application> search(EntityQuery<Application> query)
ApplicationDAO
EntityQuery
.
search
in interface ApplicationDAO
query
- Entity query of type EntityDescriptor.application()
.
public ApplicationImpl update(Application application) throws ApplicationNotFoundException
ApplicationDAO
update
in interface ApplicationDAO
application
- The application.
ApplicationNotFoundException
- If the application could not be found.public void updateCredential(Application application, PasswordCredential passwordCredential) throws ApplicationNotFoundException
ApplicationDAO
updateCredential
in interface ApplicationDAO
application
- The application.passwordCredential
- The new credential.
ApplicationNotFoundException
- If the application could not be found.public void updateDirectoryMapping(long applicationId, long directoryId, int position) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationDAO
updateDirectoryMapping
in interface ApplicationDAO
applicationId
- Application iddirectoryId
- Directory idposition
- New position in the order of directories for this given directory.
Positions in the list of directories are absolute and zero based.
ApplicationNotFoundException
- if the application could not be found
DirectoryNotFoundException
- if the directory could not be foundpublic void updateDirectoryMapping(long applicationId, long directoryId, boolean allowAllToAuthenticate) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationDAO
updateDirectoryMapping
in interface ApplicationDAO
applicationId
- Application iddirectoryId
- Directory id.allowAllToAuthenticate
- True, if all users are allowed to authenticate.
ApplicationNotFoundException
- If the application cannot be found.
DirectoryNotFoundException
- If the directory cannot be found.public void updateDirectoryMapping(long applicationId, long directoryId, boolean allowAllToAuthenticate, Set<OperationType> operationTypes) throws ApplicationNotFoundException, DirectoryNotFoundException
ApplicationDAO
updateDirectoryMapping
in interface ApplicationDAO
applicationId
- Application iddirectoryId
- Directory id.allowAllToAuthenticate
- True, if all users are allowed to authenticate.operationTypes
- the set of permissible operation types.
ApplicationNotFoundException
- If the application cannot be found.
DirectoryNotFoundException
- If the directory cannot be found.@Autowired public void setAliasDao(AliasDAO aliasDao)
@Autowired public void setDirectoryDao(DirectoryDao directoryDao)
@Autowired public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |