Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api.trigger
Interface Trigger

    public interface Trigger

Triggers are managed as a kind of reusable resources in the server. A trigger can be bound with one or multiple scheduled tasks. User can fire a trigger to activate the scheduled tasks bound with it to run when the trigger is enabled.

User can create a trigger with the `createTrigger` method in `TriggerManager`.

See Also:
  `TriggerManager.createTrigger(java.lang.String, java.lang.String)`

Field Summary
`static int` | `CRONAT` The type of trigger.
`static java.lang.String` | `EVENT_NAME` The property of the event name: Trigger (value="TRIGGER_FIRE").
`static int` | `EXTERN` The type of trigger.

Method Summary
`java.lang.String` | `getDescription()` Retrieves description of a trigger.
`java.lang.String` | `getName()` Retrieves the name of a trigger.
`long` | `getPrevFireTime()` Retrieves the last fired time.
`int` | `getReferenced()` Returns referenced count, which is the count of scheduled tasks bound with the trigger.
`boolean` | `isEnable()` Returns whether the trigger is enabled.

Field Detail

### EVENT_NAME

    static final java.lang.String EVENT_NAME

  The property of the event name: Trigger (value="TRIGGER_FIRE").

  See Also:
    Constant Field Values

### CRONAT

    static final int CRONAT

  The type of trigger. For CRONAT trigger, it is fired by TriggerManager from inner.

  See Also:
    Constant Field Values

### EXTERN

    static final int EXTERN

  The type of trigger. For EXTERN trigger, it is fired by customer from outer according to customer's condition.

  See Also:
    Constant Field Values

Method Detail

### getName

    java.lang.String getName()

  Retrieves the name of a trigger.

  Trigger name is exclusive, and the trigger manager use trigger name to distinguish and manage triggers.

  Returns:
    The name of the trigger

### getDescription

    java.lang.String getDescription()

  Retrieves description of a trigger.

  The description of a trigger is to help user remember a trigger, and is not mandatory.

  Returns:
    description of a trigger, which can be `null`.

### isEnable

    boolean isEnable()

  Returns whether the trigger is enabled. An enabled trigger can be fired, and a disabled one cannot.

  Returns:
    true, if the trigger is enabled, else return false.

### getPrevFireTime

    long getPrevFireTime()

  Retrieves the last fired time.

  If the trigger has never been fired, this method will return -1L.

  Returns:
    the last fired time.

### getReferenced

    int getReferenced()

  Returns referenced count, which is the count of scheduled tasks bound with the trigger.

  Returns:
    referenced count in integer

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD