All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.quartz.SimpleTrigger Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
/**
 * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */
package org.quartz;

/**
 * A {@link Trigger} that is used to fire a Job at a given moment in time, and optionally repeated at a specified interval.
 * 
 * @see TriggerBuilder
 * @see SimpleScheduleBuilder
 * @author James House
 * @author contributions by Lieven Govaerts of Ebitec Nv, Belgium.
 */
public interface SimpleTrigger extends Trigger {

  public static final long serialVersionUID = -3735980074222850397L;

  /**
   * 

* Instructs the {@link Scheduler} that upon a mis-fire situation, the {@link SimpleTrigger} wants to be fired now by Scheduler. *

*

* NOTE: This instruction should typically only be used for 'one-shot' (non-repeating) Triggers. If it is used on a trigger with a repeat count > 0 then it is equivalent to the instruction * {@link #MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT} * . *

*/ public static final int MISFIRE_INSTRUCTION_FIRE_NOW = 1; /** *

* Instructs the {@link Scheduler} that upon a mis-fire situation, the {@link SimpleTrigger} wants to be re-scheduled to 'now' (even if the associated {@link Calendar} excludes 'now') with the repeat count * left as-is. This does obey the Trigger end-time however, so if 'now' is after the end-time the Trigger will not fire again. *

*

* NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with (this is only an issue if you for some reason wanted to be able to tell what the original values were at some * later time). *

*/ public static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT = 2; /** *

* Instructs the {@link Scheduler} that upon a mis-fire situation, the {@link SimpleTrigger} wants to be re-scheduled to 'now' (even if the associated {@link Calendar} excludes 'now') with the repeat count set * to what it would be, if it had not missed any firings. This does obey the Trigger end-time however, so if 'now' is after the end-time the Trigger will not fire again. *

*

* NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with. Instead, the repeat count on the trigger will be changed to whatever the remaining repeat count is (this is * only an issue if you for some reason wanted to be able to tell what the original values were at some later time). *

*

* NOTE: This instruction could cause the Trigger to go to the 'COMPLETE' state after firing 'now', if all the repeat-fire-times where missed. *

*/ public static final int MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT = 3; /** *

* Instructs the {@link Scheduler} that upon a mis-fire situation, the {@link SimpleTrigger} wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated * {@link Calendar}, and with the repeat count set to what it would be, if it had not missed any firings. *

*

* NOTE/WARNING: This instruction could cause the Trigger to go directly to the 'COMPLETE' state if all fire-times where missed. *

*/ public static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT = 4; /** *

* Instructs the {@link Scheduler} that upon a mis-fire situation, the {@link SimpleTrigger} wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated * {@link Calendar}, and with the repeat count left unchanged. *

*

* NOTE/WARNING: This instruction could cause the Trigger to go directly to the 'COMPLETE' state if the end-time of the trigger has arrived. *

*/ public static final int MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT = 5; /** *

* Used to indicate the 'repeat count' of the trigger is indefinite. Or in other words, the trigger should repeat continually until the trigger's ending timestamp. *

*/ public static final int REPEAT_INDEFINITELY = -1; /** *

* Get the the number of times the SimpleTrigger should repeat, after which it will be automatically deleted. *

* * @see #REPEAT_INDEFINITELY */ public int getRepeatCount(); /** *

* Get the the time interval (in milliseconds) at which the SimpleTrigger should repeat. *

*/ public long getRepeatInterval(); /** *

* Get the number of times the SimpleTrigger has already fired. *

*/ public int getTimesTriggered(); @Override TriggerBuilder getTriggerBuilder(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy