Glossary:
com.pcbsys.nirvana.client.nSubscriptionAttributes Class Reference
This class represents the attributes used for channel subscriptions. More...
Public Member Functions | |
| nChannel | getChannel () |
| Returns the valid nChannel object resulting from the subscription request. | |
| String | getChannelName () |
| Return the name of the channel. | |
| long | getEID () |
| Return the event id that the subscription will start from. | |
| nBaseClientException | getException () |
| If the channel subscription failed, this method will return a subclass of nBaseClientException that will detail the cause of the failure. | |
| nEventListener | getListener () |
| Return the nEventListener associated with this subscription. | |
| String | getSelector () |
| Return the selector for event event filtering on this subscription. | |
| nSubscriptionAttributes (String name, String selector, long eid, nEventListener eventCallback) throws nIllegalArgumentException | |
| Constructor for setting up the attributes for a subscription to a channel. | |
| boolean | wasSuccessful () |
| Return whether the channel has been successfully found and subscribed to. | |
Detailed Description
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()
- Since:
- 6.0
Constructor & Destructor Documentation
| 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.
- Parameters:
-
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
- Exceptions:
-
nIllegalArgumentException
Member Function Documentation
| nChannel com.pcbsys.nirvana.client.nSubscriptionAttributes.getChannel | ( | ) |
| String com.pcbsys.nirvana.client.nSubscriptionAttributes.getChannelName | ( | ) |
Return the name of the channel.
- Returns:
- channel name
| long com.pcbsys.nirvana.client.nSubscriptionAttributes.getEID | ( | ) |
Return the event id that the subscription will start from.
- Returns:
- the event id to start
| 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.
- Returns:
- instance of : nSecurityException, nChannelNotFoundException or nIllegalChannelMode
| nEventListener com.pcbsys.nirvana.client.nSubscriptionAttributes.getListener | ( | ) |
| String com.pcbsys.nirvana.client.nSubscriptionAttributes.getSelector | ( | ) |
Return the selector for event event filtering on this subscription.
- Returns:
- the selector string
| boolean com.pcbsys.nirvana.client.nSubscriptionAttributes.wasSuccessful | ( | ) |
Return whether the channel has been successfully found and subscribed to.
- Returns:
- true or false
