Interface Trigger

All Superinterfaces:
Browsable, Extensible, Identifiable, Operable, OsidObject, OsidRule, Subjugateable

public interface Trigger extends OsidRule, Subjugateable

A Trigger is an OsidRule that listens to events from a Controller . The ActionGroups , Scenes and Settings are executed based on the event criteria of the Trigger .

  • Method Details

    • getControllerId

      Id getControllerId()
      Gets the controller Id .
      Returns:
      the controller Id
      Compliance:
      mandatory - This method must be implemented.
    • getController

      Controller getController() throws OperationFailedException
      Gets the controller.
      Returns:
      the controller
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • turnedOn

      boolean turnedOn()
      Tests if this trigger listens to controller ON events.
      Returns:
      true if this is an ON event listener, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • turnedOff

      boolean turnedOff()
      Tests if this trigger listens to controller OFF events.
      Returns:
      true if this is an OFF event listener, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • changedVariableAmount

      boolean changedVariableAmount()
      Tests if this trigger listens to changed variable amount controller events.
      Returns:
      true if this is a change event listener, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • changedExceedsVariableAmount

      BigDecimal changedExceedsVariableAmount()
      Tests if this trigger listens to events where the variable amount or percentage increased to the same or above this value.
      Returns:
      the max threshold
      Compliance:
      mandatory - This method must be implemented.
    • changedDeceedsVariableAmount

      BigDecimal changedDeceedsVariableAmount()
      Tests if this trigger listens to events where the variable amount or percentage decreased to the same or below this value.
      Returns:
      the max threshold
      Compliance:
      mandatory - This method must be implemented.
    • changedDiscreetState

      boolean changedDiscreetState()
      Tests if this trigger listens to controller state changes.
      Returns:
      true if this is a state change event listener, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • changedToDiscreetState

      boolean changedToDiscreetState()
      Tests if this trigger listens to controller events where a state has changed to a specific state.
      Returns:
      true if this is a state change event, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getDiscreetStateId

      Id getDiscreetStateId()
      Gets the discreet State Id for a changed state event.
      Returns:
      the state Id
      Throws:
      IllegalStateException - changedToDiscreetState() is false
      Compliance:
      mandatory - This method must be implemented.
    • getDiscreetState

      State getDiscreetState() throws OperationFailedException
      Gets the discreet State for a changed state event.
      Returns:
      the state
      Throws:
      IllegalStateException - changedToDiscreetState() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getActionGroupIds

      IdList getActionGroupIds()
      Gets the ActionGroup Ids to execute in this trigger. Multiple action groups can be executed in the order of this list.
      Returns:
      the action group Ids
      Compliance:
      mandatory - This method must be implemented.
    • getActionGroups

      ActionGroupList getActionGroups() throws OperationFailedException
      Gets the ActionGroups to execute in this trigger. Multiple action groups can be executed in the order of this list.
      Returns:
      the action group
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getSceneIds

      IdList getSceneIds()
      Gets the Scene Ids to execute in this trigger. Multiple scenes can be executed in the order of this list. This is a shortcut to defining Actions and ActionGroups which offer more control in scene execution.
      Returns:
      the scene Ids
      Compliance:
      mandatory - This method must be implemented.
    • getScenes

      Gets the Scenes to execute in this trigger. Multiple scenes can be executed in the order of this list. This is a shortcut to defining Actions and ActionGroups which offer more control in scene execution.
      Returns:
      the action group
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getSettingIds

      IdList getSettingIds()
      Gets the Setting Ids to execute in this trigger. Multiple settings can be executed in the order of this list. This is a shortcut to defining Settings , Actions and ActionGroups which offer more control in scene and setting execution.
      Returns:
      the setting Ids
      Compliance:
      mandatory - This method must be implemented.
    • getSettings

      Gets the Settings to execute in this trigger. Multiple settings can be executed in the order of this list. This is a shortcut to defining Settings , Actions and ActionGroups which offer more control in scene and setting execution.
      Returns:
      the action group
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getTriggerRecord

      TriggerRecord getTriggerRecord(Type triggerRecordType) throws OperationFailedException
      Gets the trigger record corresponding to the given Trigger record Type .This method is used to retrieve an object implementing the requested record. The triggerRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(triggerRecordType) is true .
      Parameters:
      triggerRecordType - the type of trigger record to retrieve
      Returns:
      the trigger record
      Throws:
      NullArgumentException - triggerRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(triggerRecordType) is false
      Compliance:
      mandatory - This method must be implemented.