Class HibernateAutomationTriggerDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationTrigger>
-
- com.logicaldoc.enterprise.automation.HibernateAutomationTriggerDAO
-
- All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<AutomationTrigger>,AutomationTriggerDAO
public class HibernateAutomationTriggerDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationTrigger> implements AutomationTriggerDAO
Implements the DAO for automation triggers- Since:
- 8.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intapplyTriggersToTree(long rootId)voiddelete(long id, int code)AutomationTriggerfindByAK(String event, Long folderId, long tenantId)List<AutomationTrigger>findByEvent(String event, long tenantId)List<AutomationTrigger>findByFolder(long folderId)List<AutomationTrigger>findTimeDrivenNotAlreadyTriggered(Date oldestDate)Gets all the triggers that are time-driven and not already triggeredAutomationRoutinegetAutomation(String event, Long folderId, long tenantId)Retrieves the registered automation script for a given event and foldervoidinit()voidscheduleTrigger(AutomationTrigger trigger)Schedules the job for the trigger.voidsetFolderDao(com.logicaldoc.core.folder.FolderDAO folderDao)voidsetJobManager(com.logicaldoc.core.job.JobManager jobManager)voidsetRoutineDao(AutomationRoutineDAO routineDao)voidstore(AutomationTrigger trigger)voidunscheduleTrigger(long triggerId)Unschedules the job of the given trigger.-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString
-
-
-
-
Method Detail
-
setJobManager
public void setJobManager(com.logicaldoc.core.job.JobManager jobManager)
-
findByAK
public AutomationTrigger findByAK(String event, Long folderId, long tenantId)
- Specified by:
findByAKin interfaceAutomationTriggerDAO
-
getAutomation
public AutomationRoutine getAutomation(String event, Long folderId, long tenantId) throws com.logicaldoc.core.PersistenceException
Description copied from interface:AutomationTriggerDAORetrieves the registered automation script for a given event and folder- Specified by:
getAutomationin interfaceAutomationTriggerDAO- Parameters:
event- the event's codefolderId- identifier of the folder (optional)tenantId- identifier of the tenant- Returns:
- the routine containing the automation to run, if the trigger defines the scripts directly a dummy routine is returned
- Throws:
com.logicaldoc.core.PersistenceException- error at data layer
-
findByEvent
public List<AutomationTrigger> findByEvent(String event, long tenantId)
- Specified by:
findByEventin interfaceAutomationTriggerDAO
-
setRoutineDao
public void setRoutineDao(AutomationRoutineDAO routineDao)
-
findByFolder
public List<AutomationTrigger> findByFolder(long folderId)
- Specified by:
findByFolderin interfaceAutomationTriggerDAO
-
findTimeDrivenNotAlreadyTriggered
public List<AutomationTrigger> findTimeDrivenNotAlreadyTriggered(Date oldestDate)
Description copied from interface:AutomationTriggerDAOGets all the triggers that are time-driven and not already triggered- Specified by:
findTimeDrivenNotAlreadyTriggeredin interfaceAutomationTriggerDAO- Parameters:
oldestDate- the oldest date to take into account (valid only for those triggers that specify an exact date)- Returns:
- the list of triggers
-
setFolderDao
public void setFolderDao(com.logicaldoc.core.folder.FolderDAO folderDao)
-
applyTriggersToTree
public int applyTriggersToTree(long rootId)
- Specified by:
applyTriggersToTreein interfaceAutomationTriggerDAO
-
scheduleTrigger
public void scheduleTrigger(AutomationTrigger trigger)
Description copied from interface:AutomationTriggerDAOSchedules the job for the trigger. Do not invoke this directly it is used by the DAO itself.- Specified by:
scheduleTriggerin interfaceAutomationTriggerDAO- Parameters:
trigger- the time-driven trigger to schedule
-
unscheduleTrigger
public void unscheduleTrigger(long triggerId)
Description copied from interface:AutomationTriggerDAOUnschedules the job of the given trigger. Do not invoke this directly it is used by the DAO itself.- Specified by:
unscheduleTriggerin interfaceAutomationTriggerDAO- Parameters:
triggerId- the event to elaborate
-
delete
public void delete(long id, int code) throws com.logicaldoc.core.PersistenceException- Specified by:
deletein interfacecom.logicaldoc.core.PersistentObjectDAO<AutomationTrigger>- Overrides:
deletein classcom.logicaldoc.core.HibernatePersistentObjectDAO<AutomationTrigger>- Throws:
com.logicaldoc.core.PersistenceException
-
init
public void init()
-
store
public void store(AutomationTrigger trigger) throws com.logicaldoc.core.PersistenceException
- Specified by:
storein interfacecom.logicaldoc.core.PersistentObjectDAO<AutomationTrigger>- Overrides:
storein classcom.logicaldoc.core.HibernatePersistentObjectDAO<AutomationTrigger>- Throws:
com.logicaldoc.core.PersistenceException
-
-