All Implemented Interfaces:
Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest, TransportRequest

public class ExecuteWatchRequest extends LegacyActionRequest
A request to execute a watch by id
  • Field Details

  • Constructor Details

    • ExecuteWatchRequest

      public ExecuteWatchRequest()
    • ExecuteWatchRequest

      public ExecuteWatchRequest(String id)
      Parameters:
      id - the id of the watch to execute
    • ExecuteWatchRequest

      public ExecuteWatchRequest(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class ActionRequest
      Throws:
      IOException
    • getId

      public String getId()
      Returns:
      The id of the watch to be executed
    • setId

      public void setId(String id)
      Sets the id of the watch to be executed
    • isIgnoreCondition

      public boolean isIgnoreCondition()
      Returns:
      Should the condition for this execution be ignored
    • setIgnoreCondition

      public void setIgnoreCondition(boolean ignoreCondition)
      Parameters:
      ignoreCondition - set if the condition for this execution be ignored
    • isRecordExecution

      public boolean isRecordExecution()
      Returns:
      Should this execution be recorded in the history index
    • setRecordExecution

      public void setRecordExecution(boolean recordExecution)
      Parameters:
      recordExecution - Sets if this execution be recorded in the history index
    • getAlternativeInput

      public Map<String,Object> getAlternativeInput()
      Returns:
      The alertnative input to use (may be null)
    • setAlternativeInput

      public void setAlternativeInput(Map<String,Object> alternativeInput)
      Parameters:
      alternativeInput - Set's the alernative input
    • setTriggerData

      public void setTriggerData(Map<String,Object> data) throws IOException
      Parameters:
      data - The data that should be associated with the trigger event.
      Throws:
      IOException
    • setTriggerEvent

      public void setTriggerEvent(TriggerEvent event) throws IOException
      Parameters:
      event - the trigger event to use
      Throws:
      IOException
    • getTriggerData

      public Map<String,Object> getTriggerData()
      Returns:
      the trigger to use
    • getWatchSource

      public BytesReference getWatchSource()
      Returns:
      the source of the watch to execute
    • getXContentType

      public org.elasticsearch.xcontent.XContentType getXContentType()
    • setWatchSource

      public void setWatchSource(BytesReference watchSource, org.elasticsearch.xcontent.XContentType xContentType)
      Parameters:
      watchSource - instead of using an existing watch use this non persisted watch
    • setWatchSource

      public void setWatchSource(WatchSourceBuilder watchSource)
      Parameters:
      watchSource - instead of using an existing watch use this non persisted watch
    • getActionModes

      public Map<String,ActionExecutionMode> getActionModes()
      Returns:
      the execution modes for the actions. These modes determine the nature of the execution of the watch actions while the watch is executing.
    • setActionMode

      public void setActionMode(String actionId, ActionExecutionMode actionMode)
      Sets the action execution mode for the give action (identified by its id).
      Parameters:
      actionId - the action id.
      actionMode - the execution mode of the action.
    • isDebug

      public boolean isDebug()
      Returns:
      whether the watch should execute in debug mode. In debug mode the execution vars will be returned as part of the watch record.
    • setDebug

      public void setDebug(boolean debug)
      Parameters:
      debug - indicates whether the watch should execute in debug mode. In debug mode the returned watch record will hold the execution vars
    • validate

      Specified by:
      validate in class ActionRequest
    • toString

      public String toString()
      Overrides:
      toString in class AbstractTransportRequest