com.pcbsys.nirvana.client.nSession Class Reference

This class represents a Nirvana session, the logical connection between the client API and the Nirvana realm. More...


Public Member Functions

void addAsyncExceptionListener (nAsyncExceptionListener listener) throws nIllegalArgumentException
 Adds a new asynchronous exception listener, which will be notified when an exception occurs while performing an asynchronous operation.
void addConnectionQueueListener (nConnectionQueueListener listener, boolean hwm, boolean lwm, boolean access, boolean push, boolean block, boolean unblock) throws nIllegalArgumentException
 Adds a new connection queue listener, which will be notified when the internal outbound queue reaches defined limits, such as

Reaching high water mark Reaching low water mark Exceeding the time it should take to access the queue object Exceeding the time it should take to push an event onto the queue Exceeding the time for a queue to be blocked due to reaching its high water mark

Unless you have explicitly called nConstants.setWriteHandlerType(nConstants.sQueuedWriteHandler), and are therefore using an outbound queue, you will not receive any notifications from this listener.

void addConnectionQueueListener (nConnectionQueueListener listener) throws nIllegalArgumentException
 Adds a new connection queue listener, which will be notified when the internal outbound queue reaches defined limits, such as

Reaching high water mark Reaching low water mark Exceeding the time it should take to access the queue object Exceeding the time it should take to push an event onto the queue Exceeding the time for a queue to be blocked due to reaching its high water mark

Unless you have explicitly called nConstants.setWriteHandlerType(nConstants.sQueuedWriteHandler), and are therefore using an outbound queue, you will not receive any notifications from this listener.

void addRealm (com.pcbsys.nirvana.client.nRealm newRealm, nSession session) throws nRealmAlreadyBoundException, nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nIllegalArgumentException, nRealmNotFoundException, nUnexpectedResponseException, nSessionPausedException, nRequestTimedOutException, nNameSpaceConflictException
 Adds (Joins) another realm to the realm this session is connected to.
void addRealm (com.pcbsys.nirvana.client.nRealm newRealm) throws nRealmAlreadyBoundException, nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nIllegalArgumentException, nRealmNotFoundException, nUnexpectedResponseException, nSessionPausedException, nRequestTimedOutException, nNameSpaceConflictException
 Adds (Joins) another realm to the realm this session is connected to.
void addReconnectHandler (nReconnectHandler handler)
 Add a session reconnect handler to the session.
void close ()
 Closes this session, disconnecting from the server and killing all threads.
void commitRegisteredEventsToDataGroups (nRegisteredEvent[] events, boolean replace) throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException
 Commit all registered event changes in a single call to the server.
void commitRegisteredEventsToDataGroups (nRegisteredEvent[] events) throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException
 Commit all registered event changes in a single call to the server.
nChannel createChannel (com.pcbsys.nirvana.client.nChannelAttributes attr, long p_initialEID, long privMask) throws nUnknownRemoteRealmException, nSessionPausedException, nSecurityException, nChannelAlreadyExistsException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Creates a new channel on the realm this session is connected.
nChannel createChannel (com.pcbsys.nirvana.client.nChannelAttributes attr, long p_initialEID) throws nUnknownRemoteRealmException, nSecurityException, nChannelAlreadyExistsException, nSessionPausedException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Creates a new channel on the realm this session is connected.
nChannel createChannel (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nUnknownRemoteRealmException, nSecurityException, nChannelAlreadyExistsException, nSessionPausedException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Creates a new channel on the realm this session is connected.
nDataGroup createDataGroup (String dataGroupName, nDataGroupListener listener, nConflationAttributes conflationAttributes) throws nRequestTimedOutException, nIllegalArgumentException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Create a new data group on the server.
nDataGroup createDataGroup (String dataGroupName, nDataGroupListener listener) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Create a new data group on the server.
nDataGroup createDataGroup (String dataGroupName) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Create a new data group on the server.
nDataGroup[] createDataGroups (String[] dataGroupNames, nConflationAttributes conflationAttributes) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Create new data groups on the server if they don't exist, or return them from the local list if found.
nDataGroup[] createDataGroups (String[] dataGroupNames) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Create new data groups on the server if they don't exist, or return them from the local list if found.
nQueue createQueue (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nUnknownRemoteRealmException, nSessionPausedException, nSecurityException, nChannelAlreadyExistsException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Creates a new queue on the realm this session is connected.
nQueue createQueue (com.pcbsys.nirvana.client.nChannelAttributes attr, long privMask) throws nUnknownRemoteRealmException, nSessionPausedException, nSecurityException, nChannelAlreadyExistsException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Creates a new queue on the realm this session is connected.
void deleteChannel (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nUnknownRemoteRealmException, nSessionPausedException, nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Deletes a nirvana channel that exists on the realm this session is connected to, or a joined realm.
void deleteDataGroup (nDataGroup[] groups) throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Deletes the specified data group from the server.
void deleteDataGroup (nDataGroup group) throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Deletes the specified data group from the server.
void deleteDataGroup (String dataGroupName) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Deletes the specified data group from the server.
void deleteDataGroup (String[] dataGroupNames) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Deletes the specified data group from the server.
void deleteQueue (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nUnknownRemoteRealmException, nSessionPausedException, nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Deletes a nirvana queue that exists on the realm this session is connected to, or a joined realm.
void deleteRealm (nRealm aRealm) throws nRealmNotFoundException, nSessionPausedException, nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException, nRealmInUseException
 Deletes (unjoins) another realm from the realm this session is connected to.
synchronized void enableThreading (boolean enabled)
 Calling this function starts the internal thread pools.
synchronized void enableThreading ()
 Calling this function starts the internal thread pools.
synchronized void enableThreading (int poolSize)
 Enables thread pooling for this session.
nFindResult[] find (nChannelAttributes[] attr) throws nSessionPausedException, nUnknownRemoteRealmException, nSecurityException, nSessionNotConnectedException, nIllegalArgumentException, nUnexpectedResponseException, nRequestTimedOutException
 Finds and returns an array of nFindResult objects that correspond to the results of the find operations on each nChannelAttributes.
nChannel findChannel (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nChannelNotFoundException, nSessionPausedException, nUnknownRemoteRealmException, nSecurityException, nSessionNotConnectedException, nIllegalArgumentException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalChannelMode
 Finds and returns a nirvana channel that exists on the realm this session is connected to, or a joined realm.
nQueue findQueue (com.pcbsys.nirvana.client.nChannelAttributes attr) throws nChannelNotFoundException, nSessionPausedException, nUnknownRemoteRealmException, nSecurityException, nSessionNotConnectedException, nIllegalArgumentException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalChannelMode
 Finds and returns a nirvana queue that exists on the realm this session is connected to, or a joined realm.
nSessionAttributes getAttrib ()
 Gets the session attribute object associated with this session.
nSessionAttributes getAttributes ()
 Gets the session attribute object associated with this session.
boolean getChannelMultiplexing ()
 Returns true if channel multiplexing has been enabled or not.
com.pcbsys.nirvana.client.nChannelAttributes[] getChannels (String folder) throws nSecurityException, nSessionNotConnectedException, nSessionPausedException, nUnexpectedResponseException, nRequestTimedOutException
 Returns a list of all known channels and queues.
com.pcbsys.nirvana.client.nChannelAttributes[] getChannels () throws nSecurityException, nSessionNotConnectedException, nSessionPausedException, nUnexpectedResponseException, nRequestTimedOutException
 Returns a list of all known channels and queues.
String getConnectionList ()
 Returns a comma seperated list of RNAMEs which can be used to access the realm or cluster namespace.
int getCurrentLatency ()
 Returns the round trip time of the last synchronous request that was made.
nDataGroup[] getDataGroups (nDataGroupListener listener) throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Get all known data groups on the server (excluding the default data group) and register a listener.
nDataGroup[] getDataGroups () throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Return the array of nDataGroup objects excluding the default data group.
nDataGroup getDefaultDataGroup (nDataGroupListener listener) throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Return the default nDataGroup object, and provide a listener that will receive callbacks when new streams are added or removed.
nDataGroup getDefaultDataGroup () throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException
 Return the default data group object.
String getId () throws nSessionNotConnectedException
 Returns the unique session Id for this session.
long getInputByteCount ()
 Returns the number of bytes received from the server on this session object.
int getKnownGroupCount ()
 Get the size of the known data groups list.
long getOutputByteCount ()
 Returns the number of bytes sent to the server using this session object.
long getQueueSize ()
 Returns the outbound connection queue size.
com.pcbsys.nirvana.client.nRealm getRealm (String name) throws nRealmNotFoundException, nSessionPausedException, nSecurityException, nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Gets a reference to a realm that is already joined.
com.pcbsys.nirvana.client.nRealm[] getRealms () throws nSecurityException, nSessionNotConnectedException, nSessionPausedException, nUnexpectedResponseException, nRequestTimedOutException, nIllegalArgumentException
 Returns a list of all known realms on the connected realm.
long getReceivedEventCount ()
 Return the number of events received by this session.
String getRemoteId () throws nSessionNotConnectedException
 Returns the rname that this session has used.
long getSentEventCount ()
 Return the number of events sent by this session.
String getServerRealmName () throws nSessionNotConnectedException
 Returns the sessions server realm name.
long getServerTime () throws nSessionNotConnectedException, nUnexpectedResponseException, nRequestTimedOutException, nSessionPausedException, nSecurityException
 Gets the current time on the server.
long getSessionConnectionId ()
 Returns the unique connection id associated with this session by the server.
String getStreamId ()
 Get the stream Id for this session if initialised with an nDataStreamListener.
nSubject[] getSubject () throws nSessionNotConnectedException
 Gets the subject associated with this nirvana session.
nSubject getSubjectObject () throws nSessionNotConnectedException
 Gets the subject associated with this nirvana session.
int getThreadPoolSize ()
 Returns the current configured thread pool size.
nDataStream init (boolean disconnectIfClusterFails, nDataStreamListener streamListener) throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException
 Initialises a session object, opening the physical connection to the server and supplies a nDataStreamListener to receive asynchronous direct events.
nDataStream init (nDataStreamListener streamListener) throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException
 Initialises a session object, opening the physical connection to the server and supplies a nDataStreamListener to receive asynchronous direct events.
void init (boolean disconnectIfClusterFails) throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException
 Initialises a session object, opening the physical connection to the server.
void init () throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException
 Initialises a session object, opening the physical connection to the server.
boolean isConnected ()
 Returns true if this session is still connected with the remote realm.
boolean isPaused ()
 Returns true if this session is paused.
synchronized void pause (boolean releaseRequests)
 This function pauses delivery of new events to all subscribed nEventListeners until resume is called.
synchronized void pauseStream () throws Exception
 Pause the events being received by the Data Group Listener.
void removeAsyncExceptionListener (nAsyncExceptionListener listener) throws nIllegalArgumentException
 Removes an already added asynchronous exception listener, which will not be notified of asynchronous exceptions anymore.
void removeConnectionQueueListener (nConnectionQueueListener listener) throws nIllegalArgumentException
 Removes an already added connection queue listener, which will not be notified of queue state changes anymore.
void removeReconnectHandler (nReconnectHandler handler)
 Remove the reconnect handler from the session.
synchronized void resume ()
 Resumes delivery of events to nEventListeners.
synchronized void resumeStream () throws Exception
 Resumes the events being received by the Data Group Listener.
void setChannelMultiplexing (boolean flag) throws nSessionAlreadyInitialisedException
 Enables or disables the ability to add multiple subscriptions on a channel, by default it is enabled.
void setHTTPURLParameter (String param)
 Allows the HTTP communication between the client and the realm to include an optional parameter that can be analysed by load balance servers or proxies.
void setThreadPoolSize (int size)
 Changes the current size of the thread pool to the size passed.
nSubscriptionAttributes[] subscribe (nSubscriptionAttributes[] attributes) throws Exception
 Subscribe to the channels specified within the nSubscriptionAttributes array.
void unblockThread (String name)
 Unblocks the thread of the given name that my be in a synchronous call.
void updateConnectionListWithServerList ()
 Update the current session attributes with the RNAMEs retrieved from the server.
void writeDataGroup (Map< nConsumeEvent, nDataGroup > list, boolean waitForResponse) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends each event in the list to its corresponding data group.
void writeDataGroup (nConsumeEvent[] evts, nDataGroup[] dataGroups, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the list of events to all of the specified data groups.
void writeDataGroup (nConsumeEvent[] evts, nDataGroup dataGroup, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the list of events to the specified data group.
void writeDataGroup (nConsumeEvent evt, nDataGroup[] dataGroups, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to all of the specified data groups.
void writeDataGroup (nConsumeEvent evt, nDataGroup dataGroup, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified data group.
void writeDataGroup (nConsumeEvent[] evts, nDataGroup[] dataGroups) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the list of events to all of the specified data groups.
void writeDataGroup (Map< nConsumeEvent, nDataGroup > list) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends each event in the list to its corresponding data group.
void writeDataGroup (nConsumeEvent[] evts, nDataGroup dataGroup) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the list of events to the specified data group.
void writeDataGroup (nConsumeEvent evt, nDataGroup[] dataGroups) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to all of the specified data groups.
void writeDataGroup (nConsumeEvent evt, nDataGroup dataGroup) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified data group.
void writeDataStream (nConsumeEvent[] evts, nDataStream[] streams, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified streams.
void writeDataStream (nConsumeEvent[] evts, nDataStream stream, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified stream.
void writeDataStream (nConsumeEvent evt, nDataStream[] streams, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified streams.
void writeDataStream (nConsumeEvent evt, nDataStream stream, boolean waitForReply) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified stream.
void writeDataStream (nConsumeEvent[] evts, nDataStream[] streams) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the events to the specified streams.
void writeDataStream (nConsumeEvent[] evts, nDataStream stream) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the events to the specified stream.
void writeDataStream (nConsumeEvent evt, nDataStream[] streams) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified streams.
void writeDataStream (nConsumeEvent evt, nDataStream stream) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends the event to the specified stream.

Static Public Member Functions

static int getMaxBufferSize ()
 Gets the maximum client buffer size.
static void setMaxBufferSize (int size) throws nIllegalArgumentException
 Sets the maximum client buffer size.

Protected Member Functions

nDataGroup[] getGroupsContaining (nDataGroup group)
 Locate the groups that currently contain this group.
void writeDataGroup (Map< nConsumeEvent, nDataGroup > list, boolean waitForResponse, boolean isRegisteredEvent) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException
 Sends each event in the list to its corresponding data group.

Detailed Description

This class represents a Nirvana session, the logical connection between the client API and the Nirvana realm.

A Nirvana session is defined through a set of session attributes that is represented by the nSessionAttributes class in the same package. This set of attributes is then passed to the session factory object which creates the session. A session object needs to be initialised in order for the physical connection to be opened to the server. Please note that when using a session to retrieve events from a channel or queue, you can only have 1 listener specifying a set filter per session object. For example if you have a selector set as CCY='USD' you can use that filter by only one object implementing the nEventListener interface per session, otherwise a nUserAlreadySubscribedException will be thrown.


Member Function Documentation

void com.pcbsys.nirvana.client.nSession.addAsyncExceptionListener ( nAsyncExceptionListener  listener  )  throws nIllegalArgumentException

Adds a new asynchronous exception listener, which will be notified when an exception occurs while performing an asynchronous operation.

Parameters:
listener The asynchronous exception listener to be added
Exceptions:
nIllegalArgumentException Illegal parameter, check the message for more information

void com.pcbsys.nirvana.client.nSession.addConnectionQueueListener ( nConnectionQueueListener  listener,
boolean  hwm,
boolean  lwm,
boolean  access,
boolean  push,
boolean  block,
boolean  unblock 
) throws nIllegalArgumentException

Adds a new connection queue listener, which will be notified when the internal outbound queue reaches defined limits, such as

Reaching high water mark Reaching low water mark Exceeding the time it should take to access the queue object Exceeding the time it should take to push an event onto the queue Exceeding the time for a queue to be blocked due to reaching its high water mark

Unless you have explicitly called nConstants.setWriteHandlerType(nConstants.sQueuedWriteHandler), and are therefore using an outbound queue, you will not receive any notifications from this listener.

Parameters:
listener The asynchronous exception listener to be added
hwm true to receive notifications of reaching queue high water mark
lwm true to receive notifications of reaching queue low water mark
access true to receive notification of exceeeding queue access time
push true to receive notification of exceeeding queue access and push time
block true to receive notification of exceeeding queue block time
Exceptions:
nIllegalArgumentException if the listener is Null of if already has a listener registered

void com.pcbsys.nirvana.client.nSession.addConnectionQueueListener ( nConnectionQueueListener  listener  )  throws nIllegalArgumentException

Adds a new connection queue listener, which will be notified when the internal outbound queue reaches defined limits, such as

Reaching high water mark Reaching low water mark Exceeding the time it should take to access the queue object Exceeding the time it should take to push an event onto the queue Exceeding the time for a queue to be blocked due to reaching its high water mark

Unless you have explicitly called nConstants.setWriteHandlerType(nConstants.sQueuedWriteHandler), and are therefore using an outbound queue, you will not receive any notifications from this listener.

Parameters:
listener The asynchronous exception listener to be added
Exceptions:
nIllegalArgumentException if the listener is Null of if already has a listener registered

Adds (Joins) another realm to the realm this session is connected to.

Parameters:
newRealm The realm to join as an nRealm object
session A session to the realm we want to add to
Exceptions:
nRealmAlreadyBoundException The realm is known by the server
nRealmUnreachableException The specified realm is already configured
nRealmNotFoundException The realm is not known by the server
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nNameSpaceConflictException The realm conflicts with the existing namespace
nSessionPausedException The session is currently paused, please resume

Adds (Joins) another realm to the realm this session is connected to.

Parameters:
newRealm The realm to join as an nRealm object
Exceptions:
nRealmAlreadyBoundException The realm is known by the server
nRealmNotFoundException The realm is not known by the server
nRealmUnreachableException The specified realm is already configured
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nNameSpaceConflictException The realm conflicts with the existing namespace
nSessionPausedException The session is currently paused, please resume

void com.pcbsys.nirvana.client.nSession.addReconnectHandler ( nReconnectHandler  handler  ) 

Add a session reconnect handler to the session.

Usually the handler is passed in when the session is constructed from the nSessionFactory, however this method allows you to pass in a handler once a session has been constructed.

Parameters:
handler - the nReconnectHandler object for this session

void com.pcbsys.nirvana.client.nSession.commitRegisteredEventsToDataGroups ( nRegisteredEvent[]  events,
boolean  replace 
) throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException

Commit all registered event changes in a single call to the server.

Parameters:
events the registered events that have changed
replace override the event on the server
Exceptions:
nSecurityException 
nSessionPausedException 
nIllegalArgumentException 
nSessionNotConnectedException 
nRequestTimedOutException 
nUnexpectedResponseException 

void com.pcbsys.nirvana.client.nSession.commitRegisteredEventsToDataGroups ( nRegisteredEvent[]  events  )  throws nSecurityException, nSessionPausedException, nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException

Commit all registered event changes in a single call to the server.

Parameters:
events the registered events that have changed
Exceptions:
nSecurityException 
nSessionPausedException 
nIllegalArgumentException 
nSessionNotConnectedException 
nRequestTimedOutException 
nUnexpectedResponseException 

Creates a new channel on the realm this session is connected.

If the channel attributes specify a realm different than the one this session is connected to, a transparent redirection will occur and the channel will be created on that realm.

Parameters:
attr The channel attributes object containing the parameters for the new channel to be created @ param initialEID The channel will be created with the first eid being set to this value by default it is set to 0 but the user can set it to any positive value
p_initialEID The value to start the event id at
privMask Privilege mask to apply to the "everyone" subject for this channel
Returns:
an nChannel object representing the newly created nirvana channel
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelAlreadyExistsException The channel already exists
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Creates a new channel on the realm this session is connected.

If the channel attributes specify a realm different than the one this session is connected to, a transparent redirection will occur and the channel will be created on that realm.

Parameters:
attr The channel attributes object containing the parameters for the new channel to be created @ param initialEID The channel will be created with the first eid being set to this value by default it is set to 0 but the user can set it to any positive value
p_initialEID The value to start the event id at
Returns:
an nChannel object representing the newly created nirvana channel
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelAlreadyExistsException The channel already exists
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Creates a new channel on the realm this session is connected.

If the channel attributes specify a realm different than the one this session is connected to, a transparent redirection will occur and the channel will be created on that realm.

Parameters:
attr The channel attributes object containing the parameters for the new channel to be created
Returns:
an nChannel object representing the newly created nirvana channel
Exceptions:
nUnknownRemoteRealmException The remote node responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelAlreadyExistsException The requested channel already exists
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

nDataGroup com.pcbsys.nirvana.client.nSession.createDataGroup ( String  dataGroupName,
nDataGroupListener  listener,
nConflationAttributes  conflationAttributes 
) throws nRequestTimedOutException, nIllegalArgumentException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Create a new data group on the server.

If the data group exists already, and the groups have already been retrieved by this nSession the nDataGroup will be returned from the local list of data groups. Otherwise this method will send an event to the server.

Parameters:
dataGroupName the name of the data group to create
listener the instance of the nDataGroupListener that will receive the callbacks for this group
conflationAttributes the conflation strategy to use on the data group
Returns:
the data group matching the specified name
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 
nIllegalArgumentException 
See also:
nConflationAttributes
Since:
6.0

Create a new data group on the server.

If the data group exists already, and the groups have already been retrieved by this nSession the nDataGroup will be returned from the local list of data groups. Otherwise this method will send an event to the server.

Parameters:
dataGroupName the name of the data group to create
listener the instance of the nDataGroupListener that will receive the callbacks for this group
Returns:
the data group matching the specified name
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 
nIllegalArgumentException 
Since:
6.0

Create a new data group on the server.

If the data group exists already, and the groups have already been retrieved by this nSession the nDataGroup will be returned from the local list of data groups. Otherwise this method will send an event to the server.

Parameters:
dataGroupName the name of the data group to create
Returns:
the data group matching the specified name
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nIllegalArgumentException 
nUnexpectedResponseException 
Since:
6.0

nDataGroup [] com.pcbsys.nirvana.client.nSession.createDataGroups ( String[]  dataGroupNames,
nConflationAttributes  conflationAttributes 
) throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Create new data groups on the server if they don't exist, or return them from the local list if found.

Parameters:
dataGroupNames the names of the data groups to create
conflationAttributes the conflation strategy to be applied to the data groups
Returns:
the array of data groups created / found
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 
nIllegalArgumentException 

nDataGroup [] com.pcbsys.nirvana.client.nSession.createDataGroups ( String[]  dataGroupNames  )  throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Create new data groups on the server if they don't exist, or return them from the local list if found.

Parameters:
dataGroupNames the names of the data groups to create
Returns:
the array of data groups created / found
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nIllegalArgumentException 
nUnexpectedResponseException 

Creates a new queue on the realm this session is connected.

If the channel attributes specify a realm different than the one this session is connected to, a transparent redirection will occur and the queue will be created on that realm.

Parameters:
attr The channel attributes object containing the parameters for the new queue to be created
Returns:
an nQueue object representing the newly created nirvana queue
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelAlreadyExistsException The channel already exists
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Creates a new queue on the realm this session is connected.

If the channel attributes specify a realm different than the one this session is connected to, a transparent redirection will occur and the queue will be created on that realm.

Parameters:
attr The channel attributes object containing the parameters for the new queue to be created
privMask Privilege mask to apply to the "everyone" subject for this queue
Returns:
an nQueue object representing the newly created nirvana queue
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelAlreadyExistsException The channel already exists
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Deletes a nirvana channel that exists on the realm this session is connected to, or a joined realm.

Note: all events in that channel will be deleted too and are not recoverable.

Parameters:
attr The channel attributes of the channel to be deleted
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelNotFoundException The specified channel could not be found
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

void com.pcbsys.nirvana.client.nSession.deleteDataGroup ( nDataGroup[]  groups  )  throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Deletes the specified data group from the server.

Parameters:
groups the data groups to delete
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.deleteDataGroup ( nDataGroup  group  )  throws nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Deletes the specified data group from the server.

Parameters:
group the data group to delete
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.deleteDataGroup ( String  dataGroupName  )  throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Deletes the specified data group from the server.

Parameters:
dataGroupName the name of the data group to delete
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nIllegalArgumentException 
nUnexpectedResponseException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.deleteDataGroup ( String[]  dataGroupNames  )  throws nIllegalArgumentException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException, nSecurityException, nUnexpectedResponseException

Deletes the specified data group from the server.

Parameters:
dataGroupNames array of data group names to be deleted
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nIllegalArgumentException 
nUnexpectedResponseException 
Since:
6.0

Deletes a nirvana queue that exists on the realm this session is connected to, or a joined realm.

Note: all events in that queue will be deleted too and are not recoverable.

Parameters:
attr The channel attributes of the queue to be deleted
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nChannelNotFoundException The specified channel could not be found
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Deletes (unjoins) another realm from the realm this session is connected to.

Parameters:
aRealm The realm to unjoin as an nRealm object
Exceptions:
nRealmNotFoundException The supplied realm could not be found on the server
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

synchronized void com.pcbsys.nirvana.client.nSession.enableThreading ( boolean  enabled  ) 

Calling this function starts the internal thread pools.

These pools handle the asynchronous events received as part of a subscribed channel or other such events.

Parameters:
enabled specifies if callbacks should use a thread pool or not

synchronized void com.pcbsys.nirvana.client.nSession.enableThreading (  ) 

Calling this function starts the internal thread pools.

These pools handle the asynchronous events received as part of a subscribed channel or other such events.

synchronized void com.pcbsys.nirvana.client.nSession.enableThreading ( int  poolSize  ) 

Enables thread pooling for this session.

By default the session is configured with only one thread which performs all tasks for this session including event callbacks. If in the user logic of the nEventListener.go() a method is called on the session the session will automatically enable thread pooling.

Parameters:
poolSize Number of threads to use within the pool. By default it is 1

Finds and returns an array of nFindResult objects that correspond to the results of the find operations on each nChannelAttributes.

Parameters:
attr The channel attributes of the channels / queues to be found
Returns:
The nFindResult array that represents the result of the find call
Exceptions:
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Finds and returns a nirvana channel that exists on the realm this session is connected to, or a joined realm.

Parameters:
attr The channel attributes of the channel to be found
Returns:
The nChannel object if it was found
Exceptions:
nChannelNotFoundException The channel specified could not be found
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nIllegalChannelMode The channel referenced is a queue
nSessionPausedException The session is currently paused, please resume

Finds and returns a nirvana queue that exists on the realm this session is connected to, or a joined realm.

Parameters:
attr The channel attributes of the queue to be found
Returns:
The nChannel object if it was found.
Exceptions:
nChannelNotFoundException The specified queue could not be found
nUnknownRemoteRealmException The remote realm responded with an unknown exception
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nIllegalChannelMode The queue referenced is a channel
nSessionPausedException The session is currently paused, please resume

nSessionAttributes com.pcbsys.nirvana.client.nSession.getAttrib (  ) 

Gets the session attribute object associated with this session.

Returns:
the nSessionAttributes object associated with this session
Deprecated:
As of version 2.0. Use getAttributes() instead

nSessionAttributes com.pcbsys.nirvana.client.nSession.getAttributes (  ) 

Gets the session attribute object associated with this session.

Returns:
the nSessionAttributes object associated with this session

boolean com.pcbsys.nirvana.client.nSession.getChannelMultiplexing (  ) 

Returns true if channel multiplexing has been enabled or not.

Returns:

Returns a list of all known channels and queues.

Parameters:
folder specify the starting point in the namespace within which to retrieve the channels
Returns:
An nChannelAttributes array object refering to the channels, or null if no channels are defined
Exceptions:
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nSessionPausedException The session is currently paused, please resume

Returns a list of all known channels and queues.

Returns:
An nChannelAttributes array object refering to the channels, or null if no channels are defined
Exceptions:
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nSessionPausedException The session is currently paused, please resume

String com.pcbsys.nirvana.client.nSession.getConnectionList (  ) 

Returns a comma seperated list of RNAMEs which can be used to access the realm or cluster namespace.

This value is calculated and updated by the server which this session is currently connected to.

Returns:
Comma seperated list of rnames which can be used to construct a nSessionAttributes.

int com.pcbsys.nirvana.client.nSession.getCurrentLatency (  ) 

Returns the round trip time of the last synchronous request that was made.

Returns:
the current round trip time

Get all known data groups on the server (excluding the default data group) and register a listener.

The listener will receive callbacks whenever a stream or group is created/deleted or added/removed from a group.

Parameters:
listener the instance of the nDataGroupListener that will receive callbacks for all known data groups including the default
Returns:
the data group array
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 

Return the array of nDataGroup objects excluding the default data group.

Returns:
the data group array
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 

Return the default nDataGroup object, and provide a listener that will receive callbacks when new streams are added or removed.

Parameters:
listener the instance of the nDataGroupListener that will receive the callbacks to the default group
Returns:
the default data group
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 

Return the default data group object.

Returns:
the default group
Exceptions:
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
nSecurityException 
nUnexpectedResponseException 

nDataGroup [] com.pcbsys.nirvana.client.nSession.getGroupsContaining ( nDataGroup  group  )  [protected]

Locate the groups that currently contain this group.

Parameters:
group the group to check
Returns:
an array of nDataGroup objects containing the group

String com.pcbsys.nirvana.client.nSession.getId (  )  throws nSessionNotConnectedException

Returns the unique session Id for this session.

Returns:
String representation of this ID
Exceptions:
nSessionNotConnectedException Current session is not connected

long com.pcbsys.nirvana.client.nSession.getInputByteCount (  ) 

Returns the number of bytes received from the server on this session object.

Returns:
long byte count

int com.pcbsys.nirvana.client.nSession.getKnownGroupCount (  ) 

Get the size of the known data groups list.

Returns:
the current size of the data groups list

static int com.pcbsys.nirvana.client.nSession.getMaxBufferSize (  )  [static]

Gets the maximum client buffer size.

The default value is 1 MB

Returns:
an int specifying the current maximum client buffer size

long com.pcbsys.nirvana.client.nSession.getOutputByteCount (  ) 

Returns the number of bytes sent to the server using this session object.

Returns:
long byte count

long com.pcbsys.nirvana.client.nSession.getQueueSize (  ) 

Returns the outbound connection queue size.

Returns:
the size of the queue

Gets a reference to a realm that is already joined.

Parameters:
name A string specifying the name of the realm to be returned
Returns:
An nRealm object refering to the realm, or null if no realm with that name is found
Exceptions:
nRealmNotFoundException The realm name supplied could not be found on the server
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

Returns a list of all known realms on the connected realm.

Returns:
An nRealm array object refering to the realm, or null if no realms are defined
Exceptions:
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nIllegalArgumentException Illegal parameter, check the message for more information
nSessionPausedException The session is currently paused, please resume

long com.pcbsys.nirvana.client.nSession.getReceivedEventCount (  ) 

Return the number of events received by this session.

Returns:
the number of sent received

String com.pcbsys.nirvana.client.nSession.getRemoteId (  )  throws nSessionNotConnectedException

Returns the rname that this session has used.

Returns:
String representation of the rname
Exceptions:
nSessionNotConnectedException Current session is not connected

long com.pcbsys.nirvana.client.nSession.getSentEventCount (  ) 

Return the number of events sent by this session.

Returns:
the number of sent events

String com.pcbsys.nirvana.client.nSession.getServerRealmName (  )  throws nSessionNotConnectedException

Returns the sessions server realm name.

Returns:
Realm Server name
Exceptions:
nSessionNotConnectedException If the session is not currently connected with the server

Gets the current time on the server.

Returns:
The current time on the Realm Server as a long value
Exceptions:
nSecurityException User is not authorised for the function
nSessionNotConnectedException Current session is not connected
nUnexpectedResponseException Internal Error has occured, since we received a response from the server out of sequence
nRequestTimedOutException The server has not responded to the request in the timeout period
nSessionPausedException The session is currently paused, please resume

long com.pcbsys.nirvana.client.nSession.getSessionConnectionId (  ) 

Returns the unique connection id associated with this session by the server.

Returns:
the server's connection id for this nSession

String com.pcbsys.nirvana.client.nSession.getStreamId (  ) 

Get the stream Id for this session if initialised with an nDataStreamListener.

Returns:
a string representation of the stream id

nSubject [] com.pcbsys.nirvana.client.nSession.getSubject (  )  throws nSessionNotConnectedException

Gets the subject associated with this nirvana session.

Returns:
an nSubject[] object with the subject details associated with the session
Exceptions:
nSessionNotConnectedException If the session is not currently connected with the server

nSubject com.pcbsys.nirvana.client.nSession.getSubjectObject (  )  throws nSessionNotConnectedException

Gets the subject associated with this nirvana session.

Returns:
an nSubject object with the subject details associated with the session
Exceptions:
nSessionNotConnectedException If the session is not currently connected with the server

int com.pcbsys.nirvana.client.nSession.getThreadPoolSize (  ) 

Returns the current configured thread pool size.

Returns:
int pool size

nDataStream com.pcbsys.nirvana.client.nSession.init ( boolean  disconnectIfClusterFails,
nDataStreamListener  streamListener 
) throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException

Initialises a session object, opening the physical connection to the server and supplies a nDataStreamListener to receive asynchronous direct events.

Parameters:
disconnectIfClusterFails - if the cluster loses quorum, should this nSession become disconnected (true/false)
Exceptions:
nRealmUnreachableException if the realm is currently not available
nSessionNotConnectedException Current session is not connected
nSessionAlreadyInitialisedException The session has already been initialised
nSecurityException Insufficient privileges nDataStreamListener - a stream listener to receive asynchronous events
Since:
6.0

Initialises a session object, opening the physical connection to the server and supplies a nDataStreamListener to receive asynchronous direct events.

Exceptions:
nRealmUnreachableException if the realm is currently not available
nSessionNotConnectedException Current session is not connected
nSessionAlreadyInitialisedException The session has already been initialised
nSecurityException Insufficient privileges nDataStreamListener - a stream listener to receive asynchronous events
Since:
6.0

void com.pcbsys.nirvana.client.nSession.init ( boolean  disconnectIfClusterFails  )  throws nRealmUnreachableException, nSecurityException, nSessionNotConnectedException, nSessionAlreadyInitialisedException

Initialises a session object, opening the physical connection to the server.

Parameters:
disconnectIfClusterFails - if the cluster loses quorum, should this nSession become disconnected (true/false)
Exceptions:
nRealmUnreachableException if the realm is currently not available
nSessionNotConnectedException Current session is not connected
nSessionAlreadyInitialisedException The session has already been initialised
nSecurityException Insufficient privileges
Since:
4.0

Initialises a session object, opening the physical connection to the server.

Exceptions:
nRealmUnreachableException if the realm is currently not available
nSessionNotConnectedException Current session is not connected
nSessionAlreadyInitialisedException The session has already been initialised
nSecurityException Insufficient privileges

boolean com.pcbsys.nirvana.client.nSession.isConnected (  ) 

Returns true if this session is still connected with the remote realm.

Returns:
result of the test

boolean com.pcbsys.nirvana.client.nSession.isPaused (  ) 

Returns true if this session is paused.

Returns:
result of the test

synchronized void com.pcbsys.nirvana.client.nSession.pause ( boolean  releaseRequests  ) 

This function pauses delivery of new events to all subscribed nEventListeners until resume is called.

Parameters:
releaseRequests specifies whether to release any outstanding synchronous requests awaiting responses from the server

synchronized void com.pcbsys.nirvana.client.nSession.pauseStream (  )  throws Exception

Pause the events being received by the Data Group Listener.

This is not currently implemented

Exceptions:
Exception 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.removeAsyncExceptionListener ( nAsyncExceptionListener  listener  )  throws nIllegalArgumentException

Removes an already added asynchronous exception listener, which will not be notified of asynchronous exceptions anymore.

Parameters:
listener The asynchronous exception listener to be added
Exceptions:
nIllegalArgumentException Illegal parameter, check the message for more information

void com.pcbsys.nirvana.client.nSession.removeConnectionQueueListener ( nConnectionQueueListener  listener  )  throws nIllegalArgumentException

Removes an already added connection queue listener, which will not be notified of queue state changes anymore.

Parameters:
listener The asynchronous exception listener to be added
Exceptions:
nIllegalArgumentException if the listener is Null of if no listener registered

void com.pcbsys.nirvana.client.nSession.removeReconnectHandler ( nReconnectHandler  handler  ) 

Remove the reconnect handler from the session.

Parameters:
handler - the reconnect handler to be removed

synchronized void com.pcbsys.nirvana.client.nSession.resumeStream (  )  throws Exception

Resumes the events being received by the Data Group Listener.

This is not curently implemented

Exceptions:
Exception 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.setChannelMultiplexing ( boolean  flag  )  throws nSessionAlreadyInitialisedException

Enables or disables the ability to add multiple subscriptions on a channel, by default it is enabled.

This must be called prior to calling session init

Parameters:
flag Boolean flag to enable/disable
Exceptions:
nSessionAlreadyInitialisedException 

void com.pcbsys.nirvana.client.nSession.setHTTPURLParameter ( String  param  ) 

Allows the HTTP communication between the client and the realm to include an optional parameter that can be analysed by load balance servers or proxies.

Parameters:
param Parameter in the form of : ?param

static void com.pcbsys.nirvana.client.nSession.setMaxBufferSize ( int  size  )  throws nIllegalArgumentException [static]

Sets the maximum client buffer size.

The default value is 1 MB

Parameters:
size an int specifying the new maximum client buffer size
Exceptions:
nIllegalArgumentException Illegal parameter, check the message for more information

void com.pcbsys.nirvana.client.nSession.setThreadPoolSize ( int  size  ) 

Changes the current size of the thread pool to the size passed.

Parameters:
size New size of the thread pool

nSubscriptionAttributes [] com.pcbsys.nirvana.client.nSession.subscribe ( nSubscriptionAttributes[]  attributes  )  throws Exception

Subscribe to the channels specified within the nSubscriptionAttributes array.

Parameters:
attributes - the details of each channel subscription
Returns:
the response from the server will be either an Exception or an nChannel within each subscription attributes object
Exceptions:
Exception if the server encounters any problem during this operation
nIllegalArgumentException if attributes contains a illegal value
See also:
nSubscriptionAttributes

void com.pcbsys.nirvana.client.nSession.unblockThread ( String  name  ) 

Unblocks the thread of the given name that my be in a synchronous call.

Parameters:
name the name of the thread

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( Map< nConsumeEvent, nDataGroup list,
boolean  waitForResponse,
boolean  isRegisteredEvent 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException [protected]

Sends each event in the list to its corresponding data group.

Parameters:
list <key,value> list of nConsumeEvent and data groups
waitForResponse if true then the method will not return until it receives a response from the server
isRegisteredEvent if this is true, the events will be handled as a list of nRegisteredEvents

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( Map< nConsumeEvent, nDataGroup list,
boolean  waitForResponse 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends each event in the list to its corresponding data group.

Parameters:
list <key,value> list of nConsumeEvent and data groups
waitForResponse if true then the method will not return until it receives a response from the server

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent[]  evts,
nDataGroup[]  dataGroups,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the list of events to all of the specified data groups.

Parameters:
evts the array of events to write to the groups
dataGroups the array of groups to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent[]  evts,
nDataGroup  dataGroup,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the list of events to the specified data group.

Parameters:
evts the array of events to write to the group
dataGroup the data group to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent  evt,
nDataGroup[]  dataGroups,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to all of the specified data groups.

Parameters:
evt the event to write to the groups
dataGroups the array of data groups to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent  evt,
nDataGroup  dataGroup,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified data group.

Parameters:
evt the event to write to the group
dataGroup the data group to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent[]  evts,
nDataGroup[]  dataGroups 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the list of events to all of the specified data groups.

Parameters:
evts the array of events to write to the groups
dataGroups the groups to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( Map< nConsumeEvent, nDataGroup list  )  throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends each event in the list to its corresponding data group.

Parameters:
list the <key,value> list of nConsumeEvent and data groups

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent[]  evts,
nDataGroup  dataGroup 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the list of events to the specified data group.

Parameters:
evts the array of events to write to the group
dataGroup the data group to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent  evt,
nDataGroup[]  dataGroups 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to all of the specified data groups.

Parameters:
evt the event to write to the data groups
dataGroups the array of data groups to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataGroup ( nConsumeEvent  evt,
nDataGroup  dataGroup 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified data group.

Parameters:
evt the event to write to the data group
dataGroup the data group to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent[]  evts,
nDataStream[]  streams,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified streams.

Parameters:
evts the array of events to write to the streams
streams the array of streams to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent[]  evts,
nDataStream  stream,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified stream.

Parameters:
evts the array of events to write to the stream
stream the stream to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent  evt,
nDataStream[]  streams,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified streams.

Parameters:
evt the event to write to the streams
streams the array of streams to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent  evt,
nDataStream  stream,
boolean  waitForReply 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified stream.

Parameters:
evt the event to write to the stream
stream the data stream to write to
waitForReply if true then the method will not return until it receives a response from the server
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent[]  evts,
nDataStream[]  streams 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the events to the specified streams.

Parameters:
evts the array of events to write to the stream
streams the array of streams to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent[]  evts,
nDataStream  stream 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the events to the specified stream.

Parameters:
evts the array of events to write to the stream
stream the stream to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent  evt,
nDataStream[]  streams 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified streams.

Parameters:
evt the event to write to the streams
streams the array of streams to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0

void com.pcbsys.nirvana.client.nSession.writeDataStream ( nConsumeEvent  evt,
nDataStream  stream 
) throws nSecurityException, nRequestTimedOutException, nSessionPausedException, nSessionNotConnectedException

Sends the event to the specified stream.

Parameters:
evt the event to write to the stream
stream the stream to write to
Exceptions:
nSecurityException 
nRequestTimedOutException 
nSessionPausedException 
nSessionNotConnectedException 
Since:
6.0