Class DataExchangeServerBasedConverter

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, Serializable

    public class DataExchangeServerBasedConverter
    extends AbstractConverter
    Instead of sending potentially large payloads via a RabbitMQ, this meta-converter loads the actual payload from the the specified data exchange server using the token received via RabbitMQ.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_UseFlowContextConnection

        protected boolean m_UseFlowContextConnection
        whether to use a DEX connection from the flow context.
      • m_Server

        protected adams.core.base.BaseURL m_Server
        the data exchange server to use.
      • m_Remove

        protected boolean m_Remove
        whether to delete the data after use.
      • m_ActualDownloadURL

        protected transient adams.core.base.BaseURL m_ActualDownloadURL
        the actual server URL (download).
      • m_ActualRemoveURL

        protected transient adams.core.base.BaseURL m_ActualRemoveURL
        the actual server URL (remove).
    • Constructor Detail

      • DataExchangeServerBasedConverter

        public DataExchangeServerBasedConverter()
    • 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
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractConverter
        Returns:
        null if no info available, otherwise short string
      • setConverter

        public void setConverter​(AbstractConverter value)
        Sets the base converter to use.
        Parameters:
        value - the converter
      • getConverter

        public AbstractConverter getConverter()
        Returns the base converter to use.
        Returns:
        the converter
      • converterTipText

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

        public void setUseFlowContextConnection​(boolean value)
        Sets whether the data exchange server connection available through the flow context is used rather than the server/authentication defined here.
        Parameters:
        value - true if to use connection from context
      • getUseFlowContextConnection

        public boolean getUseFlowContextConnection()
        Returns whether the data exchange server connection available through the flow context is used rather than the server/authentication defined here.
        Returns:
        true if to use connection from context
      • useFlowContextConnectionTipText

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

        public void setServer​(adams.core.base.BaseURL value)
        Sets the data exchange server to use.
        Parameters:
        value - the server
      • getServer

        public adams.core.base.BaseURL getServer()
        Returns the data exchange server to use.
        Returns:
        the server
      • serverTipText

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

        public void setAuthentication​(AbstractClientAuthentication value)
        Sets the authentication to use for accessing the server.
        Parameters:
        value - the authentication
      • getAuthentication

        public AbstractClientAuthentication getAuthentication()
        Returns the authentication to use for accessing the server.
        Returns:
        the authentication
      • authenticationTipText

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

        public void setRemove​(boolean value)
        Sets whether to immediately remove the data from the server once successfully retrieved.
        Parameters:
        value - true if to remove
      • getRemove

        public boolean getRemove()
        Returns whether to immediately remove the data from the server once successfully retrieved.
        Returns:
        true if to remove
      • removeTipText

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

        public Class generates()
        Returns the class that the converter generates.
        Specified by:
        generates in class AbstractConverter
        Returns:
        the class
      • check

        public String check​(byte[] payload)
        Hook method for checks.
        Overrides:
        check in class AbstractConverter
        Parameters:
        payload - the payload to check
        Returns:
        null if sucessfully checked, otherwise error message
      • doConvert

        protected Object doConvert​(byte[] payload,
                                   adams.core.MessageCollection errors)
        Converts the payload.
        Specified by:
        doConvert in class AbstractConverter
        Parameters:
        payload - the payload
        errors - for recording errors
        Returns:
        null if failed to convert, otherwise byte array