Class EIDSNotificationReceiver

All Implemented Interfaces:
NotificationIndexCleanup.Listener, NotificationReceiver, EIDSListener, Configurable
Direct Known Subclasses:
EIDSProductReceiver

public class EIDSNotificationReceiver extends DefaultNotificationReceiver implements EIDSListener
Receive XML notifications using EIDS. This class implements the Configurable interface, and has the following options:
serverHost
The EIDS Server hostname or IP address.
serverPort
The EIDS Server listen port, usually 39977.
alternateServers
A comma separated list of HOST:PORT pairs. The EIDSClient will attempt to connect to these servers when unable to connect to the primary serverHost:serverPort.
trackingFile
A file name used for tracking connection state. This is used to receive missed messages when (re)connecting.
  • Field Details

    • EIDS_SERVER_HOST_PROPERTY

      public static final String EIDS_SERVER_HOST_PROPERTY
      Property name for eids server host address.
      See Also:
    • EIDS_SERVER_PORT

      public static final String EIDS_SERVER_PORT
      Property name for eids server port.
      See Also:
    • EIDS_ALTERNATE_SERVERS

      public static final String EIDS_ALTERNATE_SERVERS
      Property name for eids server alternate servers list.
      See Also:
    • EIDS_TRACKING_FILE

      public static final String EIDS_TRACKING_FILE
      Property name for eids client tracking file.
      See Also:
    • EIDS_DEBUG

      public static final String EIDS_DEBUG
      Property name for eids client log level.
      See Also:
    • EIDS_MAX_EVENT_AGE

      public static final String EIDS_MAX_EVENT_AGE
      Property name for eids max server event age.
      See Also:
  • Constructor Details

    • EIDSNotificationReceiver

      public EIDSNotificationReceiver()
  • Method Details

    • onEIDSMessage

      public void onEIDSMessage(EIDSMessageEvent event)
      Implement the EIDSListener interface to process messages from EIDS. Checks to make sure message has Correct namespace and root element before parsing.
      Specified by:
      onEIDSMessage in interface EIDSListener
      Parameters:
      event - an event object representing the message that was received.
    • configure

      public void configure(Config config) throws Exception
      Description copied from class: DefaultConfigurable
      Process configuration settings. Called before startup().
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class DefaultNotificationReceiver
      Parameters:
      config - the Config object with settings.
      Throws:
      Exception - if configuration exceptions occur.
    • shutdown

      public void shutdown() throws Exception
      Description copied from class: DefaultConfigurable
      Stop any processing/background threads.
      Specified by:
      shutdown in interface Configurable
      Overrides:
      shutdown in class DefaultNotificationReceiver
      Throws:
      Exception - if exceptions occur while starting.
    • startup

      public void startup() throws Exception
      Description copied from class: DefaultConfigurable
      Start any processing/background threads.
      Specified by:
      startup in interface Configurable
      Overrides:
      startup in class DefaultNotificationReceiver
      Throws:
      Exception - if exceptions occur while starting.
    • isAlternateServersValid

      public boolean isAlternateServersValid(String alternateServers)
      Checks alternateServers configuration parameter for correct syntax - (correct) "host:port, host:port"
      Parameters:
      alternateServers - comma separated list of host:port combinations
      Returns:
      boolean
    • getClient

      public EIDSClient getClient()
      Returns:
      EIDSClient
    • setClient

      public void setClient(EIDSClient client)
      Parameters:
      client - set EIDSClient