This class represents the attributes used for channel subscriptions.
More...
#include <nSubscriptionAttributes.h>
Inherits Countable.
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
com::pcbsys::nirvana::client::nSubscriptionAttributes::nSubscriptionAttributes |
( |
const std::string & |
name, |
|
|
const std::string & |
selector, |
|
|
longlong |
eid, |
|
|
nEventListener * |
pEventCallback |
|
) |
| |
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 |
*pEventCallback | - the nEventListener that will receive the callback when events are published |
- Exceptions
-
virtual nChannel* com::pcbsys::nirvana::client::nSubscriptionAttributes::getChannel |
( |
| ) |
|
|
virtual |
Returns the valid nChannel object resulting from the subscription request.
- Returns
- an instance of nChannel corresponding to the channel subscribed to
virtual const std::string& com::pcbsys::nirvana::client::nSubscriptionAttributes::getChannelName |
( |
| ) |
|
|
virtual |
Return the name of the channel.
- Returns
- channel name
virtual longlong com::pcbsys::nirvana::client::nSubscriptionAttributes::getEID |
( |
| ) |
|
|
virtual |
Return the event id that the subscription will start from.
- Returns
- the event id to start
virtual nBaseClientException* com::pcbsys::nirvana::client::nSubscriptionAttributes::getException |
( |
| ) |
|
|
virtual |
virtual nEventListener* com::pcbsys::nirvana::client::nSubscriptionAttributes::getListener |
( |
| ) |
|
|
virtual |
Return the nEventListener associated with this subscription.
- Returns
- the callback listener
virtual const std::string& com::pcbsys::nirvana::client::nSubscriptionAttributes::getSelector |
( |
| ) |
|
|
virtual |
Return the selector for event event filtering on this subscription.
- Returns
- the selector string
virtual bool com::pcbsys::nirvana::client::nSubscriptionAttributes::wasSuccessful |
( |
| ) |
|
|
virtual |
Return whether the channel has been successfully found and subscribed to.
- Returns
- true or false