Class WebsocketOutput
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.rats.output.AbstractRatOutput
-
- adams.flow.standalone.rats.output.WebsocketOutput
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.ShallowCopySupporter<AbstractRatOutput>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.event.VariableChangeListener
,RatOutput
,Serializable
public class WebsocketOutput extends AbstractRatOutput
Allows to send data to webservices using the supplied client.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-generator <adams.flow.websocket.client.WebSocketClientGenerator> (property: generator) The client generator to use. default: adams.flow.websocket.client.SimpleSendGenerator
-disconnect <boolean> (property: disconnect) If enabled, the connection will get closed immediately after sending the data. default: false
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.pusher.java_websocket.client.WebSocketClient
m_Client
the client instance.protected boolean
m_Disconnect
whether to disconnect immediately.protected adams.flow.websocket.client.WebSocketClientGenerator
m_Generator
the client generator.-
Fields inherited from class adams.flow.standalone.rats.output.AbstractRatOutput
m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_Input, m_LoggingPrefix, m_Owner, m_Stopped, m_VariablesUpdated
-
-
Constructor Summary
Constructors Constructor Description WebsocketOutput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the type of data that gets accepted.void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.String
disconnectTipText()
Returns the tip text for this property.protected String
doTransmit()
Performs the actual transmission.String
generatorTipText()
Returns the tip text for this property.boolean
getDisconnect()
Returns whether to immediately disconnect after sending the data.adams.flow.websocket.client.WebSocketClientGenerator
getGenerator()
Returns the client generator to useString
globalInfo()
Returns a string describing the object.void
setDisconnect(boolean value)
Sets whether to immediately disconnect after sending the data.void
setGenerator(adams.flow.websocket.client.WebSocketClientGenerator value)
Sets the client generator to use.-
Methods inherited from class adams.flow.standalone.rats.output.AbstractRatOutput
backupState, canInput, check, configureLogger, doWait, findVariables, getAdditionalInformation, getFullName, getOwner, getQueue, getQuickInfo, getVariables, handleException, initialize, initTransmission, input, isBackedUp, isStopped, pruneBackup, pruneBackup, restoreState, setOwner, setUp, shallowCopy, shallowCopy, stopExecution, transmit, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Generator
protected adams.flow.websocket.client.WebSocketClientGenerator m_Generator
the client generator.
-
m_Disconnect
protected boolean m_Disconnect
whether to disconnect immediately.
-
m_Client
protected transient com.pusher.java_websocket.client.WebSocketClient m_Client
the client instance.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setGenerator
public void setGenerator(adams.flow.websocket.client.WebSocketClientGenerator value)
Sets the client generator to use.- Parameters:
value
- the generator
-
getGenerator
public adams.flow.websocket.client.WebSocketClientGenerator getGenerator()
Returns the client generator to use- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDisconnect
public void setDisconnect(boolean value)
Sets whether to immediately disconnect after sending the data.- Parameters:
value
- true if to disconnect immediately
-
getDisconnect
public boolean getDisconnect()
Returns whether to immediately disconnect after sending the data.- Returns:
- true if to disconnect immediately
-
disconnectTipText
public String disconnectTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
accepts
public Class[] accepts()
Returns the type of data that gets accepted.- Specified by:
accepts
in interfaceRatOutput
- Specified by:
accepts
in classAbstractRatOutput
- Returns:
- the type of data
-
doTransmit
protected String doTransmit()
Performs the actual transmission.- Specified by:
doTransmit
in classAbstractRatOutput
- Returns:
- null if successful, otherwise error message
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
- Overrides:
cleanUp
in classAbstractRatOutput
-
-