- com
- pcbsys
- nirvana
- base
- nChannelAttributes
This class is a container for the attributes necessary to create/find a Nirvana channel. More...
Inherits SortedObject, and fExternalable.
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 a given channel. 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 | 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 in milliseconds 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... | |
Protected Attributes | |
boolean | isClusterWide = false |
This flag is deprecated since 10.11, but we keep it for backward-compatibility reasons. | |
This class is a container for the attributes necessary to create/find a Nirvana channel.
com.pcbsys.nirvana.base.nChannelAttributes.nChannelAttributes | ( | String | _name, |
int | _maxEvents, | ||
long | _ttl, | ||
int | _type | ||
) | throws nIllegalArgumentException |
Constructs a nChannelAttributes object with the values specified.
_name | A string specifying the channel name |
_maxEvents | An int specifying the maximum number of events this channel can contain (i.e. the capacity) |
_ttl | A long value specifying the Time To Live (TTL) in milliseconds for events published in this channel (i.e. the age) |
_type | An int specifying the channel type. Valid values are nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTIENT |
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.
_name | A string specifying the channel name |
_maxEvents | An int specifying the maximum number of events this channel can contain (i.e. the capacity) |
_ttl | A long value specifying the Time To Live (TTL) in milliseconds for events published in this channel (i.e. the age) |
_type | An int specifying the channel type. Valid values are nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTENT |
_realm | A nRealm object specifying the realm this channel exists within |
String com.pcbsys.nirvana.base.nChannelAttributes.getFullName | ( | ) | throws IllegalStateException |
Gets the full name of a channel, including the realm path if set.
int com.pcbsys.nirvana.base.nChannelAttributes.getMaxEvents | ( | ) |
Gets the maximum number of events the channel can contain.
(i.e. the capacity)
String com.pcbsys.nirvana.base.nChannelAttributes.getName | ( | ) |
Gets the channel name.
nRealm com.pcbsys.nirvana.base.nChannelAttributes.getRealm | ( | ) |
Gets the realm this channel exists within.
int com.pcbsys.nirvana.base.nChannelAttributes.getSize | ( | ) |
Gets 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.
int com.pcbsys.nirvana.base.nChannelAttributes.getType | ( | ) |
Gets the channel type.
long com.pcbsys.nirvana.base.nChannelAttributes.getUniqueId | ( | ) |
Gets the 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.
void com.pcbsys.nirvana.base.nChannelAttributes.readExternal | ( | fEventInputStream | ois | ) | throws IOException |
Reads the object from an external Event InputStream.
ois | An Event InputStream containing the externalised object |
IOException | is thrown if in IO error occurs while reading of the stream found in the CLASSPATH |
void com.pcbsys.nirvana.base.nChannelAttributes.regenerateUniqueId | ( | ) |
Generates a new unique ID for a given channel.
When in a clustered environment, we must use the ID sent by the master. In that case, slaves do not generate their own IDs in order to avoid potential channel ID mismatches. For example, if a master is migrated from an older version and a slave is added to a cluster, we could be using two different algorithms to generate channel IDs and end up with channel ID mismatch in the cluster. To avoid that, we try to always use the channel ID sent by the master as part of the Recovery process.
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)
value | An int specifying the max number of events |
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.
channelName | A 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.
_realm | An 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 in milliseconds for each event contained in the channel.
value | A long specifying the new TTL value in milliseconds |
void com.pcbsys.nirvana.base.nChannelAttributes.setType | ( | int | aType | ) | throws nIllegalArgumentException |
Sets the type of channel.
aType | An int specifying the channel type. Valid values are nConstants.CHAN_RELIABLE or nConstants.CHAN_PERSISTIENT |
void com.pcbsys.nirvana.base.nChannelAttributes.setUniqueId | ( | long | id | ) |
Sets the Unique ID value for the channel.
id | A 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.
oos | An event outputstream containing the externalised object |
IOException | is thrown if an IO error occurs while writing to the stream |