Package com.logicaldoc.core.task
Class JobManager
- java.lang.Object
-
- com.logicaldoc.core.task.JobManager
-
public class JobManager extends Object
Facade on Quartz scheduler- Since:
- 8.7.4
- Author:
- Marco Meschieri - LogicalDOC
-
-
Field Summary
Fields Modifier and Type Field Description static String
MISSFIRE_IGNORE
static String
MISSFIRE_RUNNOW
static String
TENANT_ID
-
Constructor Summary
Constructors Constructor Description JobManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getGroups()
Retrieves all the job groupsorg.quartz.JobDetail
getJob(String name, String group)
List<org.quartz.JobDetail>
getJobs(String group, Long tenantId)
Retrieves the jobsString
getMissfireInstruction(String group)
What policy to use in case of missfireint
getMissfireMax(String group)
Max number of days to look in the past for missfired triggersorg.quartz.Trigger
getTrigger(String name, String group)
List<org.quartz.Trigger>
getTriggers(String group, Long tenantId)
Retrieves the triggersList<? extends org.quartz.Trigger>
getTriggersOfJob(String name, String group)
void
schedule(Job job, Map<String,Object> dictionary, Object... triggers)
Schedules a new Jobvoid
schedule(Job job, Map<String,Object> dictionary, Map<Object,Map<String,Object>> triggers)
Schedules a new Jobvoid
setConfig(ContextProperties config)
void
setScheduler(org.quartz.Scheduler scheduler)
void
unscheduleJob(String name, String group)
void
unscheduleTrigger(String name, String group)
-
-
-
Field Detail
-
TENANT_ID
public static final String TENANT_ID
- See Also:
- Constant Field Values
-
MISSFIRE_RUNNOW
public static final String MISSFIRE_RUNNOW
- See Also:
- Constant Field Values
-
MISSFIRE_IGNORE
public static final String MISSFIRE_IGNORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
schedule
public void schedule(Job job, Map<String,Object> dictionary, Object... triggers) throws org.quartz.SchedulerException
Schedules a new Job- Parameters:
job
- the Job to scheduledictionary
- map of data to assign at fire-time to the Jobtriggers
- 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(Job job, Map<String,Object> dictionary, Map<Object,Map<String,Object>> triggers) throws org.quartz.SchedulerException
Schedules a new Job- Parameters:
job
- the Job to scheduledictionary
- map of data to assign at fire-time to the Jobtriggers
- 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
orJobManager.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 jobstenantId
- 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<? extends 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 triggerstenantId
- 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)
-
-