Class SendRatControlCommand

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.scripting.command.RemoteCommand, adams.scripting.command.RemoteCommandOnFlow, adams.scripting.command.RemoteCommandWithErrorMessage, adams.scripting.command.RemoteCommandWithResponse, Serializable

    public class SendRatControlCommand
    extends adams.scripting.command.AbstractRemoteCommandOnFlowWithResponse
    Sends a control command for a Rat to a remote flow.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SendRatControlCommand.Command
      Enumeration of available commands.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected SendRatControlCommand.Command m_Command
      the command.
      protected String m_Rat
      the rat name.
      protected String m_Response
      the response.
      static String RESPONSE_ALREADY_PAUSED
      response: already paused.
      static String RESPONSE_ALREADY_RUNNING
      response: already running.
      static String RESPONSE_ALREADY_STOPPED
      response: already stopped.
      static String RESPONSE_NO_SUPPORTED
      response: command not supported.
      static String RESPONSE_NOT_FOUND
      response: rat not found.
      static String RESPONSE_SUCCESS
      response: success.
      • Fields inherited from class adams.scripting.command.AbstractRemoteCommandOnFlowWithResponse

        m_ID
      • Fields inherited from class adams.scripting.command.AbstractCommandWithResponse

        m_ErrorMessage, m_ResponseConnection
      • Fields inherited from class adams.scripting.command.AbstractCommand

        m_RemoteScriptingEngineHandler, m_Request
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
      • Fields inherited from interface adams.scripting.command.RemoteCommand

        KEY_COMMAND, KEY_TYPE, VALUE_REQUEST, VALUE_RESPONSE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String commandTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      SendRatControlCommand.Command getCommand()
      Returns the command to send.
      String getRat()
      Returns the full name of the Rat to send the command to.
      byte[] getRequestPayload()
      Always zero-length array.
      Object[] getRequestPayloadObjects()
      Returns the objects that represent the request payload.
      byte[] getResponsePayload()
      Returns the payload of the response, if any.
      Object[] getResponsePayloadObjects()
      Returns the objects that represent the response payload.
      String globalInfo()
      Returns a string describing the object.
      String IDTipText()
      Returns the tip text for this property.
      protected void initialize()
      Initializes the members.
      protected void prepareResponsePayload()
      Hook method for preparing the response payload,
      String ratTipText()
      Returns the tip text for this property.
      void setCommand​(SendRatControlCommand.Command value)
      Sets the command to send.
      void setRat​(String value)
      Sets the full name of the Rat to send the command to.
      void setRequestPayload​(byte[] value)
      Ignored.
      void setResponsePayload​(byte[] value)
      Sets the payload for the response.
      • Methods inherited from class adams.scripting.command.AbstractRemoteCommandOnFlowWithResponse

        getID, retrieveFlow, setID
      • Methods inherited from class adams.scripting.command.AbstractCommandWithResponse

        afterSendResponse, assembleResponse, assembleResponseHeader, beforeSendResponse, doHandleRequest, getDefaultResponseConnection, getErrorMessage, getResponseConnection, handleResponse, hasErrorMessage, parse, responseConnectionTipText, setResponseConnection, toString
      • Methods inherited from class adams.scripting.command.AbstractCommand

        afterSendRequest, assembleRequest, assembleRequestHeader, beforeSendRequest, getRemoteScriptingEngineHandler, handleRequest, isRequest, prepareRequestPayload, setRemoteScriptingEngineHandler, setRequest
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.Destroyable

        destroy
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
      • Methods inherited from interface adams.scripting.command.RemoteCommand

        afterSendRequest, assembleRequest, beforeSendRequest, getRemoteScriptingEngineHandler, handleRequest, isRequest, parse, setRemoteScriptingEngineHandler, setRequest
    • Constructor Detail

      • SendRatControlCommand

        public SendRatControlCommand()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.scripting.command.AbstractRemoteCommandOnFlowWithResponse
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.scripting.command.AbstractCommand
      • IDTipText

        public String IDTipText()
        Returns the tip text for this property.
        Specified by:
        IDTipText in interface adams.scripting.command.RemoteCommandOnFlow
        Specified by:
        IDTipText in class adams.scripting.command.AbstractRemoteCommandOnFlowWithResponse
        Returns:
        tip text for this property suitable for displaying in the gui
      • setRat

        public void setRat​(String value)
        Sets the full name of the Rat to send the command to.
        Parameters:
        value - the full name
      • getRat

        public String getRat()
        Returns the full name of the Rat to send the command to.
        Returns:
        the full name
      • ratTipText

        public String ratTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • commandTipText

        public String commandTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setRequestPayload

        public void setRequestPayload​(byte[] value)
        Ignored.
        Parameters:
        value - the payload
      • getRequestPayload

        public byte[] getRequestPayload()
        Always zero-length array.
        Returns:
        the payload
      • getRequestPayloadObjects

        public Object[] getRequestPayloadObjects()
        Returns the objects that represent the request payload.
        Returns:
        the objects
      • setResponsePayload

        public void setResponsePayload​(byte[] value)
        Sets the payload for the response.
        Parameters:
        value - the payload
      • getResponsePayload

        public byte[] getResponsePayload()
        Returns the payload of the response, if any.
        Returns:
        the payload
      • prepareResponsePayload

        protected void prepareResponsePayload()
        Hook method for preparing the response payload,
        Overrides:
        prepareResponsePayload in class adams.scripting.command.AbstractCommandWithResponse
      • getResponsePayloadObjects

        public Object[] getResponsePayloadObjects()
        Returns the objects that represent the response payload.
        Returns:
        the objects