Class EmbeddedPDLClient

java.lang.Object
gov.usgs.earthquake.distribution.EmbeddedPDLClient

public class EmbeddedPDLClient extends Object
An example of an embedded PDL client. Creates a notification receiver, which store it's information in a specified directory. Listeners can be added to this receiver before its startup() method is called, which starts the distribution process.
  • Field Details

    • EMBEDDED_NAME

      public static final String EMBEDDED_NAME
      name for embedded receiver, appears in log files.
      See Also:
    • EMBEDDED_TRACKING_FILE

      public static final String EMBEDDED_TRACKING_FILE
      name for eids tracking file, in data directory.
      See Also:
    • EMBEDDED_INDEX_FILE

      public static final String EMBEDDED_INDEX_FILE
      name for notification index file, in data directory.
      See Also:
    • EMBEDDED_STORAGE_DIRECTORY

      public static final String EMBEDDED_STORAGE_DIRECTORY
      name for receiver storage directory, in data directory.
      See Also:
  • Constructor Details

    • EmbeddedPDLClient

      public EmbeddedPDLClient(File dataDirectory, String serverHost, Integer serverPort, String alternateServersList) throws Exception
      Construct an embedded PDL client.
      Parameters:
      dataDirectory - directory where receiver files are stored.
      serverHost - PDL hub hostname.
      serverPort - PDL hub port.
      alternateServersList - comma separated list of "hostname:port" alternate pdl hubs.
      Throws:
      Exception - if error occurs
  • Method Details

    • getReceiver

      public EIDSNotificationReceiver getReceiver()
      Get the embedded EIDSNotificationReceiver object for further configuration, adding/removing listeners, and starting/stopping distribution.
      Returns:
      the embedded EIDSNotificationReceiver object.
    • main

      public static void main(String[] args) throws Exception
      Example main method that uses the EmbeddedPDLClient.
      Parameters:
      args - not used.
      Throws:
      Exception - if error occurs