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
- 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.WebSocketClientm_Clientthe client instance.protected booleanm_Disconnectwhether to disconnect immediately.protected adams.flow.websocket.client.WebSocketClientGeneratorm_Generatorthe 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.voidcleanUp()Cleans up data structures, frees up memory.voiddefineOptions()Adds options to the internal list of options.StringdisconnectTipText()Returns the tip text for this property.protected StringdoTransmit()Performs the actual transmission.StringgeneratorTipText()Returns the tip text for this property.booleangetDisconnect()Returns whether to immediately disconnect after sending the data.adams.flow.websocket.client.WebSocketClientGeneratorgetGenerator()Returns the client generator to useStringglobalInfo()Returns a string describing the object.voidsetDisconnect(boolean value)Sets whether to immediately disconnect after sending the data.voidsetGenerator(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin 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:
acceptsin interfaceRatOutput- Specified by:
acceptsin classAbstractRatOutput- Returns:
- the type of data
-
doTransmit
protected String doTransmit()
Performs the actual transmission.- Specified by:
doTransmitin classAbstractRatOutput- Returns:
- null if successful, otherwise error message
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler- Overrides:
cleanUpin classAbstractRatOutput
-
-