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...

Public Member Functions

boolean equals (long aLong)
 For Internal Use Only (Supporting automatic sorting in supporting data structures.
 
int getChannelMode ()
 Returns the either channel (CHANNEL_MODE) or queue (QUEUE_MODE) More...
 
String getFullName () throws nBaseClientException
 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...
 
String getName ()
 Gets the channel name. More...
 
nStoreProperties getProperties ()
 Get method for properties in this nChannelAttributes object. More...
 
String[] getProtobufDescriptorNames ()
 For usage of protocol buffer messages on a channel. More...
 
byte[][] getProtobufDescriptorSets () throws nIllegalArgumentException
 For usage of protocol buffer messages on a channel. More...
 
nChannelPublishKeys[] getPublishKeys ()
 Gets the channel keys for this channel. More...
 
com.pcbsys.nirvana.client.nRealm getRealm ()
 Gets the realm this channel exists within. More...
 
long 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...
 
long getUniqueId ()
 Gets the Unique ID value for the channel. More...
 
boolean isAutoDelete ()
 Specifies whether this channel will be automatically deleted by the server when the client who constructed it disconnects. More...
 
boolean isClusterWide ()
 Is this channel cluster wide. More...
 
boolean isDurable ()
 Specifies if the channel is restored after a server restart. More...
 
boolean isExternal ()
 Gets the isExternal flag to find out if the channel is marked as external. More...
 
boolean isJMSEngine ()
 Specifies whether this channel will use the JMS Style fanout engine. More...
 
boolean isMergeEngine ()
 Specifies whether this channel will use the Merge and Update Style fanout engine. More...
 
boolean lessThan (Object obj)
 For Internal Use Only (Supporting automatic sorting in supporting data structures.
 
boolean lessThan (long aLong)
 For Internal Use Only (Supporting automatic sorting in supporting data structures.
 
 nChannelAttributes ()
 Default constructor.
 
 nChannelAttributes (com.pcbsys.nirvana.base.nChannelAttributes attr)
 Constructs from the base attribute class. More...
 
 nChannelAttributes (String name) throws nIllegalArgumentException
 Constructs from the name of the channel, useful when finding existing channels. More...
 
 nChannelAttributes (String _name, int _maxEvents, long _ttl, int _type) throws nIllegalArgumentException
 Constructs a nChannelAttributes object with the values specified. More...
 
 nChannelAttributes (String _name, int _maxEvents, long _ttl, int _type, nRealm _realm) throws nIllegalArgumentException
 Constructs a nChannelAttributes object with the values specified. More...
 
void setAutoDelete (boolean autoDelete)
 Sets whether the channel is automatically deleted. More...
 
void setChannelMode (int mode) throws nIllegalArgumentException
 Sets the channel mode as either a queue or a channel. More...
 
void setClusterWide (boolean flag)
 Specifies whether this channel is a cluster channel, where it will exist in all member nodes within the cluster. More...
 
void setDeadEventHandler (nAbstractChannel store)
 Set the dead event handler store for this channel / queue. More...
 
void setDeadEventHandler (nChannelAttributes store)
 Set the dead event handler store for this channel/queue. More...
 
void setDurable (boolean durable)
 Set whether the channel will be recovered after a server restart or not. More...
 
void setMaxEvents (int value) throws nIllegalArgumentException
 Sets the maximum number of events the channel can contain. More...
 
void setName (String channelName) throws nIllegalArgumentException
 Set the channel name for this channel attribute object. More...
 
void setProtobufDescriptorNames (String[] descriptorNames)
 For usage of protocol buffer messages on a channel. More...
 
void setProtobufDescriptorSets (byte[][] descriptors) throws nIllegalArgumentException
 For usage of protocol buffer messages on a channel. More...
 
void setPublishKeys (nChannelPublishKeys[] keys)
 Sets the channel keys for this channel. More...
 
void setRealm (nRealm _realm)
 Sets the realm the channel exists within, marking the channel as external. More...
 
void setTTL (long value) throws nIllegalArgumentException
 Sets the Time To Live (TTL) value for each event contained in the channel. More...
 
void setType (int aType) throws nIllegalArgumentException
 Sets the type of channel. More...
 
void setUniqueId (long id)
 Sets the Unique ID value for the channel. More...
 
void useJMSEngine (boolean useJMSEngine)
 Sets whether to use the JMS style fanout engine. More...
 
void useMergeEngine (boolean useMergeEngine)
 Sets whether to use the Merge fanout engine. More...
 

Static Public Attributes

static final int CHANNEL_MODE = com.pcbsys.nirvana.base.nConstants.CHAN_MODE_NORMAL
 Specifies a channel (or topic) mode for the pub/sub model.
 
static final int DICTIONARY_STAMPING_DEFAULT = com.pcbsys.nirvana.base.nConstants.DICTIONARY_STAMPING_DEFAULT
 Dictionary stamping state - DEFAULT By default the engine will fall back to the server-wide configuration setting.
 
static final int DICTIONARY_STAMPING_DISABLED = com.pcbsys.nirvana.base.nConstants.DICTIONARY_STAMPING_DISABLED
 Dictionary stamping state - DISABLED.
 
static final int DICTIONARY_STAMPING_ENABLED = com.pcbsys.nirvana.base.nConstants.DICTIONARY_STAMPING_ENABLED
 Dictionary stamping state - ENABLED.
 
static final int MIXED_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_MIXED
 Specifies a mixed (persistence and ttl set on a per event basis) channel type.
 
static final int OFF_HEAP_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_OFF_HEAP
 Specifies an Off Heap store, so the Server utilises memory outside of the JVM heap. More...
 
static final int PAGED_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_PAGED
 Specifies an Paged Off Heap, file backed store, so the Server utilises memory outside of the JVM heap with persistent store. More...
 
static final int PERSISTENT_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_PERSISTENT
 Specifies a persistent (on disk) channel type.
 
static final int QUEUE_MODE = com.pcbsys.nirvana.base.nConstants.CHAN_MODE_QUEUE
 Specifies a queue (point 2 point) mode for the queue model.
 
static final int RELIABLE_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_RELIABLE
 Specifies a reliable (in memory but with EIDs retained) channel type.
 
static final 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 final long sAllowLastEIDAccess = 512
 Get the last known Event ID on the channel / queue.
 
static final long sAllowManageACLAccess = 2 + 1
 Allow everyone to add / remove acl entries on the channel / queue.
 
static final long sAllowNamedAccess = 2048
 Allow everyone to create a named object on this channel.
 
static final long sAllowPublishAccess = 32
 Allow everyone to write events to the channel / queue.
 
static final long sAllowPurgeAccess = 128
 Allow everyone to purge events from the channel ( Only valid on channels )
 
static final long sAllowQueuePopAccess = 1024
 Allow everyone to pop events from the queue, (Only valid on Queues)
 
static final long sAllowReadACLAccess = 4
 Allow everyone to read the ACL lists.
 
static final long sAllowSubscribeAccess = 64
 Allow everyone to subscribe to the channel ( Only valid on channels )
 
static final int SIMPLE_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_SIMPLE
 Specifies a simple (in memory, no EIDs retained) channel type. More...
 
static final int TRANSIENT_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_TRANSIENT
 Specifies a Transient (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 ( com.pcbsys.nirvana.base.nChannelAttributes  attr)

Constructs from the base attribute class.

Parameters
attrBase class used to construct this class
com.pcbsys.nirvana.client.nChannelAttributes.nChannelAttributes ( String  name) throws nIllegalArgumentException

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 ( String  _name,
int  _maxEvents,
long  _ttl,
int  _type 
) throws nIllegalArgumentException

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 nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTENT
Exceptions
nIllegalArgumentExceptionis thrown if an incorrect parameter is passed to the constructor
com.pcbsys.nirvana.client.nChannelAttributes.nChannelAttributes ( String  _name,
int  _maxEvents,
long  _ttl,
int  _type,
nRealm  _realm 
) throws nIllegalArgumentException

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 nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTENT
_realmA 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 the either channel (CHANNEL_MODE) or queue (QUEUE_MODE)

Returns
the channel mode specified in this channel attributes
String com.pcbsys.nirvana.client.nChannelAttributes.getFullName ( ) throws nBaseClientException

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
Deprecated:
Please use getName() instead
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)
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 ( )

Get method for properties in this nChannelAttributes object.

Returns
nStoreProperties containing properties of this channel or queue.
String [] com.pcbsys.nirvana.client.nChannelAttributes.getProtobufDescriptorNames ( )

For usage of protocol buffer messages on a channel.

This returns an array of FileDescriptorNames(as String) which have been set for use with this channel. For more information about FileDescriptorNames and how to use them, please refer to the protocol buffer documentation.

byte [][] com.pcbsys.nirvana.client.nChannelAttributes.getProtobufDescriptorSets ( ) throws nIllegalArgumentException

For usage of protocol buffer messages on a channel.

This returns an array of FileDescriptorSets(as byte[]) which have been set for use with this channel. For more information about FileDescriptorSets and how to generate them, please refer to the protocol buffer documentation.

nChannelPublishKeys [] com.pcbsys.nirvana.client.nChannelAttributes.getPublishKeys ( )

Gets the channel keys for this channel.

Returns
nChannelPublishKeys[] The currently configured publish keys for this channel
com.pcbsys.nirvana.client.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.
long 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.OFF_HEAP_TYPE
nChanneAttributes.PAGED_TYPE

long 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
boolean com.pcbsys.nirvana.client.nChannelAttributes.isAutoDelete ( )

Specifies whether this channel will be automatically deleted by the server when the client who constructed it disconnects.

Returns
if this channel will be automatically deleted when the client that constructed it disconnects
Since
5.5
boolean com.pcbsys.nirvana.client.nChannelAttributes.isClusterWide ( )

Is this channel cluster wide.

Returns
if this channel is cluster wide
boolean com.pcbsys.nirvana.client.nChannelAttributes.isDurable ( )

Specifies if the channel is restored after a server restart.

If not durable then the server will not recreate them after a reload

Returns
flag indicating if this channel will be recovered after a restart or not
Since
5.5
boolean com.pcbsys.nirvana.client.nChannelAttributes.isExternal ( )

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

Returns
A boolean specifying whether this channel is external or not
boolean 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
boolean 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.setAutoDelete ( boolean  autoDelete)

Sets whether the channel is automatically deleted.

Parameters
autoDeleteflag indicating what to do on client closure
Since
5.5
void com.pcbsys.nirvana.client.nChannelAttributes.setChannelMode ( int  mode) throws nIllegalArgumentException

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 ( boolean  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  store)

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

When events reach their 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
storethe channel or queue to be set as the dead event store
void com.pcbsys.nirvana.client.nChannelAttributes.setDeadEventHandler ( nChannelAttributes  store)

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

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

Parameters
storenChannelAttributes representing the channel or queue to be set as the dead event store.
void com.pcbsys.nirvana.client.nChannelAttributes.setDurable ( boolean  durable)

Set whether the channel will be recovered after a server restart or not.

Parameters
durableflag indicating the current state
Since
5.5
void com.pcbsys.nirvana.client.nChannelAttributes.setMaxEvents ( int  value) throws nIllegalArgumentException

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 ( String  channelName) throws nIllegalArgumentException

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.setProtobufDescriptorNames ( String[]  descriptorNames)

For usage of protocol buffer messages on a channel.

This sets an array of FileDescriptorNames(as String) to be used in conjunction with FileDescriptorSets. For more information about FileDescriptorNames and how to use them, please refer to the protocol buffer documentation.

Parameters
descriptorNamesan array of strings which are the names of the file descriptors set (via setProtobufDescriptorSets).
void com.pcbsys.nirvana.client.nChannelAttributes.setProtobufDescriptorSets ( byte  descriptors[][]) throws nIllegalArgumentException

For usage of protocol buffer messages on a channel.

This sets an array of FileDescriptorSets(as byte[]) to be used in conjunction with this channel. For more information about FileDescriptorSets and how to generate them, please refer to the protocol buffer documentation.

Parameters
descriptorsan array of byte arrays which are the serialised form of the relevant FileDescriptorSets.
void com.pcbsys.nirvana.client.nChannelAttributes.setPublishKeys ( nChannelPublishKeys[]  keys)

Sets the channel keys for this channel.

Parameters
keysAn array of nChannelPublishKeys to be assigned to this channel
void com.pcbsys.nirvana.client.nChannelAttributes.setRealm ( nRealm  _realm)

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
_realmAn nRealm object specifying the realm the channel exists within
void com.pcbsys.nirvana.client.nChannelAttributes.setTTL ( long  value) throws nIllegalArgumentException

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  aType) throws nIllegalArgumentException

Sets the type of channel.

Parameters
aTypeAn int specifying the channel type.
Exceptions
nIllegalArgumentExceptionis thrown if an illegal channel type is specified
void com.pcbsys.nirvana.client.nChannelAttributes.setUniqueId ( long  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 ( boolean  useJMSEngine)

Sets whether to use the JMS style fanout engine.

Not applicable to queues.

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

Sets whether to use the Merge fanout engine.

Parameters
useMergeEngineuse the Update and Merge fanout engine
Since
5.0

Field Documentation

final int com.pcbsys.nirvana.client.nChannelAttributes.OFF_HEAP_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_OFF_HEAP
static

Specifies an Off Heap store, so the Server utilises memory outside of the JVM heap.

Since
9.6
Deprecated:
This Store type is depricated as of version 10.2 please review use cases where this is used.
final int com.pcbsys.nirvana.client.nChannelAttributes.PAGED_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_PAGED
static

Specifies an Paged Off Heap, file backed store, so the Server utilises memory outside of the JVM heap with persistent store.

Since
9.7
Deprecated:
This Store type is depricated as of version 10.2 please review use cases where this is used.
final int com.pcbsys.nirvana.client.nChannelAttributes.SIMPLE_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_SIMPLE
static

Specifies a simple (in memory, no EIDs retained) channel type.

Deprecated:
This Store type is depricated as of version 10.2 please review use cases where this is used.
final int com.pcbsys.nirvana.client.nChannelAttributes.TRANSIENT_TYPE = com.pcbsys.nirvana.base.nConstants.CHAN_TRANSIENT
static

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

Since
4.0