QuartzTriggerBuilder
Namespace: Quartz
Assembly: Quartz (in Quartz.dll) Version: 3.0.0
public class TriggerBuilder
The TriggerBuilder type exposes the following members.
Name | Description | |
---|---|---|
Build |
Produce the ITrigger.
| |
Create |
Create a new TriggerBuilder with which to define a
specification for a Trigger.
| |
EndAt |
Set the time at which the Trigger will no longer fire - even if it's
schedule has remaining repeats.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
ForJob(String) |
Set the identity of the Job which should be fired by the produced
Trigger - a JobKey will be produced with the given
name and default group.
| |
ForJob(IJobDetail) |
Set the identity of the Job which should be fired by the produced
Trigger, by extracting the JobKey from the given job.
| |
ForJob(JobKey) |
Set the identity of the Job which should be fired by the produced
Trigger.
| |
ForJob(String, String) |
Set the identity of the Job which should be fired by the produced
Trigger - a JobKey will be produced with the given
name and group.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ModifiedByCalendar |
Set the name of the ICalendar that should be applied to this
Trigger's schedule.
| |
StartAt |
Set the time the Trigger should start at - the trigger may or may
not fire at this time - depending upon the schedule configured for
the Trigger. However the Trigger will NOT fire before this time,
regardless of the Trigger's schedule.
| |
StartNow |
Set the time the Trigger should start at to the current moment -
the trigger may or may not fire at this time - depending upon the
schedule configured for the Trigger.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UsingJobData(JobDataMap) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Boolean) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Decimal) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Double) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Int32) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Int64) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, Single) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
UsingJobData(String, String) |
Add the given key-value pair to the Trigger's JobDataMap.
| |
WithDescription |
Set the given (human-meaningful) description of the Trigger.
| |
WithIdentity(String) |
Use a TriggerKey with the given name and default group to
identify the Trigger.
| |
WithIdentity(TriggerKey) |
Use the given TriggerKey to identify the Trigger.
| |
WithIdentity(String, String) |
Use a TriggerKey with the given name and group to
identify the Trigger.
| |
WithPriority |
Set the Trigger's priority. When more than one Trigger have the same
fire time, the scheduler will fire the one with the highest priority
first.
| |
WithSchedule |
Set the IScheduleBuilder that will be used to define the
Trigger's schedule.
|
Name | Description | |
---|---|---|
WithCalendarIntervalSchedule | Overloaded. (Defined by CalendarIntervalTriggerBuilderExtensions.) | |
WithCalendarIntervalSchedule(ActionCalendarIntervalScheduleBuilder) | Overloaded. (Defined by CalendarIntervalTriggerBuilderExtensions.) | |
WithCronSchedule(String) | Overloaded. (Defined by CronScheduleTriggerBuilderExtensions.) | |
WithCronSchedule(String, ActionCronScheduleBuilder) | Overloaded. (Defined by CronScheduleTriggerBuilderExtensions.) | |
WithDailyTimeIntervalSchedule | Overloaded. (Defined by DailyTimeIntervalTriggerBuilderExtensions.) | |
WithDailyTimeIntervalSchedule(ActionDailyTimeIntervalScheduleBuilder) | Overloaded. (Defined by DailyTimeIntervalTriggerBuilderExtensions.) | |
WithSimpleSchedule | Overloaded. (Defined by SimpleScheduleTriggerBuilderExtensions.) | |
WithSimpleSchedule(ActionSimpleScheduleBuilder) | Overloaded. (Defined by SimpleScheduleTriggerBuilderExtensions.) |
The builder will always try to keep itself in a valid state, with reasonable defaults set for calling build() at any point. For instance if you do not invoke WithSchedule(..) method, a default schedule of firing once immediately will be used. As another example, if you do not invoked WithIdentity(..) a trigger name will be generated for you.
Quartz provides a builder-style API for constructing scheduling-related entities via a Domain-Specific Language (DSL). The DSL can best be utilized through the usage of static imports of the methods on the classes TriggerBuilder, JobBuilder, DateBuilder, JobKey, TriggerKey and the various IScheduleBuilder implementations.
Client code can then use the DSL to write code such as this:
IJobDetail job = JobBuilder.Create<MyJob>() .WithIdentity("myJob") .Build(); ITrigger trigger = TriggerBuilder.Create() .WithIdentity("myTrigger", "myTriggerGroup") .WithSimpleSchedule(x => x .WithIntervalInHours(1) .RepeatForever()) .StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minute)) .Build(); scheduler.scheduleJob(job, trigger);