Package com.logicaldoc.core.job

# 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 Summary

Fields
Modifier and Type
Field
Description
`static final String`
`JOB`
`static final String`
`MISSFIRE_IGNORE`
`static final String`
`MISSFIRE_RUNNOW`
`static final String`
`TENANT_ID`

## Constructor Summary

Constructors
Constructor
Description
`JobManager()`

## Method Summary

Modifier and Type
Method
Description
`List<String>`
`getGroups()`
Retrieves all the job groups
`org.quartz.JobDetail`
`getJob(String name, String group)`
`List<org.quartz.JobDetail>`
`getJobs(String group, Long tenantId)`
Retrieves the jobs
`String`
`getMissfireInstruction(String group)`
What policy to use in case of missfire
`int`
`getMissfireMax(String group)`
Max number of days to look in the past for missfired triggers
`org.quartz.Trigger`
`getTrigger(String name, String group)`
`List<org.quartz.Trigger>`
`getTriggers(String group, Long tenantId)`
Retrieves the triggers
`List<org.quartz.Trigger>`
`getTriggersOfJob(String name, String group)`
`void`
`schedule(AbstractJob job, Map<String,Object> dictionary, Object... triggers)`
Schedules a new Job
`void`
`schedule(AbstractJob job, Map<String,Object> dictionary, Map<Object,Map<String,Object>> triggers)`
Schedules a new Job
`void`
`scheduleNow(AbstractJob job, Map<String,Object> dictionary)`
Immediately runs a Job
`void`
`unscheduleJob(String name, String group)`
`void`
`unscheduleTrigger(String name, String group)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### JOB

public static final String JOB

See Also:
  - Constant Field Values

### 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

## 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

### scheduleNow

public void scheduleNow(AbstractJob job, Map<String,Object> dictionary) throws org.quartz.SchedulerException
Immediately runs a Job

Parameters:
  `job` - the Job to schedule
  `dictionary` - map of data to assign at fire-time to the Job
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`