Interface ITriggerConfigurator<TJob>
- Namespace
- Quartz
- Assembly
- Quartz.dll
Configures a trigger for a job of a known type, so that job data can be bound by naming the job's own properties.
public interface ITriggerConfigurator<TJob> : ITriggerConfigurator where TJob : IJob
Type Parameters
TJobthe type of job the trigger fires.
- Extension Methods
Methods
EndAt(DateTimeOffset?)
Set the time at which the Trigger will no longer fire - even if it's schedule has remaining repeats.
ITriggerConfigurator<TJob> EndAt(DateTimeOffset? endTimeUtc)
Parameters
endTimeUtcDateTimeOffset?the end time for the Trigger. If null, the end time is indefinite.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
The end time is inclusive: it is the last instant at which the trigger may fire, so a fire time that lands exactly on it is one the trigger fires.
- See Also
ForJob(IJobDetail)
Set the identity of the Job which should be fired by the produced Trigger, by extracting the JobKey from the given job.
ITriggerConfigurator<TJob> ForJob(IJobDetail jobDetail)
Parameters
jobDetailIJobDetailthe Job to fire.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
ForJob(JobKey)
Set the identity of the Job which should be fired by the produced Trigger.
ITriggerConfigurator<TJob> ForJob(JobKey jobKey)
Parameters
jobKeyJobKeythe identity of the Job to fire.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
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.
ITriggerConfigurator<TJob> ForJob(string jobName)
Parameters
jobNamestringthe name of the job (in default group) to fire.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
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.
ITriggerConfigurator<TJob> ForJob(string jobName, string jobGroup)
Parameters
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
StartAt(DateTimeOffset)
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.
ITriggerConfigurator<TJob> StartAt(DateTimeOffset startTimeUtc)
Parameters
startTimeUtcDateTimeOffsetthe start time for the Trigger.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
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.
ITriggerConfigurator<TJob> StartNow()
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
UsingJobData(JobDataMap)
Add the given key-value pair to the Trigger's JobDataMap.
ITriggerConfigurator<TJob> UsingJobData(JobDataMap newJobDataMap)
Parameters
newJobDataMapJobDataMap
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
UsingJobData(string, object?)
Add the given key-value pair to the Trigger's JobDataMap.
ITriggerConfigurator<TJob> UsingJobData(string key, object? value)
Parameters
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
The value is stored as given. A persistent job store can only hold what its serializer
round-trips, and AdoJobStore's StoreJobDataAsStrings mode only strings.
- See Also
UsingJobData<TValue>(Expression<Func<TJob, TValue>>, TValue)
Add a value to the Trigger's JobDataMap under the name of the job property it is meant to end up on.
ITriggerConfigurator<TJob> UsingJobData<TValue>(Expression<Func<TJob, TValue>> jobProperty, TValue value)
Parameters
jobPropertyExpression<Func<TJob, TValue>>an expression naming the job property, such as
job => job.ParametervalueTValuethe value to bind to that property
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Type Parameters
TValue
Remarks
This is how one job is given different inputs per trigger without spelling its property names: trigger data overrides job data in the map the job finally sees.
It has to be a public settable property read directly off the job - a path through another property has nowhere to land, since the job factory sets properties on the job instance itself. Properties inherited from a base job are fine. Whether the property belongs to the job this trigger actually fires can only be checked when the trigger was pointed at the job with ForJob(IJobDetail) and that job's type resolves; pointed at a key, or at a job named by a type this process cannot load, the job type only names the properties.
The value is stored in the property's own type, so an implicit widening at the call site is undone and a value that does not fit is rejected here. An enum property takes the enum's name.
The same care applies as to any other job data: a persistent job store can only hold what its
serializer round-trips, and AdoJobStore's StoreJobDataAsStrings mode only strings. Nothing beyond
enums is converted for you.
- See Also
WithCalendarName(string?)
Set the name of the ICalendar that should be applied to this Trigger's schedule.
ITriggerConfigurator<TJob> WithCalendarName(string? calendarName)
Parameters
calendarNamestringthe name of the Calendar to reference.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
WithDescription(string?)
Set the given (human-meaningful) description of the Trigger.
ITriggerConfigurator<TJob> WithDescription(string? description)
Parameters
descriptionstringthe description for the Trigger
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
WithExecutionGroup(string?)
Set the execution group for the Trigger. Execution groups allow thread limits to be configured - per node or across the cluster - so that resource-intensive jobs do not saturate all available threads.
ITriggerConfigurator<TJob> WithExecutionGroup(string? executionGroup)
Parameters
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
WithIdentity(TriggerKey)
Use the given TriggerKey to identify the Trigger.
ITriggerConfigurator<TJob> WithIdentity(TriggerKey key)
Parameters
keyTriggerKeythe TriggerKey for the Trigger to be built
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
If none of the 'withIdentity' methods are set on the TriggerBuilder, then a random, unique TriggerKey will be generated.
- See Also
WithIdentity(string)
Use a TriggerKey with the given name and default group to identify the Trigger.
ITriggerConfigurator<TJob> WithIdentity(string name)
Parameters
namestringthe name element for the Trigger's TriggerKey
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
If none of the 'withIdentity' methods are set on the TriggerBuilder, then a random, unique TriggerKey will be generated.
- See Also
WithIdentity(string, string)
Use a TriggerKey with the given name and group to identify the Trigger.
ITriggerConfigurator<TJob> WithIdentity(string name, string group)
Parameters
namestringthe name element for the Trigger's TriggerKey
groupstringthe group element for the Trigger's TriggerKey
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
If none of the 'withIdentity' methods are set on the TriggerBuilder, then a random, unique TriggerKey will be generated.
- See Also
WithPreferredNode(PreferredNode)
Pin the Trigger to a specific scheduler node, or to the node that first fires it.
ITriggerConfigurator<TJob> WithPreferredNode(PreferredNode preferredNode)
Parameters
preferredNodePreferredNodeThe pin: None to clear, Auto for automatic first-fire pinning, or For(string) to name a node.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
WithPriority(int)
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.
ITriggerConfigurator<TJob> WithPriority(int priority)
Parameters
priorityintthe priority for the Trigger
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
- See Also
WithRetryPolicy(RetryPolicy?)
Set how the scheduler re-fires this trigger when its job fails.
ITriggerConfigurator<TJob> WithRetryPolicy(RetryPolicy? retryPolicy)
Parameters
retryPolicyRetryPolicythe retry policy, or null for no retries
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
A retry never displaces the trigger's next scheduled occurrence. This is not RefireImmediately, which re-runs the job on the same thread within the same firing.
- See Also
WithSchedule(IScheduleBuilder)
Set the IScheduleBuilder that will be used to define the Trigger's schedule.
ITriggerConfigurator<TJob> WithSchedule(IScheduleBuilder scheduleBuilder)
Parameters
scheduleBuilderIScheduleBuilderthe schedule builder to use.
Returns
- ITriggerConfigurator<TJob>
the updated TriggerBuilder
Remarks
The particular IScheduleBuilder used will dictate the concrete type of Trigger that is produced by the TriggerBuilder.
Redeclared so that the chain keeps the job's type; the
WithXSchedule extension methods do the same for the same reason.
- See Also