This class provides a Queue mechanism. More...
Public Member Functions | |
void | addConnectionListener (nChannelConnectionListener listener) throws nSessionPausedException, nUnexpectedResponseException, nIllegalArgumentException, nRequestTimedOutException, nSessionNotConnectedException |
Adds a nChannelConnectionListener to this queue so that when new connections are made to this queue the listener is notified. More... | |
nQueueAsyncReader | createAsyncReader (final nQueueReaderContext context) throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous queue reader. More... | |
nQueueAsyncReader | createAsyncReaderPrevious (final nQueueReaderContext context) throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous queue reader. More... | |
nQueueAsyncTransactionReader | createAsyncTransactionalReader (final nQueueReaderContext context) throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous Transactional queue reader. More... | |
nQueueAsyncTransactionReader | createAsyncTransactionalReaderPrevious (final nQueueReaderContext context) throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous Transactional queue reader. More... | |
nQueueSyncFragmentReader | createFragmentReader (final nQueueReaderContext context) throws nIllegalArgumentException |
Creates a Synchronous queue reader that supports fragmented events. More... | |
nQueueSyncReader | createReader (final nQueueReaderContext context) throws nIllegalArgumentException |
Creates a Synchronous queue reader. More... | |
nQueueSyncTransactionFragmentReader | createTransactionalFragmentReader (final nQueueReaderContext context) throws nIllegalArgumentException |
Creates a Synchronous Transaction queue reader that supports fragmented events. More... | |
nQueueSyncTransactionReader | createTransactionalReader (final nQueueReaderContext context) throws nIllegalArgumentException |
Creates a Synchronous Transaction queue reader. More... | |
nQueueDetails | getDetails () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Used to collect the current queue details. More... | |
String | getName () |
Gets the name of this queue. More... | |
com.pcbsys.nirvana.client.nChannelAttributes | getQueueAttributes () |
This method will return the nChannelAttributes associated with the nQueue object. More... | |
long | push (final nConsumeEvent e) throws nIllegalArgumentException, nSessionPausedException, nSecurityException, nRequestTimedOutException, nSessionNotConnectedException, nMaxBufferSizeExceededException |
Pushes an event on to the queue. More... | |
void | push (String tag, Document adom) throws nSessionNotConnectedException, nSessionPausedException, nIllegalArgumentException, nSecurityException, nMaxBufferSizeExceededException |
Publishes the specified XML DOM document to this queue with the specified tag. More... | |
void | push (String tag, Document adom, nMessageSigner signer) throws nSessionNotConnectedException, nSessionPausedException, nIllegalArgumentException, nSecurityException, nMaxBufferSizeExceededException |
Publishes the specified XML DOM document to this queue with the specified tag. More... | |
long | push (final nConsumeEvent e, final nMessageSigner signer) throws nIllegalArgumentException, nSessionPausedException, nSecurityException, nRequestTimedOutException, nSessionNotConnectedException, nMaxBufferSizeExceededException |
Pushes an event on to the queue. More... | |
void | removeConnectionListener (nChannelConnectionListener listener) throws nSessionPausedException, nUnexpectedResponseException, nRequestTimedOutException, nSessionNotConnectedException |
Removes the connection listener to this queue. More... | |
int | size () |
Returns the number of events waiting in the queue. More... | |
![]() | |
nJoinInformation[] | getJoinInformation () throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRealmNotFoundException, nRequestTimedOutException, nUnexpectedResponseException |
Returns an array of nJoinInformation objects which describe the links this store has configured for it. More... | |
int | getQueueSize () |
Returns the size of the underlying event queue waiting for delivery via the go method. More... | |
nSession | getSession () |
Returns the nSession used to create/find this channel. More... | |
com.pcbsys.nirvana.client.nChannelAttributes | getStoreAttributes () |
The attributes about this channel and how it is configured. More... | |
StoreLogger | getTraceLogger () |
Internal logger for UM Client API. More... | |
boolean | isStoreObjectInvalid () |
When a store is removed (or modified which entails a remove and create) then these logical representations can become invalid Once they are invalid you must perform a findChannel again on the nSession to acquire the latest object. More... | |
void | purge () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Deletes all undelivered events from the store. More... | |
void | purge (String selector) throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Deletes all undelivered events from the store that match {. More... | |
void | purgeEvent (long eidval) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a single event from this store. More... | |
void | purgeEventAsync (long eidval) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a single event from this store and does not wait for the response from the server. More... | |
void | purgeEvents (long startEID, long endEID) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a range of events from this store. More... | |
void | purgeEvents (long startEID, long endEID, String selector) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a range of events from this store that match {. More... | |
void | purgeEventsAsync (long startEID, long endEID) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a range of events from this store and does not wait for the response from the server. More... | |
void | purgeEventsAsync (long startEID, long endEID, String selector) throws nSecurityException, nChannelNotFoundException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException, nUnexpectedResponseException, nIllegalArgumentException |
Purges a range of events from this store that match {. More... | |
void | purgeEventsAsync () throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Deletes all undelivered events from the store and does not wait for the response from the server. More... | |
void | purgeEventsAsync (String selector) throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Deletes all undelivered events matching the selector from the store and does not wait for the response from the server. More... | |
void | updateProtobufDefinitions (byte[][] descriptors) throws nIllegalArgumentException, nSessionNotConnectedException, nRequestTimedOutException, nSessionPausedException |
Update the Protocol Buffer definition for the store. More... | |
Static Public Member Functions | |
static void | destroyReader (final nQueueReader reader) throws nUnexpectedResponseException, nSessionPausedException, nSessionNotConnectedException, nRequestTimedOutException |
This call will release any outstanding resources on the server and close the reader. More... | |
static void | destroyReaderLocally (final nQueueReader reader) throws nUnexpectedResponseException, nSessionNotConnectedException, nRequestTimedOutException |
This call will close local reader resources but remain subscribed at the server Any future calls to this object will work unless destroyReader() is called. More... | |
This class provides a Queue mechanism.
It allows for multiple users to pop events from the queue and multiple users to push events on to the queue. However, a queue differs from a channel in that an event can only be popped by one user. This means that an event is only delivered to one client. While a channel it is delivered to all users who are subscribed. The queue also offers a peek method. This method uses a window over the queue so that the entire queue does not need to be sent in one hit.
Four different Queue reading models are supported, these are
Synchronous | Here the client will call pop() whenever the client wants to retrieve an event from the server. The server will automatically acknowledge that the client has received this event. |
Synchronous Transactional | This is similar in operation to the Synchronous model, except the server does not auto acknowledge the events, this enables the client to perform commit() or rollback() operations. |
Asynchronous | In this model the server will record that the client is interested in events from this queue and will maintain an outstanding pop() and as events are received on the queue they are automatically delivered to the client via a callback. The events are auto acknowledged on the server once they have been delivered to the client. |
Asynchronous Transactional | This is similar in operation to the Asynchronous model, except the server does not auto acknowledge the events, this enables the client to perform commit() or rollback() operations. The server will stop delivering events to this client once the WindowSize has been reached, the client will need to call either commit() or rollback() before events are delivered again. |
In both transactional models, when a rollback()
is called any events sent since the last commit()
or rollback()
will be redelivered to all registered clients. This means the client may not receive these events again, but rather, they are redistributed amongst the current clients.
void com.pcbsys.nirvana.client.nQueue.addConnectionListener | ( | nChannelConnectionListener | listener | ) | throws nSessionPausedException, nUnexpectedResponseException, nIllegalArgumentException, nRequestTimedOutException, nSessionNotConnectedException |
Adds a nChannelConnectionListener to this queue so that when new connections are made to this queue the listener is notified.
listener | to add |
nRequestTimedOutException | if the request exceeded the timeout value |
nSessionNotConnectedException | The session is not currently connected to the server |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
nQueueAsyncReader com.pcbsys.nirvana.client.nQueue.createAsyncReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous queue reader.
In this model the server will record that the client is interested in events from this queue and will maintain an outstanding pop()
and as events are received on the queue they are automatically delivered to the client via a callback. The events are auto acknowledged on the server once they have been delivered to the client.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | if context is null or has no event listener, already subscribed, or some non specified error is found |
nSecurityException | if the subject does not have the correct permissions |
nQueueAsyncReader com.pcbsys.nirvana.client.nQueue.createAsyncReaderPrevious | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous queue reader.
This is identical to createAsyncReader() except that it will remove and add the reader anew, if they were already subscribed.
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSecurityException | if the subject does not have the correct permissions |
nQueueAsyncTransactionReader com.pcbsys.nirvana.client.nQueue.createAsyncTransactionalReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous Transactional queue reader.
This is similar in operation to the Asynchronous model, except the server does not auto acknowledge the events, this enables the client to perform commit()
or rollback()
operations. The server will stop delivering events to this client once the WindowSize
has been reached, the client will need to call either commit()
or rollback()
before events are delivered again.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | if context is null or has no event listener, already subscribed, or some non specified error is found |
nSecurityException | if the subject does not have the correct permissions |
nQueueAsyncTransactionReader com.pcbsys.nirvana.client.nQueue.createAsyncTransactionalReaderPrevious | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException, nSecurityException |
Creates an Asynchronous Transactional queue reader.
This is identical to createAsyncTransactional Reader() except that it will remove and add the reader anew, if they were already subscribed.
nIllegalArgumentException | if context is null or has no event listener, or some non specified error is found |
nSecurityException | if the subject does not have the correct permissions |
nQueueSyncFragmentReader com.pcbsys.nirvana.client.nQueue.createFragmentReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException |
Creates a Synchronous queue reader that supports fragmented events.
Here the client will call pop()
whenever the client wants to retrieve an event from the server. The server will automatically acknowledge that the client has received this event. The only difference with the nQueueSyncReader is that the pop()
method here will only return an event after all fragments have been received.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nQueueSyncReader com.pcbsys.nirvana.client.nQueue.createReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException |
Creates a Synchronous queue reader.
Here the client will call pop()
whenever the client wants to retrieve an event from the server. The server will automatically acknowledge that the client has received this event.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nQueueSyncTransactionFragmentReader com.pcbsys.nirvana.client.nQueue.createTransactionalFragmentReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException |
Creates a Synchronous Transaction queue reader that supports fragmented events.
This is similar in operation to the Synchronous model, except the server does not auto acknowledge the events, this enables the client to perform commit()
or rollback()
operations. The only difference with the nQueueSyncTransactionReader is that the pop()
method here will only return an event after all fragments have been received.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nQueueSyncTransactionReader com.pcbsys.nirvana.client.nQueue.createTransactionalReader | ( | final nQueueReaderContext | context | ) | throws nIllegalArgumentException |
Creates a Synchronous Transaction queue reader.
This is similar in operation to the Synchronous model, except the server does not auto acknowledge the events, this enables the client to perform commit()
or rollback()
operations.
context | contains the readers context to be used during construction of the reader |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
|
static |
This call will release any outstanding resources on the server and close the reader.
Any future calls to this object will result in an nIllegalStateException being raised.
reader | The reader to close |
nUnexpectedResponseException | if the server returns a response that was not expected |
nSessionNotConnectedException | if the session is currently not connected to the server |
nRequestTimedOutException | if the request did not receive a response within the timeout period |
nSessionPausedException | The session is currently paused |
|
static |
This call will close local reader resources but remain subscribed at the server Any future calls to this object will work unless destroyReader() is called.
reader | The reader to close |
nUnexpectedResponseException | if the server returns a response that was not expected |
nSessionNotConnectedException | if the session is currently not connected to the server |
nRequestTimedOutException | if the request did not receive a response within the timeout period |
nQueueDetails com.pcbsys.nirvana.client.nQueue.getDetails | ( | ) | throws nSecurityException, nChannelNotFoundException, nSessionNotConnectedException, nSessionPausedException, nRequestTimedOutException, nUnexpectedResponseException |
Used to collect the current queue details.
nSecurityException | Client is not authorized to perform the request |
nChannelNotFoundException | The Queue does not exist |
nSessionNotConnectedException | Client is not currently connected to the server |
nRequestTimedOutException | The server did not respond within the client timeout |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused |
String com.pcbsys.nirvana.client.nQueue.getName | ( | ) |
Gets the name of this queue.
com.pcbsys.nirvana.client.nChannelAttributes com.pcbsys.nirvana.client.nQueue.getQueueAttributes | ( | ) |
This method will return the nChannelAttributes associated with the nQueue object.
long com.pcbsys.nirvana.client.nQueue.push | ( | final nConsumeEvent | e | ) | throws nIllegalArgumentException, nSessionPausedException, nSecurityException, nRequestTimedOutException, nSessionNotConnectedException, nMaxBufferSizeExceededException |
Pushes an event on to the queue.
e | nConsumeEvent to push |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSecurityException | If your not authorized to publish to the queue |
nRequestTimedOutException | If the server failed to respond |
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nMaxBufferSizeExceededException | is thrown when elements of the event being sent exceed the connection's max buffer size |
void com.pcbsys.nirvana.client.nQueue.push | ( | String | tag, |
Document | adom | ||
) | throws nSessionNotConnectedException, nSessionPausedException, nIllegalArgumentException, nSecurityException, nMaxBufferSizeExceededException |
Publishes the specified XML DOM document to this queue with the specified tag.
tag | a string specifying the event tag to be used |
adom | an XML DOM document object specifying the XML document to be published to this queue |
nSecurityException | is thrown if the caller has insufficient permissions |
nSessionNotConnectedException | The session is not currently connected to the server |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused |
nMaxBufferSizeExceededException | is thrown when elements of the event being sent exceed the connection's max buffer size |
void com.pcbsys.nirvana.client.nQueue.push | ( | String | tag, |
Document | adom, | ||
nMessageSigner | signer | ||
) | throws nSessionNotConnectedException, nSessionPausedException, nIllegalArgumentException, nSecurityException, nMaxBufferSizeExceededException |
Publishes the specified XML DOM document to this queue with the specified tag.
tag | a string specifying the event tag to be used |
adom | an XML DOM document object specifying the XML document to be published to this queue |
signer | Event Signer class to use to sign the event |
nSecurityException | is thrown if the caller has insufficient permissions |
nSessionNotConnectedException | The session is not currently connected to the server |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused |
nMaxBufferSizeExceededException | is thrown when elements of the event being sent exceed the connection's max buffer size |
long com.pcbsys.nirvana.client.nQueue.push | ( | final nConsumeEvent | e, |
final nMessageSigner | signer | ||
) | throws nIllegalArgumentException, nSessionPausedException, nSecurityException, nRequestTimedOutException, nSessionNotConnectedException, nMaxBufferSizeExceededException |
Pushes an event on to the queue.
e | nConsumeEvent to push |
signer | This object will be used to sign the event prior to it being placed on to the queue |
nIllegalArgumentException | This exception is raised if there is any issues with any of the arguments used by this method. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSecurityException | If your not authorized to publish to the queue |
nRequestTimedOutException | If the server failed to respond |
nSessionNotConnectedException | Client is not currently connected to the server |
nSessionPausedException | The session is currently paused |
nMaxBufferSizeExceededException | is thrown when elements of the event being sent exceed the connection's max buffer size |
void com.pcbsys.nirvana.client.nQueue.removeConnectionListener | ( | nChannelConnectionListener | listener | ) | throws nSessionPausedException, nUnexpectedResponseException, nRequestTimedOutException, nSessionNotConnectedException |
Removes the connection listener to this queue.
listener | remove the listener |
nRequestTimedOutException | if the request exceeded the timeout value |
nSessionNotConnectedException | The session is not currently connected to the server |
nUnexpectedResponseException | Received a response from the server for which we can not deal with, see the message for further information. One condition of this is if this object has been invalidated and no longer can be utilised, this can occur if a delete request has been issued to the connected server. |
nSessionPausedException | The session is currently paused, please resume |
int com.pcbsys.nirvana.client.nQueue.size | ( | ) |
Returns the number of events waiting in the queue.