Table of Contents

Class SimpleScheduleBuilder

Namespace
Quartz
Assembly
Quartz.dll

SimpleScheduleBuilder is a IScheduleBuilder that defines strict/literal interval-based schedules for ITriggers.

public sealed class SimpleScheduleBuilder : IScheduleBuilder
Inheritance
SimpleScheduleBuilder
Implements
Inherited Members

Remarks

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
        .WithInterval(TimeSpan.FromHours(1))
        .RepeatForever())
    .StartAt(DateBuilder.Create().AtHourMinuteAndSecond(10, 0, 0).Build())
    .Build();
await scheduler.ScheduleJob(job, trigger);

Methods

Build()

Build the actual Trigger -- NOT intended to be invoked by end users, but will rather be invoked by a TriggerBuilder which this ScheduleBuilder is given to.

public IMutableTrigger Build()

Returns

IMutableTrigger
See Also

Create()

Create a SimpleScheduleBuilder.

public static SimpleScheduleBuilder Create()

Returns

SimpleScheduleBuilder

the new SimpleScheduleBuilder

RepeatForever()

Specify that the trigger will repeat indefinitely.

public SimpleScheduleBuilder RepeatForever()

Returns

SimpleScheduleBuilder

the updated SimpleScheduleBuilder

See Also

WithInterval(TimeSpan)

Specify the interval at which the trigger repeats.

public SimpleScheduleBuilder WithInterval(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

the time span at which the trigger should repeat.

Returns

SimpleScheduleBuilder

the updated SimpleScheduleBuilder

See Also

WithMisfireInstruction(SimpleTriggerMisfireInstruction)

Say what the trigger should do when it misses a firing.

public SimpleScheduleBuilder WithMisfireInstruction(SimpleTriggerMisfireInstruction instruction)

Parameters

instruction SimpleTriggerMisfireInstruction

the policy to apply; defaults to SmartPolicy.

Returns

SimpleScheduleBuilder

the updated SimpleScheduleBuilder

See Also

WithRepeatCount(int)

Specify a the number of time the trigger will repeat - total number of firings will be this number + 1.

public SimpleScheduleBuilder WithRepeatCount(int repeatCount)

Parameters

repeatCount int

the number of times the trigger should repeat.

Returns

SimpleScheduleBuilder

the updated SimpleScheduleBuilder

See Also

See Also