Class QuartzTriggerBuilder
- java.lang.Object
-
- org.silverpeas.core.scheduler.quartz.QuartzTriggerBuilder
-
- All Implemented Interfaces:
JobTriggerVisitor
public final class QuartzTriggerBuilder extends Object implements JobTriggerVisitor
A builder of a QuartzTrigger
for a given job and from aJobTrigger
instance representing a triggering rules in Silverpeas. In Quartz, a trigger is always related to a given job and a job can have one or more triggers. In Silverpeas, a trigger isn't related to a specific job and it represents only a job triggering rule that can be used to schedule one or more job; hence a job in Silverpeas is always related to one and only one trigger. The builder converts theJobTrigger
representation in Silverpeas into aTrigger
representation in Quartz for the job the trigger will be used to schedule it.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.quartz.Trigger
buildFrom(JobTrigger jobTrigger)
Builds from theJobTrigger
instance aTrigger
object to be used to schedule the underlying job with a Quartz scheduler.static QuartzTriggerBuilder
forJob(String jobName)
Constructs a new QuartzTrigger
builder for the specified job name to which it will be related in the Quartz scheduler.void
visit(CronJobTrigger trigger)
Visits the specified job trigger.void
visit(FixedDateTimeJobTrigger trigger)
Visits the specified job trigger.void
visit(FixedPeriodJobTrigger trigger)
Visits the specified job trigger.
-
-
-
Method Detail
-
forJob
public static QuartzTriggerBuilder forJob(String jobName)
Constructs a new QuartzTrigger
builder for the specified job name to which it will be related in the Quartz scheduler.- Parameters:
jobName
- the name of a job to schedule.- Returns:
- a
QuartzTriggerBuilder
instance.
-
buildFrom
public org.quartz.Trigger buildFrom(JobTrigger jobTrigger)
Builds from theJobTrigger
instance aTrigger
object to be used to schedule the underlying job with a Quartz scheduler.- Parameters:
jobTrigger
- theJobTrigger
to convert.- Returns:
- a
Trigger
object.
-
visit
public void visit(FixedPeriodJobTrigger trigger)
Description copied from interface:JobTriggerVisitor
Visits the specified job trigger.- Specified by:
visit
in interfaceJobTriggerVisitor
- Parameters:
trigger
- the FixedPeriodJobTrigger instance to visit.
-
visit
public void visit(CronJobTrigger trigger)
Description copied from interface:JobTriggerVisitor
Visits the specified job trigger.- Specified by:
visit
in interfaceJobTriggerVisitor
- Parameters:
trigger
- the SimpleCronJobTrigger instance to visit.
-
visit
public void visit(FixedDateTimeJobTrigger trigger)
Description copied from interface:JobTriggerVisitor
Visits the specified job trigger.- Specified by:
visit
in interfaceJobTriggerVisitor
- Parameters:
trigger
- the FixedDateTimeJobTrigger to visit.
-
-