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
  • Field Summary

    Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

    ENTITY
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    applyTriggersToTree(long rootId)
     
    void
    delete(long id, int code)
     
    findByAK(String event, Long folderId, long tenantId)
     
    findByEvent(String event, long tenantId)
     
    findByFolder(long folderId)
     
    Gets all the triggers that are time-driven and not already triggered
    getAutomation(String event, Long folderId, long tenantId)
    Retrieves the registered automation script for a given event and folder
    void
     
    void
    Schedules the job for the trigger.
    void
    setFolderDao(com.logicaldoc.core.folder.FolderDAO folderDao)
     
    void
    setJobManager(com.logicaldoc.core.job.JobManager jobManager)
     
    void
     
    void
     
    void
    unscheduleTrigger(long triggerId)
    Unschedules the job of the given trigger.

    Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, 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, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
  • Method Details

    • setJobManager

      public void setJobManager(com.logicaldoc.core.job.JobManager jobManager)
    • findByAK

      public AutomationTrigger findByAK(String event, Long folderId, long tenantId)
      Specified by:
      findByAK in interface AutomationTriggerDAO
    • getAutomation

      public AutomationRoutine getAutomation(String event, Long folderId, long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: AutomationTriggerDAO
      Retrieves the registered automation script for a given event and folder
      Specified by:
      getAutomation in interface AutomationTriggerDAO
      Parameters:
      event - the event's code
      folderId - 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:
      findByEvent in interface AutomationTriggerDAO
    • setRoutineDao

      public void setRoutineDao(AutomationRoutineDAO routineDao)
    • findByFolder

      public List<AutomationTrigger> findByFolder(long folderId)
      Specified by:
      findByFolder in interface AutomationTriggerDAO
    • findTimeDrivenNotAlreadyTriggered

      public List<AutomationTrigger> findTimeDrivenNotAlreadyTriggered(Date oldestDate)
      Description copied from interface: AutomationTriggerDAO
      Gets all the triggers that are time-driven and not already triggered
      Specified by:
      findTimeDrivenNotAlreadyTriggered in interface AutomationTriggerDAO
      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:
      applyTriggersToTree in interface AutomationTriggerDAO
    • scheduleTrigger

      public void scheduleTrigger(AutomationTrigger trigger)
      Description copied from interface: AutomationTriggerDAO
      Schedules the job for the trigger. Do not invoke this directly it is used by the DAO itself.
      Specified by:
      scheduleTrigger in interface AutomationTriggerDAO
      Parameters:
      trigger - the time-driven trigger to schedule
    • unscheduleTrigger

      public void unscheduleTrigger(long triggerId)
      Description copied from interface: AutomationTriggerDAO
      Unschedules the job of the given trigger. Do not invoke this directly it is used by the DAO itself.
      Specified by:
      unscheduleTrigger in interface AutomationTriggerDAO
      Parameters:
      triggerId - the event to elaborate
    • delete

      public void delete(long id, int code) throws com.logicaldoc.core.PersistenceException
      Specified by:
      delete in interface com.logicaldoc.core.PersistentObjectDAO<AutomationTrigger>
      Overrides:
      delete in class com.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:
      store in interface com.logicaldoc.core.PersistentObjectDAO<AutomationTrigger>
      Overrides:
      store in class com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationTrigger>
      Throws:
      com.logicaldoc.core.PersistenceException