Package gov.usgs.earthquake.distribution
Class EIDSNotificationReceiver
java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.distribution.DefaultNotificationReceiver
gov.usgs.earthquake.distribution.EIDSNotificationReceiver
- All Implemented Interfaces:
NotificationIndexCleanup.Listener,NotificationReceiver,EIDSListener,Configurable
- Direct Known Subclasses:
EIDSProductReceiver
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name for eids server alternate servers list.static final StringProperty name for eids client log level.static final StringProperty name for eids max server event age.static final StringProperty name for eids server host address.static final StringProperty name for eids server port.static final StringProperty name for eids client tracking file.Fields inherited from class gov.usgs.earthquake.distribution.DefaultNotificationReceiver
CONNECT_TIMEOUT_PROPERTY, DEFAULT_CONNECT_TIMEOUT, DEFAULT_PRODUCT_STORAGE_MAX_AGE, DEFAULT_READ_TIMEOUT, DEFAULT_RECEIVER_CLEANUP, EXECUTOR_LISTENER_NOTIFIER, FUTURE_LISTENER_NOTIFIER, INDEX_FILE_PROPERTY, LISTENER_NOTIFIER_PROPERTY, NOTIFICATION_INDEX_PROPERTY, PRODUCT_STORAGE_MAX_AGE_PROPERTY, PRODUCT_STORAGE_PROPERTY, READ_TIMEOUT_PROPERTY, RECEIVER_CLEANUP_PROPERTY, ROUNDROBIN_LISTENER_NOTIFIER, STORAGE_DIRECTORY_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess configuration settings.booleanisAlternateServersValid(String alternateServers) Checks alternateServers configuration parameter for correct syntax - (correct) "host:port, host:port"voidonEIDSMessage(EIDSMessageEvent event) Implement the EIDSListener interface to process messages from EIDS.voidsetClient(EIDSClient client) voidshutdown()Stop any processing/background threads.voidstartup()Start any processing/background threads.Methods inherited from class gov.usgs.earthquake.distribution.DefaultNotificationReceiver
addNotificationListener, getConnectTimeout, getListenerQueueStatus, getNotificationIndex, getNotifier, getProductStorage, getProductStorageMaxAge, getQueueStatus, getReadTimeout, getReceiverCleanupInterval, notifyListeners, onExpiredNotification, receiveNotification, removeExpiredNotifications, removeNotificationListener, retrieveProduct, sendNotifications, setConnectTimeout, setNotificationIndex, setNotifier, setProductStorage, setProductStorageMaxAge, setReadTimeout, setReceiverCleanupInterval, storeProductSource, throttleQueuesMethods inherited from class gov.usgs.util.DefaultConfigurable
getName, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gov.usgs.util.Configurable
getName, setName
-
Field Details
-
EIDS_SERVER_HOST_PROPERTY
Property name for eids server host address.- See Also:
-
EIDS_SERVER_PORT
Property name for eids server port.- See Also:
-
EIDS_ALTERNATE_SERVERS
Property name for eids server alternate servers list.- See Also:
-
EIDS_TRACKING_FILE
Property name for eids client tracking file.- See Also:
-
EIDS_DEBUG
Property name for eids client log level.- See Also:
-
EIDS_MAX_EVENT_AGE
Property name for eids max server event age.- See Also:
-
-
Constructor Details
-
EIDSNotificationReceiver
public EIDSNotificationReceiver()
-
-
Method Details
-
onEIDSMessage
Implement the EIDSListener interface to process messages from EIDS. Checks to make sure message has Correct namespace and root element before parsing.- Specified by:
onEIDSMessagein interfaceEIDSListener- Parameters:
event- an event object representing the message that was received.
-
configure
Description copied from class:DefaultConfigurableProcess configuration settings. Called before startup().- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classDefaultNotificationReceiver- Parameters:
config- the Config object with settings.- Throws:
Exception- if configuration exceptions occur.
-
shutdown
Description copied from class:DefaultConfigurableStop any processing/background threads.- Specified by:
shutdownin interfaceConfigurable- Overrides:
shutdownin classDefaultNotificationReceiver- Throws:
Exception- if exceptions occur while starting.
-
startup
Description copied from class:DefaultConfigurableStart any processing/background threads.- Specified by:
startupin interfaceConfigurable- Overrides:
startupin classDefaultNotificationReceiver- Throws:
Exception- if exceptions occur while starting.
-
isAlternateServersValid
Checks alternateServers configuration parameter for correct syntax - (correct) "host:port, host:port"- Parameters:
alternateServers- comma separated list of host:port combinations- Returns:
- boolean
-
getClient
- Returns:
- EIDSClient
-
setClient
- Parameters:
client- set EIDSClient
-