com::pcbsys::nirvana::client::nChannelAttributes Class Reference

This class is a container for the attributes necessary to create or locate a Nirvana channel or queue. More...

#include <nChannelAttributes.h>

Inherits CountableObject.

Public Member Functions

int getChannelMode ()
 Returns either channel (CHANNEL_MODE) or queue (QUEUE_MODE) More...
 
std::string getFullName ()
 Gets the full name of a channel, including the realm path if set. More...
 
int getMaxEvents ()
 Gets the maximum number of events the channel can contain. More...
 
const std::string getName ()
 Gets the channel name. More...
 
nStoreProperties * getProperties ()
 Returns the nStoreProperties objec. More...
 
std::vector< ProtobufDescriptor * > getProtobufDescriptors ()
 get protobuf descriptos array More...
 
nChannelPublishKeys ** getPublishKeys (int &numKey)
 Gets the channel keys for this channel. More...
 
nRealmgetRealm ()
 Gets the realm this channel exists within. More...
 
longlong getTTL ()
 Gets the Time To Live (TTL) value that will be applied to each event contained in the channel. More...
 
int getType ()
 Gets the channel type. More...
 
longlong getUniqueId ()
 Gets the Unique ID value for the channel. More...
 
bool isClusterWide ()
 Is this channel cluster wide. More...
 
bool isExternal ()
 Gets the isExternal flag to find out if the channel is marked as external. More...
 
bool isJMSEngine ()
 Specifies whether this channel will use the JMS Style fanout engine. More...
 
bool isMergeEngine ()
 Specifies whether this channel will use the Merge and Update Style fanout engine. More...
 
 nChannelAttributes (void)
 Default constructor.
 
 nChannelAttributes (nBaseChannelAttributes *pAttr)
 Constructs from the base attribute class. More...
 
 nChannelAttributes (std::string name)
 Constructs from the name of the channel, useful when finding existing channels. More...
 
 nChannelAttributes (std::string name, int maxEvents, longlong ttl, int type, nRealm *pRealm=NULL)
 Constructs a nChannelAttributes object with the values specified. More...
 
void setChannelMode (int mode)
 Sets the channel mode as either a queue or a channel. More...
 
void setClusterWide (bool flag)
 Specifies whether this channel is a cluster channel, where it will exist in all member nodes within the cluster. More...
 
void setDeadEventHandler (nAbstractChannel *pStore)
 Set the dead event handler store for this channel / queue. More...
 
void setMaxEvents (int value)
 Sets the maximum number of events the channel can contain. More...
 
void setName (std::string channelName)
 Set the channel name for this channel attribute object. More...
 
void setProtobufDescriptors (const std::vector< ProtobufDescriptor * > &descriptors)
 set protobuf descriptos array More...
 
void setPublishKeys (nChannelPublishKeys **ppKeys, int numKey)
 Sets the channel keys for this channel. More...
 
void setRealm (nRealm *pRealm)
 Sets the realm the channel exists within, marking the channel as external. More...
 
void setTTL (longlong value)
 Sets the Time To Live (TTL) value for each event contained in the channel. More...
 
void setType (int type)
 Sets the type of channel. More...
 
void setUniqueId (longlong id)
 Sets the Unique ID value for the channel. More...
 
void useJMSEngine (bool useJMSEngine)
 Sets whether to use the JMS style fanout engine. More...
 
void useMergeEngine (bool useMergeEngine)
 Sets whether to use the Merge fanout engine. More...
 

Static Public Attributes

static const int CHANNEL_MODE = nBaseConstants::CHAN_MODE_NORMAL
 Specifies a channel (or topic) mode for the pub/sub model.
 
static const int DICTIONARY_STAMPING_DEFAULT = nBaseConstants::DICTIONARY_STAMPING_DEFAULT
 Dictionary stamping state - DEFAULT By default the engine will fall back to the server-wide configuration setting.
 
static const int DICTIONARY_STAMPING_DISABLED = nBaseConstants::DICTIONARY_STAMPING_DISABLED
 Dictionary stamping state - DISABLED.
 
static const int DICTIONARY_STAMPING_ENABLED = nBaseConstants::DICTIONARY_STAMPING_ENABLED
 Dictionary stamping state - ENABLED.
 
static const int MIXED_TYPE = nBaseConstants::CHAN_MIXED
 Specifies a mixed (persistence and ttl set on a per event basis) channel type.
 
static const int OFF_HEAP_TYPE = nBaseConstants::CHAN_OFFHEAP
 Specifies store that uses off heap memory to store the events. More...
 
static const int PAGE_TYPE = nBaseConstants::CHAN_PAGED
 Specifies a OffHeap, File backed paged channel type.
 
static const int PERSISTENT_TYPE = nBaseConstants::CHAN_PERSISTENT
 Specifies a persistent (on disk) channel type.
 
static const int QUEUE_MODE = nBaseConstants::CHAN_MODE_QUEUE
 Specifies a queue (point 2 point) mode for the queue model.
 
static const int RELIABLE_TYPE = nBaseConstants::CHAN_RELIABLE
 Specifies a reliable (in memory but with EIDs retained) channel type.
 
static const long sAllowFullAccess = 8
 Allow everyone to do everything on the channel / queue (Use with extreme caution since it bypasses any security checks for this channel / queue )
 
static const long sAllowLastEIDAccess = 512
 Get the last known Event ID on the channel / queue.
 
static const long sAllowManageACLAccess = 2 + 1
 Allow everyone to add / remove acl entries on the channel / queue.
 
static const long sAllowNamedAccess = 2048
 Allow everyone to create a named object on this channel.
 
static const long sAllowPublishAccess = 32
 Allow everyone to write events to the channel / queue.
 
static const long sAllowPurgeAccess = 128
 Allow everyone to purge events from the channel ( Only valid on channels )
 
static const long sAllowQueuePopAccess = 1024
 Allow everyone to pop events from the queue, (Only valid on Queues)
 
static const long sAllowReadACLAccess = 4
 Allow everyone to read the ACL lists.
 
static const long sAllowSubscribeAccess = 64
 Allow everyone to subscribe to the channel ( Only valid on channels )
 
static const int SIMPLE_TYPE = nBaseConstants::CHAN_SIMPLE
 Specifies a simple (in memory, no EIDs retained) channel type.
 
static const int TRANSIENT_TYPE = nBaseConstants::CHAN_TRANSIENT
 Specifies a relay (no events are stored) channel type. More...
 

Detailed Description

This class is a container for the attributes necessary to create or locate a Nirvana channel or queue.

Constructor & Destructor Documentation

com::pcbsys::nirvana::client::nChannelAttributes::nChannelAttributes ( nBaseChannelAttributes *  pAttr)

Constructs from the base attribute class.

Parameters
attrBase class used to construct this class
com::pcbsys::nirvana::client::nChannelAttributes::nChannelAttributes ( std::string  name)

Constructs from the name of the channel, useful when finding existing channels.

Parameters
nameof the channel and uses defaults for the other parameters
Exceptions
nIllegalArgumentExceptionthrown if an name is illegal
com::pcbsys::nirvana::client::nChannelAttributes::nChannelAttributes ( std::string  name,
int  maxEvents,
longlong  ttl,
int  type,
nRealm pRealm = NULL 
)

Constructs a nChannelAttributes object with the values specified.

Parameters
nameA string specifying the channel name
maxEventsAn int specifying the maximum number of events this channel can contain (i.e. the capacity)
ttlAn int specifying the Time To Live (TTL) for events published in this channel (i.e. the age)
typeAn int specifying the channel type. Valid values are nBaseConstants.CHAN_RELIABLE or nBaseConstants.CHAN_PERSISTENT
*pRealmA nRealm object specifying the realm this channel exists within
Exceptions
nIllegalArgumentExceptionis thrown if an incorrect parameter is passed to the constructor

Member Function Documentation

int com::pcbsys::nirvana::client::nChannelAttributes::getChannelMode ( )

Returns either channel (CHANNEL_MODE) or queue (QUEUE_MODE)

Returns
the channel mode specified in this channel attributes
std::string com::pcbsys::nirvana::client::nChannelAttributes::getFullName ( )

Gets the full name of a channel, including the realm path if set.

Returns
A string specifying the full name of a channel.
Exceptions
nBaseClientExceptionis thrown if the name value is not set
int com::pcbsys::nirvana::client::nChannelAttributes::getMaxEvents ( )

Gets the maximum number of events the channel can contain.

(i.e. the capacity)

Returns
An int specifying the maximum number of events this channel can currently contain (i.e. the current capacity)
const std::string com::pcbsys::nirvana::client::nChannelAttributes::getName ( )

Gets the channel name.

Returns
A string specifying the name value of the channel
nStoreProperties* com::pcbsys::nirvana::client::nChannelAttributes::getProperties ( )

Returns the nStoreProperties objec.

Since
5.0
std::vector<ProtobufDescriptor*> com::pcbsys::nirvana::client::nChannelAttributes::getProtobufDescriptors ( )

get protobuf descriptos array

Returns
vector from ProtobufDescriptor* objects. User has the responsibility to free the memory allocated for each ProtobufDescriptor object
Since
9.9
nChannelPublishKeys** com::pcbsys::nirvana::client::nChannelAttributes::getPublishKeys ( int &  numKey)

Gets the channel keys for this channel.

Parameters
numKeythe number of publish keys
Returns
nChannelPublishKeys[] The currently configured publish keys for this channel
nRealm* com::pcbsys::nirvana::client::nChannelAttributes::getRealm ( )

Gets the realm this channel exists within.

Returns
an nRealm object specifying the realm this channel exists within within the realm you have a session to and use this object.
longlong com::pcbsys::nirvana::client::nChannelAttributes::getTTL ( )

Gets the Time To Live (TTL) value that will be applied to each event contained in the channel.

Returns
A long specifying the current TTL value setting for the channel
int com::pcbsys::nirvana::client::nChannelAttributes::getType ( )

Gets the channel type.

Returns
an int specifying the channel's type, which will be equal to one of :

nChanneAttributes.MIXED_TYPE
nChanneAttributes.SIMPLE_TYPE
nChanneAttributes.PERSISTENT_TYPE
nChanneAttributes.RELIABLE_TYPE
nChanneAttributes.TRANSIENT_TYPE
nChanneAttributes.PAGED_TYPE

longlong com::pcbsys::nirvana::client::nChannelAttributes::getUniqueId ( )

Gets the Unique ID value for the channel.

Returns
A long specifying the current Unique ID value for the channel
bool com::pcbsys::nirvana::client::nChannelAttributes::isClusterWide ( )

Is this channel cluster wide.

Returns
if this channel is cluster wide
bool com::pcbsys::nirvana::client::nChannelAttributes::isExternal ( )

Gets the isExternal flag to find out if the channel is marked as external.

Returns
A bool specifying whether this channel is external or not
bool com::pcbsys::nirvana::client::nChannelAttributes::isJMSEngine ( )

Specifies whether this channel will use the JMS Style fanout engine.

For more information on this, please see the version 4.0 documentation.

Returns
whether events are delivered via the JMS fanout engine.
Since
4.0
bool com::pcbsys::nirvana::client::nChannelAttributes::isMergeEngine ( )

Specifies whether this channel will use the Merge and Update Style fanout engine.

For more information on this, please see the version 5.0 documentation.

Returns
whether events are delivered via the Merge and update fanout engine.
Since
5.0
void com::pcbsys::nirvana::client::nChannelAttributes::setChannelMode ( int  mode)

Sets the channel mode as either a queue or a channel.

These are specified as :

nChannelAttributes.QUEUE_MODE & nChannelAttributes.CHANNEL_MODE

Parameters
mode- one of the supported modes, either queue or channel
Exceptions
nIllegalArgumentExceptionif the specified channel mode not one of the support modes
void com::pcbsys::nirvana::client::nChannelAttributes::setClusterWide ( bool  flag)

Specifies whether this channel is a cluster channel, where it will exist in all member nodes within the cluster.

Parameters
flagis this channel to exist across all cluster realms
void com::pcbsys::nirvana::client::nChannelAttributes::setDeadEventHandler ( nAbstractChannel pStore)

Set the dead event handler store for this channel / queue.

When events reach there ttl or the channel hits its ttl, but have not been consumed, they can be placed in a dead event store.

Setting the dead event store to be another valid channel or queue will enable this functionality and allow you to keep track of events that have died in this manner.

Parameters
*pStorethe channel or queue to be set as the dead event store
void com::pcbsys::nirvana::client::nChannelAttributes::setMaxEvents ( int  value)

Sets the maximum number of events the channel can contain.

(i.e. the capacity)

Parameters
valueAn int specifying the max number of events
Exceptions
nIllegalArgumentExceptionis thrown if an incorrect value is passed
void com::pcbsys::nirvana::client::nChannelAttributes::setName ( std::string  channelName)

Set the channel name for this channel attribute object.

If the channel begins with '/', a realm path is also created and the channel is marked as external.

Parameters
channelNameA string specifying the name of the channel for this channel attribute object.
Exceptions
nIllegalArgumentExceptionis thrown if an incorrect value is passed
void com::pcbsys::nirvana::client::nChannelAttributes::setProtobufDescriptors ( const std::vector< ProtobufDescriptor * > &  descriptors)

set protobuf descriptos array

Parameters
descriptors-Contains descriptors data.
Since
9.9
void com::pcbsys::nirvana::client::nChannelAttributes::setPublishKeys ( nChannelPublishKeys **  ppKeys,
int  numKey 
)

Sets the channel keys for this channel.

Parameters
**ppKeysAn array of nChannelPublishKeys to be assigned to this channel
numKeylength of the array
void com::pcbsys::nirvana::client::nChannelAttributes::setRealm ( nRealm pRealm)

Sets the realm the channel exists within, marking the channel as external.

If the realm is not set, it is implied that the channel exists within the realm you have a session to and use this object.

Parameters
*pRealmAn nRealm object specifying the realm the channel exists within
void com::pcbsys::nirvana::client::nChannelAttributes::setTTL ( longlong  value)

Sets the Time To Live (TTL) value for each event contained in the channel.

Parameters
valueA long specifying the new TTL value
Exceptions
nIllegalArgumentExceptionis thrown if an invalid TTL value is specified
void com::pcbsys::nirvana::client::nChannelAttributes::setType ( int  type)

Sets the type of channel.

Parameters
typeAn int specifying the channel type.
Exceptions
nIllegalArgumentExceptionis thrown if an illegal channel type is specified
void com::pcbsys::nirvana::client::nChannelAttributes::setUniqueId ( longlong  id)

Sets the Unique ID value for the channel.

Parameters
idA long specifying the new unique id value
void com::pcbsys::nirvana::client::nChannelAttributes::useJMSEngine ( bool  useJMSEngine)

Sets whether to use the JMS style fanout engine.

Parameters
useJMSEngineuse the JMS fanout engine
Since
4.0
void com::pcbsys::nirvana::client::nChannelAttributes::useMergeEngine ( bool  useMergeEngine)

Sets whether to use the Merge fanout engine.

Parameters
useMergeEngineuse the Update and Merge fanout engine
Since
5.0

Field Documentation

const int com::pcbsys::nirvana::client::nChannelAttributes::OFF_HEAP_TYPE = nBaseConstants::CHAN_OFFHEAP
static

Specifies store that uses off heap memory to store the events.

Similar to the Reliable store in that it is not file backed

Since
9.6
const int com::pcbsys::nirvana::client::nChannelAttributes::TRANSIENT_TYPE = nBaseConstants::CHAN_TRANSIENT
static

Specifies a relay (no events are stored) channel type.

Since
4.0