Package io.goobi.viewer.model.job.quartz
Class QuartzListener
java.lang.Object
io.goobi.viewer.model.job.quartz.QuartzListener
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContextListener
@WebListener
public class QuartzListener
extends Object
implements javax.servlet.ServletContextListener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionQuartzListener
(IDAO dao, Configuration config, MessageQueueManager messageBroker) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTrigger
(Map<String, RecurringTaskTrigger> storedTriggers, List<RecurringTaskTrigger> triggers, TaskType taskType, TaskTriggerStatus defaultStatus) void
contextDestroyed
(javax.servlet.ServletContextEvent arg0) void
contextInitialized
(javax.servlet.ServletContextEvent evt) static void
executeJobOnce
(IViewerJob goobiJob, org.quartz.Scheduler sched) execute a given IViewerJob a single timestatic org.quartz.JobDetail
initializeCronJob
(IViewerJob goobiJob, org.quartz.Scheduler sched) initializes given IViewerJob to run at specified timesstatic void
initializeDailyJob
(IViewerJob goobiJob, org.quartz.Scheduler sched) initializes given IViewerJob to run every day at midnightstatic void
initializeHourlyJob
(IViewerJob goobiJob, org.quartz.Scheduler sched, int hours) initializes given IViewerJob to run every hourstatic void
initializeMinutelyJob
(IViewerJob goobiJob, org.quartz.Scheduler sched, int minutes) initializes given IViewerJob to run every minutevoid
Restarts timed Jobs
-
Field Details
-
QUARTZ_LISTENER_CONTEXT_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
QuartzListener
- Throws:
DAOException
-
QuartzListener
-
-
Method Details
-
restartTimedJobs
public void restartTimedJobs() throws org.quartz.SchedulerExceptionRestarts timed Jobs- Throws:
org.quartz.SchedulerException
-
addTrigger
public void addTrigger(Map<String, RecurringTaskTrigger> storedTriggers, List<RecurringTaskTrigger> triggers, TaskType taskType, TaskTriggerStatus defaultStatus) throws DAOException- Throws:
DAOException
-
initializeMinutelyJob
public static void initializeMinutelyJob(IViewerJob goobiJob, org.quartz.Scheduler sched, int minutes) throws org.quartz.SchedulerException initializes given IViewerJob to run every minute- Parameters:
goobiJob
-sched
-minutes
-- Throws:
org.quartz.SchedulerException
-
initializeHourlyJob
public static void initializeHourlyJob(IViewerJob goobiJob, org.quartz.Scheduler sched, int hours) throws org.quartz.SchedulerException initializes given IViewerJob to run every hour- Parameters:
goobiJob
-sched
-hours
-- Throws:
org.quartz.SchedulerException
-
initializeDailyJob
public static void initializeDailyJob(IViewerJob goobiJob, org.quartz.Scheduler sched) throws org.quartz.SchedulerException initializes given IViewerJob to run every day at midnight- Parameters:
goobiJob
-sched
-- Throws:
org.quartz.SchedulerException
-
executeJobOnce
public static void executeJobOnce(IViewerJob goobiJob, org.quartz.Scheduler sched) throws org.quartz.SchedulerException execute a given IViewerJob a single time- Parameters:
goobiJob
-sched
-- Throws:
org.quartz.SchedulerException
-
initializeCronJob
public static org.quartz.JobDetail initializeCronJob(IViewerJob goobiJob, org.quartz.Scheduler sched) throws org.quartz.SchedulerException initializes given IViewerJob to run at specified times- Parameters:
goobiJob
-sched
-- Returns:
JobDetail
- Throws:
org.quartz.SchedulerException
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent arg0) - Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent evt) - Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-