Packagecom.pcbsys.nirvana.client
Classpublic class nSubscriptionAttributes
InheritancenSubscriptionAttributes Inheritance Object

Since : 6.0

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.channel. If wasSuccessful() returns false, an exception will be found by calling nSubscriptionAttributes.error



Public Properties
 PropertyDefined By
  channel : nChannel
[read-only] Returns the valid nChannel object resulting from the subscription request
nSubscriptionAttributes
  channelName : String
[read-only] Return the name of the channel
nSubscriptionAttributes
  EID : Long
[read-only] Return the event id that the subscription will start from
nSubscriptionAttributes
  error : Error
[read-only] If the channel subscription failed, this method will return a subclass of Error that will detail the cause of the failure
nSubscriptionAttributes
  listener : nEventListener
[read-only] Return the nEventListener associated with this subscription
nSubscriptionAttributes
  selector : String
[read-only] Return the selector for event event filtering on this subscription
nSubscriptionAttributes
Public Methods
 MethodDefined By
  
nSubscriptionAttributes(name:String, eid:Long, eventCallback:nEventListener, selector:String = null)
Constructor for setting up the attributes for a subscription to a channel
nSubscriptionAttributes
  
wasSuccessful():Boolean
Return whether the channel has been successfully found and subscribed to
nSubscriptionAttributes
Property Detail
channelproperty
channel:nChannel  [read-only]

Returns the valid nChannel object resulting from the subscription request


Implementation
    public function get channel():nChannel
channelNameproperty 
channelName:String  [read-only]

Return the name of the channel


Implementation
    public function get channelName():String
EIDproperty 
EID:Long  [read-only]

Return the event id that the subscription will start from


Implementation
    public function get EID():Long
errorproperty 
error:Error  [read-only]

If the channel subscription failed, this method will return a subclass of Error that will detail the cause of the failure


Implementation
    public function get error():Error
listenerproperty 
listener:nEventListener  [read-only]

Return the nEventListener associated with this subscription


Implementation
    public function get listener():nEventListener
selectorproperty 
selector:String  [read-only]

Return the selector for event event filtering on this subscription


Implementation
    public function get selector():String
Constructor Detail
nSubscriptionAttributes()Constructor
public function nSubscriptionAttributes(name:String, eid:Long, eventCallback:nEventListener, selector:String = null)

Constructor for setting up the attributes for a subscription to a channel

Parameters
name:String — - the full name of the channel
 
eid:Long — - an optional selector provided for event filtering
 
eventCallback:nEventListener — - an initial start event id
 
selector:String (default = null) — - the nEventListener that will receive the callback when events are published
Method Detail
wasSuccessful()method
public function wasSuccessful():Boolean

Return whether the channel has been successfully found and subscribed to

Returns
Boolean — true or false