C# 클래스 Quartz.Impl.Triggers.DailyTimeIntervalTriggerImpl

A concrete implementation of DailyTimeIntervalTrigger that is used to fire a IJobDetail based upon daily repeating time intervals.

The trigger will fire every N (IDailyTimeIntervalTrigger.RepeatInterval ) seconds, minutes or hours (see IDailyTimeIntervalTrigger.RepeatInterval) during a given time window on specified days of the week.

For example#1, a trigger can be set to fire every 72 minutes between 8:00 and 11:00 everyday. It's fire times would be 8:00, 9:12, 10:24, then next day would repeat: 8:00, 9:12, 10:24 again.

For example#2, a trigger can be set to fire every 23 minutes between 9:20 and 16:47 Monday through Friday.

On each day, the starting fire time is reset to startTimeOfDay value, and then it will add repeatInterval value to it until the endTimeOfDay is reached. If you set daysOfWeek values, then fire time will only occur during those week days period. Again, remember this trigger will reset fire time each day with startTimeOfDay, regardless of your interval or endTimeOfDay!

The default values for fields if not set are: startTimeOfDay defaults to 00:00:00, the endTimeOfDay default to 23:59:59, and daysOfWeek is default to every day. The startTime default to current time-stamp now, while endTime has not value.

If startTime is before startTimeOfDay, then startTimeOfDay will be used and startTime has no affect. Else if startTime is after startTimeOfDay, then the first fire time for that day will be the next interval after the startTime. For example, if you set startingTimeOfDay=9am, endingTimeOfDay=11am, interval=15 mins, and startTime=9:33am, then the next fire time will be 9:45pm. Note also that if you do not set startTime value, the trigger builder will default to current time, and current time maybe before or after the startTimeOfDay! So be aware how you set your startTime.

This trigger also supports "repeatCount" feature to end the trigger fire time after a certain number of count is reached. Just as the SimpleTrigger, setting repeatCount=0 means trigger will fire once only! Setting any positive count then the trigger will repeat count + 1 times. Unlike SimpleTrigger, the default value of repeatCount of this trigger is set to REPEAT_INDEFINITELY instead of 0 though.

상속: AbstractTrigger, IDailyTimeIntervalTrigger, ICoreTrigger
파일 보기 프로젝트 열기: quartznet/quartznet 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AdvanceToNextDayOfWeekIfNecessary DateTimeOffset?
CreateCalendarTime DateTimeOffset
IsSameDay bool

공개 메소드들

메소드 설명
ComputeFirstFireTimeUtc ( ICalendar calendar ) : DateTimeOffset?

This method should not be used by the Quartz client.

Called by the scheduler at the time a ITrigger is first added to the scheduler, in order to have the ITrigger compute its first fire time, based on any associated calendar.

After this method has been called, ITrigger.GetNextFireTimeUtc should return a valid answer.

DailyTimeIntervalTriggerImpl ( ) : System

Create a IDailyTimeIntervalTrigger with no settings.

DailyTimeIntervalTriggerImpl ( string name, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System

Create a IDailyTimeIntervalTrigger that will occur at the given time, and repeat at the given interval until the given end time.

DailyTimeIntervalTriggerImpl ( string name, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System

Create a IDailyTimeIntervalTrigger that will occur immediately, and repeat at the given interval.

DailyTimeIntervalTriggerImpl ( string name, string group, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System

Create a IDailyTimeIntervalTrigger that will occur at the given time, and repeat at the given interval until the given end time.

DailyTimeIntervalTriggerImpl ( string name, string group, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System

Create a IDailyTimeIntervalTrigger that will occur immediately, and repeat at the given interval.

DailyTimeIntervalTriggerImpl ( string name, string group, string jobName, string jobGroup, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System

Create a IDailyTimeIntervalTrigger that will occur at the given time, fire the identified job and repeat at the given interval until the given end time.

GetFireTimeAfter ( DateTimeOffset afterTime ) : DateTimeOffset?

Returns the next time at which the IDailyTimeIntervalTrigger will fire, after the given time. If the trigger will not fire after the given time, will be returned.

GetMayFireAgain ( ) : bool

Determines whether or not the IDailyTimeIntervalTrigger will occur again.

GetNextFireTimeUtc ( ) : DateTimeOffset?

Returns the next time at which the ITrigger is scheduled to fire. If the trigger will not fire again, will be returned. Note that the time returned can possibly be in the past, if the time that was computed for the trigger to next fire has already arrived, but the scheduler has not yet been able to fire the trigger (which would likely be due to lack of resources e.g. threads).

The value returned is not guaranteed to be valid until after the ITrigger has been added to the scheduler.

GetPreviousFireTimeUtc ( ) : DateTimeOffset?

Returns the previous time at which the ICalendarIntervalTrigger fired. If the trigger has not yet fired, will be returned.

GetScheduleBuilder ( ) : IScheduleBuilder

Get a IScheduleBuilder that is configured to produce a schedule identical to this trigger's schedule.

SetNextFireTimeUtc ( DateTimeOffset value ) : void

Set the next time at which the IDailyTimeIntervalTrigger should fire.

This method should not be invoked by client code.

SetPreviousFireTimeUtc ( DateTimeOffset previousFireTimeUtc ) : void

Set the previous time at which the IDailyTimeIntervalTrigger fired.

This method should not be invoked by client code.

Triggered ( ICalendar calendar ) : void

Called when the scheduler has decided to 'fire' the trigger (execute the associated job), in order to give the trigger a chance to update itself for its next triggering (if any).

UpdateAfterMisfire ( ICalendar cal ) : void

Updates the ICalendarIntervalTrigger's state based on the MisfireInstruction.XXX that was selected when the IDailyTimeIntervalTrigger was created.

If the misfire instruction is set to MisfireInstruction.SmartPolicy, then the following scheme will be used:

  • The instruction will be interpreted as MisfireInstruction.DailyTimeIntervalTrigger.FireOnceNow
UpdateWithNewCalendar ( ICalendar calendar, System.TimeSpan misfireThreshold ) : void

Validate ( ) : void

Validates whether the properties of the IJobDetail are valid for submission into a IScheduler.

보호된 메소드들

메소드 설명
ValidateMisfireInstruction ( int misfireInstruction ) : bool

비공개 메소드들

메소드 설명
AdvanceToNextDayOfWeekIfNecessary ( DateTimeOffset fireTime, bool forceToAdvanceNextDay ) : DateTimeOffset?

Given fireTime time determine if it is on a valid day of week. If so, simply return it unaltered, if not, advance to the next valid week day, and set the time of day to the start time of day.

CreateCalendarTime ( DateTimeOffset dateTime ) : DateTimeOffset
IsSameDay ( DateTimeOffset d1, DateTimeOffset d2 ) : bool

메소드 상세

ComputeFirstFireTimeUtc() 공개 메소드

This method should not be used by the Quartz client.

Called by the scheduler at the time a ITrigger is first added to the scheduler, in order to have the ITrigger compute its first fire time, based on any associated calendar.

After this method has been called, ITrigger.GetNextFireTimeUtc should return a valid answer.

public ComputeFirstFireTimeUtc ( ICalendar calendar ) : DateTimeOffset?
calendar ICalendar
리턴 DateTimeOffset?

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger with no settings.
public DailyTimeIntervalTriggerImpl ( ) : System
리턴 System

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger that will occur at the given time, and repeat at the given interval until the given end time.
public DailyTimeIntervalTriggerImpl ( string name, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System
name string
startTimeUtc DateTimeOffset A set to the time for the to fire.
endTimeUtc DateTimeOffset A set to the time for the to quit repeat firing.
startTimeOfDayUtc TimeOfDay The that the repeating should begin occurring.
endTimeOfDayUtc TimeOfDay The that the repeating should stop occurring.
intervalUnit IntervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are /// , , and .
repeatInterval int The number of milliseconds to pause between the repeat firing.
리턴 System

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger that will occur immediately, and repeat at the given interval.
public DailyTimeIntervalTriggerImpl ( string name, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System
name string
startTimeOfDayUtc TimeOfDay The that the repeating should begin occurring.
endTimeOfDayUtc TimeOfDay The that the repeating should stop occurring.
intervalUnit IntervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are /// , , and .
repeatInterval int
리턴 System

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger that will occur at the given time, and repeat at the given interval until the given end time.
public DailyTimeIntervalTriggerImpl ( string name, string group, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System
name string
group string
startTimeUtc DateTimeOffset A set to the time for the to fire.
endTimeUtc DateTimeOffset A set to the time for the to quit repeat firing.
startTimeOfDayUtc TimeOfDay The that the repeating should begin occurring.
endTimeOfDayUtc TimeOfDay The that the repeating should stop occurring.
intervalUnit IntervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are /// , , and .
repeatInterval int The number of milliseconds to pause between the repeat firing.
리턴 System

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger that will occur immediately, and repeat at the given interval.
public DailyTimeIntervalTriggerImpl ( string name, string group, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System
name string
group string
startTimeOfDayUtc TimeOfDay The that the repeating should begin occurring.
endTimeOfDayUtc TimeOfDay The that the repeating should stop occurring.
intervalUnit IntervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are /// , , and .
repeatInterval int
리턴 System

DailyTimeIntervalTriggerImpl() 공개 메소드

Create a IDailyTimeIntervalTrigger that will occur at the given time, fire the identified job and repeat at the given interval until the given end time.
public DailyTimeIntervalTriggerImpl ( string name, string group, string jobName, string jobGroup, DateTimeOffset startTimeUtc, DateTimeOffset endTimeUtc, TimeOfDay startTimeOfDayUtc, TimeOfDay endTimeOfDayUtc, IntervalUnit intervalUnit, int repeatInterval ) : System
name string
group string
jobName string
jobGroup string
startTimeUtc DateTimeOffset A set to the time for the to fire.
endTimeUtc DateTimeOffset A set to the time for the to quit repeat firing.
startTimeOfDayUtc TimeOfDay The that the repeating should begin occurring.
endTimeOfDayUtc TimeOfDay The that the repeating should stop occurring.
intervalUnit IntervalUnit The repeat interval unit. The only intervals that are valid for this type of trigger are /// , , and .
repeatInterval int The number of milliseconds to pause between the repeat firing.
리턴 System

GetFireTimeAfter() 공개 메소드

Returns the next time at which the IDailyTimeIntervalTrigger will fire, after the given time. If the trigger will not fire after the given time, will be returned.
public GetFireTimeAfter ( DateTimeOffset afterTime ) : DateTimeOffset?
afterTime DateTimeOffset
리턴 DateTimeOffset?

GetMayFireAgain() 공개 메소드

Determines whether or not the IDailyTimeIntervalTrigger will occur again.
public GetMayFireAgain ( ) : bool
리턴 bool

GetNextFireTimeUtc() 공개 메소드

Returns the next time at which the ITrigger is scheduled to fire. If the trigger will not fire again, will be returned. Note that the time returned can possibly be in the past, if the time that was computed for the trigger to next fire has already arrived, but the scheduler has not yet been able to fire the trigger (which would likely be due to lack of resources e.g. threads).
The value returned is not guaranteed to be valid until after the ITrigger has been added to the scheduler.
public GetNextFireTimeUtc ( ) : DateTimeOffset?
리턴 DateTimeOffset?

GetPreviousFireTimeUtc() 공개 메소드

Returns the previous time at which the ICalendarIntervalTrigger fired. If the trigger has not yet fired, will be returned.
public GetPreviousFireTimeUtc ( ) : DateTimeOffset?
리턴 DateTimeOffset?

GetScheduleBuilder() 공개 메소드

Get a IScheduleBuilder that is configured to produce a schedule identical to this trigger's schedule.
public GetScheduleBuilder ( ) : IScheduleBuilder
리턴 IScheduleBuilder

SetNextFireTimeUtc() 공개 메소드

Set the next time at which the IDailyTimeIntervalTrigger should fire.
This method should not be invoked by client code.
public SetNextFireTimeUtc ( DateTimeOffset value ) : void
value DateTimeOffset
리턴 void

SetPreviousFireTimeUtc() 공개 메소드

Set the previous time at which the IDailyTimeIntervalTrigger fired.
This method should not be invoked by client code.
public SetPreviousFireTimeUtc ( DateTimeOffset previousFireTimeUtc ) : void
previousFireTimeUtc DateTimeOffset
리턴 void

Triggered() 공개 메소드

Called when the scheduler has decided to 'fire' the trigger (execute the associated job), in order to give the trigger a chance to update itself for its next triggering (if any).
public Triggered ( ICalendar calendar ) : void
calendar ICalendar
리턴 void

UpdateAfterMisfire() 공개 메소드

Updates the ICalendarIntervalTrigger's state based on the MisfireInstruction.XXX that was selected when the IDailyTimeIntervalTrigger was created.
If the misfire instruction is set to MisfireInstruction.SmartPolicy, then the following scheme will be used:
  • The instruction will be interpreted as MisfireInstruction.DailyTimeIntervalTrigger.FireOnceNow
public UpdateAfterMisfire ( ICalendar cal ) : void
cal ICalendar
리턴 void

UpdateWithNewCalendar() 공개 메소드

public UpdateWithNewCalendar ( ICalendar calendar, System.TimeSpan misfireThreshold ) : void
calendar ICalendar
misfireThreshold System.TimeSpan
리턴 void

Validate() 공개 메소드

Validates whether the properties of the IJobDetail are valid for submission into a IScheduler.
public Validate ( ) : void
리턴 void

ValidateMisfireInstruction() 보호된 메소드

protected ValidateMisfireInstruction ( int misfireInstruction ) : bool
misfireInstruction int
리턴 bool