Package adams.scripting.command.basic
Class StartRemoteLogging
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.command.AbstractCommand
-
- adams.scripting.command.AbstractCommandWithResponse
-
- adams.scripting.command.basic.StartRemoteLogging
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,RemoteCommand
,RemoteCommandWithErrorMessage
,RemoteCommandWithResponse
,Serializable
public class StartRemoteLogging extends AbstractCommandWithResponse
Starts remote logging.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Handler
m_Handler
the handler to use.protected boolean
m_InstallListener
whether to instal a listener.protected BaseHostname
m_LoggingHost
the logging host (local machine).protected int
m_MaxFailures
the maximum number of failed send attempts to tolerate.protected String
m_Message
the message (null is successful, otherwise error message).protected int
m_TimeOut
the timeout to use.-
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
-
-
Constructor Summary
Constructors Constructor Description StartRemoteLogging()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeSendRequest()
Hook method before sending the command.void
defineOptions()
Adds options to the internal list of options.Handler
getHandler()
Returns the handler to use.boolean
getInstallListener()
Returns whether to install a listener.BaseHostname
getLoggingHost()
Returns the logging host, i.e., the host/port of the local machine to send the logging information to.int
getMaxFailures()
Returns the maximum number of failures to accept on the sending side.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.int
getTimeOut()
Returns the timeout for accepting remote data.String
globalInfo()
Returns a string describing the object.String
handlerTipText()
Returns the tip text for this property.protected void
initialize()
Initializes the members.String
installListenerTipText()
Returns the tip text for this property.String
loggingHostTipText()
Returns the tip text for this property.String
maxFailuresTipText()
Returns the tip text for this property.protected void
prepareResponsePayload()
Hook method for preparing the response payload,void
setHandler(Handler value)
Sets the handler to use.void
setInstallListener(boolean value)
Sets whether to install a listener.void
setLoggingHost(BaseHostname value)
Sets the logging host, i.e., the host/port of the local machine to send the logging information to.void
setMaxFailures(int value)
Sets the maximum number of failures to accept on the sending side.void
setRequestPayload(byte[] value)
Ignored.void
setResponsePayload(byte[] value)
Sets the payload for the response.void
setTimeOut(int value)
Sets the timeout for accepting remote data.String
timeOutTipText()
Returns the tip text for this property.-
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, 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 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, getRemoteScriptingEngineHandler, handleRequest, isRequest, setRemoteScriptingEngineHandler, setRequest
-
-
-
-
Field Detail
-
m_LoggingHost
protected BaseHostname m_LoggingHost
the logging host (local machine).
-
m_TimeOut
protected int m_TimeOut
the timeout to use.
-
m_InstallListener
protected boolean m_InstallListener
whether to instal a listener.
-
m_Handler
protected Handler m_Handler
the handler to use.
-
m_MaxFailures
protected int m_MaxFailures
the maximum number of failed send attempts to tolerate.
-
m_Message
protected String m_Message
the message (null is successful, otherwise error message).
-
-
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 classAbstractCommandWithResponse
-
setLoggingHost
public void setLoggingHost(BaseHostname value)
Sets the logging host, i.e., the host/port of the local machine to send the logging information to.- Parameters:
value
- host/port
-
getLoggingHost
public BaseHostname getLoggingHost()
Returns the logging host, i.e., the host/port of the local machine to send the logging information to.- Returns:
- host/port
-
loggingHostTipText
public String loggingHostTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTimeOut
public void setTimeOut(int value)
Sets the timeout for accepting remote data.- Parameters:
value
- timeout in msec
-
getTimeOut
public int getTimeOut()
Returns the timeout for accepting remote data.- Returns:
- timeout in msec
-
timeOutTipText
public String timeOutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInstallListener
public void setInstallListener(boolean value)
Sets whether to install a listener.- Parameters:
value
- true if to install listener
-
getInstallListener
public boolean getInstallListener()
Returns whether to install a listener.- Returns:
- true if to install listener
-
installListenerTipText
public String installListenerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHandler
public void setHandler(Handler value)
Sets the handler to use.- Parameters:
value
- handler
-
getHandler
public Handler getHandler()
Returns the handler to use.- Returns:
- handler
-
handlerTipText
public String handlerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxFailures
public void setMaxFailures(int value)
Sets the maximum number of failures to accept on the sending side.- Parameters:
value
- maximum number, less than 1 for infinite
-
getMaxFailures
public int getMaxFailures()
Returns the maximum number of failures to accept on the sending side.- Returns:
- maximum number, less than 1 for infinite
-
maxFailuresTipText
public String maxFailuresTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractCommand
-
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
-
beforeSendRequest
public void beforeSendRequest()
Hook method before sending the command.- Specified by:
beforeSendRequest
in interfaceRemoteCommand
- Overrides:
beforeSendRequest
in classAbstractCommand
-
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 classAbstractCommandWithResponse
-
getResponsePayloadObjects
public Object[] getResponsePayloadObjects()
Returns the objects that represent the response payload.- Returns:
- the objects
-
-