Package adams.scripting.command
Interface RemoteCommandWithResponse
-
- All Superinterfaces:
Destroyable,LoggingSupporter,OptionHandler,RemoteCommand,RemoteCommandWithErrorMessage,Serializable
- All Known Implementing Classes:
AbstractCommandWithResponse,AbstractFlowAwareCommandWithResponse,AbstractRemoteCommandOnFlowWithResponse,GetFlow,JobRunner,ListFlows,Ping,RestartFlow,RetrieveFile,RunRemoteFlow,SendFlowControlCommand,StartRemoteLogging,StopEngine,StopRemoteLogging,SystemInfo
public interface RemoteCommandWithResponse extends RemoteCommandWithErrorMessage
Interface for remote commands that send a response back to a host.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
-
Fields inherited from interface adams.scripting.command.RemoteCommand
KEY_COMMAND, KEY_TYPE, VALUE_REQUEST, VALUE_RESPONSE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterSendResponse(String error)Hook method after sending the response.StringassembleResponse(RemoteCommandProcessor processor)Assembles the command into a string, including any payload.voidbeforeSendResponse()Hook method before sending the response.ConnectiongetResponseConnection()Returns the connection to send the response to.byte[]getResponsePayload()Returns the payload of the response, if any.Object[]getResponsePayloadObjects()Returns the objects that represent the response payload.voidhandleResponse(RemoteScriptingEngine engine, ResponseHandler handler)Handles the response.StringresponseConnectionTipText()Returns the tip text for this property.voidsetResponseConnection(Connection value)Sets the connection to send the response to.voidsetResponsePayload(byte[] value)Sets the payload for the response.-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.scripting.command.RemoteCommand
afterSendRequest, assembleRequest, beforeSendRequest, getRemoteScriptingEngineHandler, getRequestPayload, getRequestPayloadObjects, handleRequest, isRequest, parse, setRemoteScriptingEngineHandler, setRequest, setRequestPayload
-
Methods inherited from interface adams.scripting.command.RemoteCommandWithErrorMessage
getErrorMessage, hasErrorMessage
-
-
-
-
Method Detail
-
setResponseConnection
void setResponseConnection(Connection value)
Sets the connection to send the response to.- Parameters:
value- the connection
-
getResponseConnection
Connection getResponseConnection()
Returns the connection to send the response to.- Returns:
- the connectio
-
responseConnectionTipText
String responseConnectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setResponsePayload
void setResponsePayload(byte[] value)
Sets the payload for the response.- Parameters:
value- the payload
-
getResponsePayload
byte[] getResponsePayload()
Returns the payload of the response, if any.- Returns:
- the payload
-
getResponsePayloadObjects
Object[] getResponsePayloadObjects()
Returns the objects that represent the response payload.- Returns:
- the objects
-
assembleResponse
String assembleResponse(RemoteCommandProcessor processor)
Assembles the command into a string, including any payload.- Parameters:
processor- for formatting/parsing- Returns:
- the generated string, null if failed to assemble
-
handleResponse
void handleResponse(RemoteScriptingEngine engine, ResponseHandler handler)
Handles the response.- Parameters:
engine- the remote engine handling the responsehandler- for handling the response
-
beforeSendResponse
void beforeSendResponse()
Hook method before sending the response.
-
afterSendResponse
void afterSendResponse(String error)
Hook method after sending the response.- Parameters:
error- null if successful, otherwise error message
-
-