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 
        data.
        default: false
     
    Version:
    $Revision$
    Author:
    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
        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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.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.
      • doTransmit

        protected String doTransmit()
        Performs the actual transmission.
        Specified by:
        doTransmit in class AbstractRatOutput
        Returns:
        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
        Overrides:
        cleanUp in class AbstractRatOutput