Class 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 
        default: false
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • 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.
    • Constructor Detail

      • WebsocketOutput

        public WebsocketOutput()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setGenerator

        public void setGenerator​(adams.flow.websocket.client.WebSocketClientGenerator value)
        Sets the client generator to use.
        value - the generator
      • getGenerator

        public adams.flow.websocket.client.WebSocketClientGenerator getGenerator()
        Returns the client generator to use
        the generator
      • generatorTipText

        public String generatorTipText()
        Returns the tip text for this property.
        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.
        value - true if to disconnect immediately
      • getDisconnect

        public boolean getDisconnect()
        Returns whether to immediately disconnect after sending the data.
        true if to disconnect immediately
      • disconnectTipText

        public String disconnectTipText()
        Returns the tip text for this property.
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doTransmit

        protected String doTransmit()
        Performs the actual transmission.
        Specified by:
        doTransmit in class AbstractRatOutput
        null if successful, otherwise error message
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler
        cleanUp in class AbstractRatOutput