Class DirectorySynchronisationStatusDAOHibernate
java.lang.Object
com.atlassian.crowd.util.persistence.hibernate.StatelessDao
com.atlassian.crowd.util.persistence.hibernate.HibernateDao<DirectorySynchronisationStatusImpl>
com.atlassian.crowd.dao.directory.DirectorySynchronisationStatusDAOHibernate
- All Implemented Interfaces:
DirectorySynchronisationStatusDao
public class DirectorySynchronisationStatusDAOHibernate
extends HibernateDao<DirectorySynchronisationStatusImpl>
implements DirectorySynchronisationStatusDao
-
Field Summary
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
sessionFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(DirectorySynchronisationStatus status) Saves a new synchronisation statusfindActiveForDirectory
(long directoryId) findActiveSyncsWhereNodeIdNotIn
(Set<String> nodesIds) findLastForDirectory
(long directoryId) All subclasses of HibernateDao must implement this method forHibernateDao.load(Serializable)
to work correctly.long
Removes all stored status informationlong
removeAllExcept
(long directoryId, int statusId) Removes all stored status information for the directory except the indicated onelong
removeStatusesForDirectory
(Long directoryId) Removes all stored status information for the directory with the specified idvoid
setDirectoryDao
(DirectoryDAOHibernate directoryDao) update
(DirectorySynchronisationStatus status) Updates an existing directory statusMethods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
createDeleteQuery, createDeleteQuery, createQuery, createQuery, 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
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
setSessionFactory, withStatelessSession
-
Constructor Details
-
DirectorySynchronisationStatusDAOHibernate
public DirectorySynchronisationStatusDAOHibernate()
-
-
Method Details
-
setDirectoryDao
-
getPersistentClass
Description copied from class:HibernateDao
All subclasses of HibernateDao must implement this method forHibernateDao.load(Serializable)
to work correctly.- Specified by:
getPersistentClass
in classHibernateDao<DirectorySynchronisationStatusImpl>
- Returns:
- the entity class for this DAO
-
findActiveForDirectory
- Specified by:
findActiveForDirectory
in interfaceDirectorySynchronisationStatusDao
- Returns:
- the status of the latest active synchronization for the given directory if present
-
findLastForDirectory
- Specified by:
findLastForDirectory
in interfaceDirectorySynchronisationStatusDao
- Returns:
- the status of the latest completed synchronization for the given directory if present
-
update
public DirectorySynchronisationStatus update(DirectorySynchronisationStatus status) throws ObjectNotFoundException Description copied from interface:DirectorySynchronisationStatusDao
Updates an existing directory status- Specified by:
update
in interfaceDirectorySynchronisationStatusDao
- Returns:
- the updated status. Must have an id set
- Throws:
ObjectNotFoundException
- if a status with the given id doesn't exist
-
add
Description copied from interface:DirectorySynchronisationStatusDao
Saves a new synchronisation status- Specified by:
add
in interfaceDirectorySynchronisationStatusDao
- Returns:
- the newly saved status
-
removeStatusesForDirectory
Description copied from interface:DirectorySynchronisationStatusDao
Removes all stored status information for the directory with the specified id- Specified by:
removeStatusesForDirectory
in interfaceDirectorySynchronisationStatusDao
- Parameters:
directoryId
- the directory id to remove for- Returns:
- the number of entries removed
-
removeAll
public long removeAll()Description copied from interface:DirectorySynchronisationStatusDao
Removes all stored status information- Specified by:
removeAll
in interfaceDirectorySynchronisationStatusDao
- Returns:
- the number of entries removed
-
removeAllExcept
public long removeAllExcept(long directoryId, int statusId) Description copied from interface:DirectorySynchronisationStatusDao
Removes all stored status information for the directory except the indicated one- Specified by:
removeAllExcept
in interfaceDirectorySynchronisationStatusDao
- Parameters:
directoryId
- the directory idstatusId
- the id of the status to keep- Returns:
- the number of entries removed
-
findActiveSyncsWhereNodeIdNotIn
public Collection<DirectorySynchronisationStatus> findActiveSyncsWhereNodeIdNotIn(Set<String> nodesIds) - Specified by:
findActiveSyncsWhereNodeIdNotIn
in interfaceDirectorySynchronisationStatusDao
- Parameters:
nodesIds
- the set of node ids to filter on- Returns:
- entries for synchronisations that are indicated as active but not owned by any of the nodes ids
-