public class ApplicationDAOHibernate extends HibernateDao<ApplicationImpl> implements ApplicationDAO
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
ApplicationDAOHibernate() |
Modifier and Type | Method and Description |
---|---|
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 a user from a given directory belonging to the specified groups can authenticate to.
|
ApplicationImpl |
findById(long id)
Finds application by application id.
|
ApplicationImpl |
findByName(String name)
Finds application by application name, in a case-insensitive way.
|
DirectoryMapping |
findDirectoryMapping(long applicationId,
long directoryId)
Finds the directory mapping for a given application and directory combination
|
Class<ApplicationImpl> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) 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.
|
List<Application> |
search(EntityQuery<Application> query)
Will search for all the applications which qualify for the given
EntityQuery . |
void |
setAliasDao(AliasDAO aliasDao) |
void |
setApplicationDefaultGroupMembershipConfigurationDao(ApplicationDefaultGroupMembershipConfigurationDao applicationDefaultGroupMembershipConfigurationDao) |
void |
setDirectoryDao(DirectoryDao directoryDao) |
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater) |
void |
setLicensingSummaryDao(LicensingSummaryDao licensingSummaryDao) |
void |
setUserPermissionDAO(InternalUserPermissionDAO userPermissionDAO) |
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.
|
protected void |
updateInternal(ApplicationImpl application) |
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
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<ApplicationImpl> getPersistentClass()
HibernateDao
HibernateDao.load(Serializable)
to work
correctly.getPersistentClass
in class HibernateDao<ApplicationImpl>
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 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 foundDirectoryNotFoundException
- 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.protected void updateInternal(ApplicationImpl application)
public DirectoryMapping findDirectoryMapping(long applicationId, long directoryId) throws DirectoryMappingNotFoundException
ApplicationDAO
findDirectoryMapping
in interface ApplicationDAO
applicationId
- Application iddirectoryId
- Directory idDirectoryMappingNotFoundException
- If the directory mapping cannot be found@Autowired public void setAliasDao(AliasDAO aliasDao)
@Autowired public void setDirectoryDao(DirectoryDao directoryDao)
@Autowired public void setUserPermissionDAO(InternalUserPermissionDAO userPermissionDAO)
@Autowired public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
@Autowired public void setApplicationDefaultGroupMembershipConfigurationDao(ApplicationDefaultGroupMembershipConfigurationDao applicationDefaultGroupMembershipConfigurationDao)
@Autowired public void setLicensingSummaryDao(LicensingSummaryDao licensingSummaryDao)
Copyright © 2020 Atlassian. All rights reserved.