Package adams.scripting.command.flow
Class RemoteFlowExecution
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.command.AbstractCommand
-
- adams.scripting.command.AbstractFlowAwareCommand
-
- adams.scripting.command.flow.RemoteFlowExecution
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,FlowContextHandler
,FlowAwareRemoteCommand
,RemoteCommand
,Serializable
public class RemoteFlowExecution extends AbstractFlowAwareCommand
Allows the remote execution of flows, including the transfer of storage items from the flow triggering the remote execution.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Actor
m_Actor
the instantiated flow.protected FlowFile
m_Flow
the flow to execute remotely.protected HashMap<String,Object>
m_Storage
the storage items.protected StorageName[]
m_StorageNames
the storage items to transmit.protected VariableName[]
m_VariableNames
the variables to transmit.protected HashMap<String,String>
m_Variables
the variables.-
Fields inherited from class adams.scripting.command.AbstractFlowAwareCommand
m_FlowContext
-
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
-
-
Constructor Summary
Constructors Constructor Description RemoteFlowExecution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
doHandleRequest(RemoteScriptingEngine engine, RemoteCommandProcessor processor)
Handles the request.String
flowTipText()
Returns the tip text for this property.FlowFile
getFlow()
Returns the flow to execute remotely.byte[]
getRequestPayload()
Returns the payload of the request, if any.Object[]
getRequestPayloadObjects()
Returns the objects that represent the request payload.StorageName[]
getStorageNames()
Returns the names of the storage items to transfer.VariableName[]
getVariableNames()
Returns the names of the variables to transfer.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the members.protected void
prepareRequestPayload()
Hook method for preparing the request payload,void
setActor(Actor value)
Sets the actor to use instead of loading it from disk.void
setFlow(FlowFile value)
Sets the flow to execute remotely.void
setRequestPayload(byte[] value)
Sets the payload for the request.void
setStorageNames(StorageName[] value)
Sets the names of the storage items to transfer.void
setVariableNames(VariableName[] value)
Sets the names of the variables to transfer.String
storageNamesTipText()
Returns the tip text for this property.String
variableNamesTipText()
Returns the tip text for this property.-
Methods inherited from class adams.scripting.command.AbstractFlowAwareCommand
getFlowContext, setFlowContext
-
Methods inherited from class adams.scripting.command.AbstractCommand
afterSendRequest, assembleRequest, assembleRequestHeader, beforeSendRequest, getRemoteScriptingEngineHandler, handleRequest, isRequest, parse, setRemoteScriptingEngineHandler, setRequest, toString
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
m_Flow
protected FlowFile m_Flow
the flow to execute remotely.
-
m_StorageNames
protected StorageName[] m_StorageNames
the storage items to transmit.
-
m_VariableNames
protected VariableName[] m_VariableNames
the variables to transmit.
-
m_Actor
protected Actor m_Actor
the instantiated flow.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractFlowAwareCommand
-
setFlow
public void setFlow(FlowFile value)
Sets the flow to execute remotely.- Parameters:
value
- the flow
-
getFlow
public FlowFile getFlow()
Returns the flow to execute remotely.- Returns:
- the flow
-
flowTipText
public String flowTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setStorageNames
public void setStorageNames(StorageName[] value)
Sets the names of the storage items to transfer.- Parameters:
value
- the storage names
-
getStorageNames
public StorageName[] getStorageNames()
Returns the names of the storage items to transfer.- Returns:
- the storage names
-
storageNamesTipText
public String storageNamesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setVariableNames
public void setVariableNames(VariableName[] value)
Sets the names of the variables to transfer.- Parameters:
value
- the variable names
-
getVariableNames
public VariableName[] getVariableNames()
Returns the names of the variables to transfer.- Returns:
- the variable names
-
variableNamesTipText
public String variableNamesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setActor
public void setActor(Actor value)
Sets the actor to use instead of loading it from disk.m_Flow
must point to a directory.- Parameters:
value
- the actor to use instead
-
setRequestPayload
public void setRequestPayload(byte[] value)
Sets the payload for the request.- Parameters:
value
- the payload
-
getRequestPayload
public byte[] getRequestPayload()
Returns the payload of the request, if any.- Returns:
- the payload
-
getRequestPayloadObjects
public Object[] getRequestPayloadObjects()
Returns the objects that represent the request payload.- Returns:
- the objects
-
prepareRequestPayload
protected void prepareRequestPayload()
Hook method for preparing the request payload,- Overrides:
prepareRequestPayload
in classAbstractCommand
-
doHandleRequest
protected String doHandleRequest(RemoteScriptingEngine engine, RemoteCommandProcessor processor)
Handles the request.- Specified by:
doHandleRequest
in classAbstractCommand
- Parameters:
engine
- the remote engine handling the requestprocessor
- for formatting/parsing- Returns:
- null if successful, otherwise error message
-
-