- com
- pcbsys
- nirvana
- client
- nSubscriptionAttributes
This class represents the attributes used for channel subscriptions. More...
Inherits com.pcbsys.nirvana.base.clientimpl.eventhandlers.nSubscriptionAttributesFriend.
Public Member Functions | |
nChannel | getChannel () |
Returns the valid nChannel object resulting from the subscription request. More... | |
String | getChannelName () |
Return the name of the channel. More... | |
long | getEID () |
Return the event id that the subscription will start from. More... | |
nBaseClientException | getException () |
If the channel subscription failed, this method will return a subclass of nBaseClientException that will detail the cause of the failure. More... | |
nEventListener | getListener () |
Return the nEventListener associated with this subscription. More... | |
String | getSelector () |
Return the selector for event event filtering on this subscription. More... | |
nSubscriptionAttributes (String name, String selector, long eid, nEventListener eventCallback) throws nIllegalArgumentException | |
Constructor for setting up the attributes for a subscription to a channel. More... | |
boolean | wasSuccessful () |
Return whether the channel has been successfully found and subscribed to. More... | |
This class represents the attributes used for channel subscriptions.
It comprises of the channel name, an optional selector, an initial event id, and the listener that will receive the callback for events consumed. This object can be used in conjunction with the nSession.subscribe method that accepts an array of nSubscriptionAttributes objects. Once the method returns from the server, the nSubscriptionAttributes objects can be validated, by checking the wasSuccessful() method. If wasSuccessful() returns true, the nChannel object can be obtained from calling nSubscriptionAttributes.getChannel(). If wasSuccessful() returns false, an exception will be found by calling nSubscriptionAttributes.getException()
com.pcbsys.nirvana.client.nSubscriptionAttributes.nSubscriptionAttributes | ( | String | name, |
String | selector, | ||
long | eid, | ||
nEventListener | eventCallback | ||
) | throws nIllegalArgumentException |
Constructor for setting up the attributes for a subscription to a channel.
name | - the full name of the channel |
selector | - an optional selector provided for event filtering |
eid | - an initial start event id |
eventCallback | - the nEventListener that will receive the callback when events are published |
nIllegalArgumentException | if the channel is null |
nChannel com.pcbsys.nirvana.client.nSubscriptionAttributes.getChannel | ( | ) |
String com.pcbsys.nirvana.client.nSubscriptionAttributes.getChannelName | ( | ) |
Return the name of the channel.
long com.pcbsys.nirvana.client.nSubscriptionAttributes.getEID | ( | ) |
Return the event id that the subscription will start from.
nBaseClientException com.pcbsys.nirvana.client.nSubscriptionAttributes.getException | ( | ) |
If the channel subscription failed, this method will return a subclass of nBaseClientException that will detail the cause of the failure.
nEventListener com.pcbsys.nirvana.client.nSubscriptionAttributes.getListener | ( | ) |
Return the nEventListener associated with this subscription.
String com.pcbsys.nirvana.client.nSubscriptionAttributes.getSelector | ( | ) |
Return the selector for event event filtering on this subscription.
boolean com.pcbsys.nirvana.client.nSubscriptionAttributes.wasSuccessful | ( | ) |
Return whether the channel has been successfully found and subscribed to.