UMDS Java API  6.14
com.latencybusters.umds.UMDSPersistentReceiver Class Reference

Class to receive persisted messages by a topic or wildcard receiver. More...

Inherits com.latencybusters.umds.UMDSReceiverBase.

Public Member Functions

 UMDSPersistentReceiver (UMDSServerConnection sconn, String topic, boolean iswildcard, UMDSReceiverRecoveryInfoCallback receiverRecoveryInfoCb, Object receiverRecoveryInfoCbArg) throws UMDSException
 This constructor creates a receiver or wildcard persistent receiver object on a UMDS connection as per iswildcard param. More...
 
void onMessage (UMDSMessage msg)
 Message Delivery function. This is called to deliver messages to the application. More...
 
void onEvent (UMDSMessage msg)
 Event Notification function. This function is called when non-data events occur, E.G. Loss reported by the server. More...
 
void onRequest (UMDSMessage msg)
 Callback for request messages received. This functionality is not implemented for persistence at this time. Do not use. More...
 
final void close () throws UMDSException
 Close this receiver. More...
 
void log (int level, String comment)
 
Object getReceiverRecoveryInfoCbArg ()
 

Protected Attributes

UMDSReceiverRecoveryInfoCallback receiverRecoveryInfoCb = null
 
Object receiverRecoveryInfoCbArg = null
 
UMDSServerConnection server
 
String topic
 

Detailed Description

Class to receive persisted messages by a topic or wildcard receiver.

There are three callbacks to the user code: persistence information, non-message events, and messages. To use this class, applications typically define their own class derived from this one, providing their own onMessage() and onEvent() functions. UMDS will call those methods asynchronously as needed.

In addition, a persistence recovery information callback is available. Applications define their own callback class derived from the UMDSReceiverRecoveryInfoCallback template. When the UMDS associates a persistent Ultra Messaging source with this client receiver, it invokes the UMDSReceiverRecoveryInfoCallback::setReceiverRecoverySequenceNumber() method to give the application access to persistence information.

For more information, see Using UMDS Persistence.

Constructor & Destructor Documentation

com.latencybusters.umds.UMDSPersistentReceiver.UMDSPersistentReceiver ( UMDSServerConnection  sconn,
String  topic,
boolean  iswildcard,
UMDSReceiverRecoveryInfoCallback  receiverRecoveryInfoCb,
Object  receiverRecoveryInfoCbArg 
) throws UMDSException

This constructor creates a receiver or wildcard persistent receiver object on a UMDS connection as per iswildcard param.

Parameters
sconnThe server connection object this receiver is associated with. This explicitly ties the receiver to a server.
topicThe topic string to subscribe.
Parameters
iswildcardIndicates this receiver is a wildcard pattern
Parameters
receiverRecoveryInfoCbOptional callback object invoked by UMDS to deliver persistence information by calling the user's UMDSReceiverRecoveryInfoCallback::setReceiverRecoverySequenceNumber() implementation. If this callback is not needed, pass null.
Parameters
receiverRecoveryInfoCbArgOptional arbitrary application object that UMDS will pass to the application's receiverRecoveryInfoCb callback. If not needed, pass null.
Exceptions
UMDSException

References com.latencybusters.umds.UMDSPersistentReceiver.onMessage().

Member Function Documentation

final void com.latencybusters.umds.UMDSPersistentReceiver.close ( ) throws UMDSException

Close this receiver.

This method initiates the close operation, but UMDS will continue to deliver queued messages before the close is completed. When the receiver is fully closed, the UMDSMessage.MSG_TYPE.RECEIVER_DELETE event will be delivered to onEvent().

Exceptions
UMDSExceptionWhen the receiver could not be cleanly deleted
void com.latencybusters.umds.UMDSReceiverBase.log ( int  level,
String  comment 
)
inherited

Log a receiver related message. This API currently does nothing unique, but is provided as an aid to users deriving from the class but may in the future be updated to identify the receiver automatically.

Exceptions
UMDSExceptionthe UMDS exception
void com.latencybusters.umds.UMDSPersistentReceiver.onEvent ( UMDSMessage  msg)
void com.latencybusters.umds.UMDSPersistentReceiver.onMessage ( UMDSMessage  msg)

Message Delivery function. This is called to deliver messages to the application.

This must be overridden by applications.

Only data messages will be given to onMessage(). See onEvent() for other event types.

Parameters
msgThe message containing the received data.

References com.latencybusters.umds.UMDSMessage.length(), and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.

Referenced by com.latencybusters.umds.UMDSPersistentReceiver.UMDSPersistentReceiver().

void com.latencybusters.umds.UMDSPersistentReceiver.onRequest ( UMDSMessage  msg)

Callback for request messages received. This functionality is not implemented for persistence at this time. Do not use.

Parameters
msgThe type for request messages is REQUEST. All UMDSMessage interfaces that are valid for DATA messages are also valid for request messages. The requestID is undefined for received requests, as it is a source-side-only correlation ID.

References com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.

Member Data Documentation

UMDSServerConnection com.latencybusters.umds.UMDSReceiverBase.server
protectedinherited

The UMDS Server Connection associated with this receiver

String com.latencybusters.umds.UMDSReceiverBase.topic
protectedinherited

This receivers interested topic


The documentation for this class was generated from the following file: