com.pcbsys.nirvana.base.nChannelAttributes Class Reference

This class is a container for the attributes necessary to create/find a Nirvana channel. More...

Inherits fBaseTransportObject, and SortedObject.

Public Member Functions

String getFullName () throws IllegalStateException
 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...
 
nRealm getRealm ()
 Gets the realm this channel exists within. More...
 
int getSize ()
 Gets the object's size in bytes. More...
 
long getTTL ()
 Gets the Time To Live (TTL) value for 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 isExternal ()
 Gets the isExternal flag to find out if the channel is marked as external. More...
 
 nChannelAttributes ()
 Default constructor.
 
 nChannelAttributes (nChannelAttributes attr)
 Default constructor.
 
 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 readExternal (fEventInputStream ois) throws IOException
 Reads the object from an external Event InputStream. More...
 
void regenerateUniqueId ()
 Generates a new unique ID for this channel.
 
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 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 writeExternal (fEventOutputStream oos) throws IOException
 Writes the object to an external Event OutputStream. More...
 

Detailed Description

This class is a container for the attributes necessary to create/find a Nirvana channel.

Constructor & Destructor Documentation

com.pcbsys.nirvana.base.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_PERSISTIENT
Exceptions
nExceptionis thrown if an incorrect parameter is passed to the constructor
com.pcbsys.nirvana.base.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
nExceptionis thrown if an incorrect parameter is passed to the constructor

Member Function Documentation

String com.pcbsys.nirvana.base.nChannelAttributes.getFullName ( ) throws IllegalStateException

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

Returns
A string specifying the full name of a channel.
Exceptions
nExceptionis thrown if the name value is not set
Deprecated:
Please use getName() instead
int com.pcbsys.nirvana.base.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.base.nChannelAttributes.getName ( )

Gets the channel name.

Returns
A string specifying the name value of the channel
nRealm com.pcbsys.nirvana.base.nChannelAttributes.getRealm ( )

Gets the realm this channel exists within.

Returns
an nRealm object specifying the realm this channel exists within
Exceptions
nExceptionis thrown if a realm is not set, i.e. the channel exists within the realm you have a session to and use this object.
int com.pcbsys.nirvana.base.nChannelAttributes.getSize ( )

Gets the object's size in bytes.

Returns
An int specifying the object's size in bytes
long com.pcbsys.nirvana.base.nChannelAttributes.getTTL ( )

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

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

Gets the channel type.

Returns
An int specifying the channel type. Valid values are nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTIENT
long com.pcbsys.nirvana.base.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.base.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
void com.pcbsys.nirvana.base.nChannelAttributes.readExternal ( fEventInputStream  ois) throws IOException

Reads the object from an external Event InputStream.

Parameters
oisAn Event InputStream containing the externalised object
Exceptions
IOExceptionis thrown if in IO error occurs while reading of the stream
ClassNotFoundExceptionis thrown if the stream contains a class that can not be found in the CLASSPATH
void com.pcbsys.nirvana.base.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
nExceptionis thrown if an incorrect value is passed
void com.pcbsys.nirvana.base.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.
void com.pcbsys.nirvana.base.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.base.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
nExceptionis thrown if an invalid TTL value is specified
void com.pcbsys.nirvana.base.nChannelAttributes.setType ( int  aType) throws nIllegalArgumentException

Sets the type of channel.

Parameters
aTypeAn int specifying the channel type. Valid values are nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTIENT
Exceptions
nExceptionis thrown if an illegal channel type is specified
void com.pcbsys.nirvana.base.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.base.nChannelAttributes.writeExternal ( fEventOutputStream  oos) throws IOException

Writes the object to an external Event OutputStream.

Parameters
oosAn event outputstream containing the externalised object
Exceptions
IOExceptionis thrown if an IO error occurs while writing to the stream