Class JobManager

java.lang.Object
com.logicaldoc.core.job.JobManager

@Component("JobManager") public class JobManager extends Object
Facade on Quartz scheduler
Since:
8.7.4
Author:
Marco Meschieri - LogicalDOC
  • Field Details

  • Constructor Details

    • JobManager

      public JobManager()
  • Method Details

    • schedule

      public void schedule(AbstractJob job, Map<String,Object> dictionary, Object... triggers) throws org.quartz.SchedulerException
      Schedules a new Job
      Parameters:
      job - the Job to schedule
      dictionary - map of data to assign at fire-time to the Job
      triggers - they can be a Date(instant to fire the job) or a String(cron expression)
      Throws:
      org.quartz.SchedulerException - error in the scheduler
    • schedule

      public void schedule(AbstractJob job, Map<String,Object> dictionary, Map<Object,Map<String,Object>> triggers) throws org.quartz.SchedulerException
      Schedules a new Job
      Parameters:
      job - the Job to schedule
      dictionary - map of data to assign at fire-time to the Job
      triggers - map of triggers, the key is a Date(instant to fire the job) or a String(cron expression) and the value is the map of data to pass at fire-time to the trigger
      Throws:
      org.quartz.SchedulerException - error in the scheduler
    • getMissfireInstruction

      public String getMissfireInstruction(String group)
      What policy to use in case of missfire
      Parameters:
      group - the group name
      Returns:
      JobManager.MISSFIRE_RUNNOW or JobManager.MISSFIRE_IGNORE
    • getMissfireMax

      public int getMissfireMax(String group)
      Max number of days to look in the past for missfired triggers
      Parameters:
      group - the group name
      Returns:
      max number of days
    • getGroups

      public List<String> getGroups() throws org.quartz.SchedulerException
      Retrieves all the job groups
      Returns:
      list of groups
      Throws:
      org.quartz.SchedulerException - error in the scheduler
    • getJobs

      public List<org.quartz.JobDetail> getJobs(String group, Long tenantId) throws org.quartz.SchedulerException
      Retrieves the jobs
      Parameters:
      group - name of the group or null to retrieve all the jobs
      tenantId - filter on the tenant
      Returns:
      list of job details ordered by group and name
      Throws:
      org.quartz.SchedulerException - error in the scheduler
    • getJob

      public org.quartz.JobDetail getJob(String name, String group) throws org.quartz.SchedulerException
      Throws:
      org.quartz.SchedulerException
    • getTriggersOfJob

      public List<org.quartz.Trigger> getTriggersOfJob(String name, String group) throws org.quartz.SchedulerException
      Throws:
      org.quartz.SchedulerException
    • unscheduleJob

      public void unscheduleJob(String name, String group) throws org.quartz.SchedulerException
      Throws:
      org.quartz.SchedulerException
    • unscheduleTrigger

      public void unscheduleTrigger(String name, String group) throws org.quartz.SchedulerException
      Throws:
      org.quartz.SchedulerException
    • getTriggers

      public List<org.quartz.Trigger> getTriggers(String group, Long tenantId) throws org.quartz.SchedulerException
      Retrieves the triggers
      Parameters:
      group - name of the group or null to retrieve all the triggers
      tenantId - filter on the tenant
      Returns:
      list of triggers ordered by group and name
      Throws:
      org.quartz.SchedulerException - error in the scheduler
    • getTrigger

      public org.quartz.Trigger getTrigger(String name, String group) throws org.quartz.SchedulerException
      Throws:
      org.quartz.SchedulerException
    • setScheduler

      public void setScheduler(org.quartz.Scheduler scheduler)
    • setConfig

      public void setConfig(ContextProperties config)