Package gov.usgs.earthquake.eidsutil
Class CorbaSender
java.lang.Object
gov.usgs.earthquake.eidsutil.CorbaSender
A
CorbaSender
is essentially a client-side wrapper for the
QWFeeder
IDL file specified by ISTI. This class is designed to
provide simplified CORBA interaction with a QWServer (EIDS) machine. All the
varied methods of sending messages are provided, however they are wrapped
into a single method, namely, sendMessage
. See the method
documentation for details.- Since:
- 0.0.1
-
Constructor Summary
ConstructorsConstructorDescriptionCorbaSender
(String host, String port) Initializes theCorbaSender
such that it is ready to send a message to the specifiedhost
over the specifiedport
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Cleanupprotected com.isti.quakewatch.server.qw_feeder.QWFeeder
Retrieve a QWFeeder object associated with this CorbaSender.boolean
sendMessage
(String message) Sends a data event message.boolean
sendMessage
(String message, String feederSourceHost, long feederSrcHostMsgId) Sends a data event message.boolean
sendMessage
(String domain, String type, String message) Sends a data event message.boolean
sendMessage
(String domain, String type, String name, String message) Sends a data event message.boolean
sendMessage
(String domain, String type, String message, String feederSourceHost, long feederSrcHostMsgId) Sends a data event message.boolean
sendMessage
(String domain, String type, String name, String message, String feederSourceHost, long feederSrcHostMsgId) Sends a data event message.
-
Constructor Details
-
CorbaSender
public CorbaSender(String host, String port) throws org.omg.CORBA.ORBPackage.InvalidName, org.omg.PortableServer.POAManagerPackage.AdapterInactive Initializes theCorbaSender
such that it is ready to send a message to the specifiedhost
over the specifiedport
. This uses theQWFeeder
idl specified by ISTI as the underlying feeder. After instantiating aCorbaSender
through this constructor, the instance is 100% ready to use. One downside is one cannot reuse that instance to send messages to another host; for such a feature one must instantiate a new object.- Parameters:
host
- The host machine (ip or cname) to which you want to send the messages using thisCorbaSender
.port
- The port number to send messages to on the host.- Throws:
org.omg.CORBA.ORBPackage.InvalidName
- If the RootPOA is not aware of the type of object we request from it.org.omg.PortableServer.POAManagerPackage.AdapterInactive
- If the poaManager is not active.
-
-
Method Details
-
destroy
public void destroy()Cleanup -
getFeeder
protected com.isti.quakewatch.server.qw_feeder.QWFeeder getFeeder()Retrieve a QWFeeder object associated with this CorbaSender. First checks if the object is "non_existent", and if so re-narrows the object.- Returns:
- QWFeeder object, or null if unable to narrow.
-
sendMessage
Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
message
- The data event message string.- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-
sendMessage
Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
domain
- The domain name to use.type
- The type name to use.message
- The data event message string.- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-
sendMessage
Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
domain
- The domain name to use.type
- The type name to use.name
- The event name to use.message
- The data event message string.- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-
sendMessage
Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
message
- The data event message string.feederSourceHost
- The data-source host string for the message.feederSrcHostMsgId
- the message-ID number from the data source (positive value incremented after each message).- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-
sendMessage
public boolean sendMessage(String domain, String type, String message, String feederSourceHost, long feederSrcHostMsgId) Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
domain
- The domain name to use.type
- The type name to use.message
- The data event message string.feederSourceHost
- The data-source host string for the message.feederSrcHostMsgId
- The message-ID number from the data source (positive value incremented after each message).- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-
sendMessage
public boolean sendMessage(String domain, String type, String name, String message, String feederSourceHost, long feederSrcHostMsgId) Sends a data event message. If the event data does not begin with a “DataMessage” XML element then the data will be surrounded with one. The “sendSourced...” methods are preferred because the feeder-source host name and message number are used for improved message tracking.- Parameters:
domain
- The domain name to use.type
- The type name to use.name
- The event name to use.message
- The data event message string.feederSourceHost
- The data-source host string for the message.feederSrcHostMsgId
- The message-ID number from the data source (positive value incremented after each message).- Returns:
true
after the message has been successfully stored and processed;false
if an error occurred.
-