com::pcbsys::nirvana::client::nQueueSyncReader Class Reference

This class provides the client with a synchronous interface into a Nirvana Queue. More...

#include <nQueueSyncReader.h>

Inheritance diagram for com::pcbsys::nirvana::client::nQueueSyncReader:
com::pcbsys::nirvana::client::nQueueReader com::pcbsys::nirvana::client::nQueueSyncTransactionReader

Public Member Functions

virtual void close ()
 Close the subscription, and notify the server.
 
virtual void closeLocally ()
 Close the subscription, but do not notify the server.
 
nConsumeEventpop ()
 This method places the client on the queue and will block until an event is placed onto the queue. More...
 
nConsumeEventpop (longlong timeout)
 This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More...
 
nConsumeEventpop (longlong timeout, std::string selector)
 This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More...
 
std::list< nConsumeEvent * > * popEvents (int prefetchSize)
 This method places the client on the queue and will block until an event is placed onto the queue. More...
 
std::list< nConsumeEvent * > * popEvents (int prefetchSize, longlong timeout)
 This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More...
 
std::list< nConsumeEvent * > * popEvents (int prefetchSize, longlong timeout, std::string selector)
 This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires. More...
 
- Public Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
void destroyReader ()
 This call will release any outstanding resources on the server and close the reader. More...
 
void destroyReaderLocally ()
 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...
 
bool hasConsumedEvents ()
 Method to see whether the reader has consumed any events. More...
 
bool isClosed ()
 When a reader is closed, the physical subscription is closed at the server. More...
 
bool isClosedLocally ()
 A reader can be closed, but the physical subscription queue is not closed at the server. More...
 
nConsumeEvent ** peek (nQueuePeekContext *pContext, int &nEvent)
 Performs a non destructive read. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
static nQueuePeekContextcreateContext (int windowSize=0, const std::string &selector="")
 Creates a Queue Peek Context, which is used to traverse the queue. More...
 
- Protected Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
 nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext)
 Creates a reader for the specified queue using the given reader context. The reader will have its reader unique ID assigned implicitly. More...
 
 nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext, longlong readerUniqueId)
 Creates a reader for the specified queue using the given reader context and reader unique identifier. Note: This constructor must only be used for asynchronous readers, which require special reader ID assignment, for all other cases use the constructor which implicitly assigns the reader unique identifier. More...
 
- Protected Attributes inherited from com::pcbsys::nirvana::client::nQueueReader
longlong m_readerUniqueId
 An identifier that uniquely identifies the reader which performs this queue operation within the session. This will be paired with the connection id to uniquely identify the reader within the Universal Messaging server. Note: This should be considered final, it must be set during reader creation and not modified afterwards. More...
 

Detailed Description

This class provides the client with a synchronous interface into a Nirvana Queue.

Events will only be delivered to this client when a call to pop is made.

Member Function Documentation

nConsumeEvent* com::pcbsys::nirvana::client::nQueueSyncReader::pop ( )

This method places the client on the queue and will block until an event is placed onto the queue.

Returns
The popped event or null if the timeout expired
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error
nConsumeEvent* com::pcbsys::nirvana::client::nQueueSyncReader::pop ( longlong  timeout)

This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires.

If the timeout expires it will return null

Parameters
timeoutTime to wait in milliseconds for an event
Returns
The popped event or null if the timeout expired
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error
nConsumeEvent* com::pcbsys::nirvana::client::nQueueSyncReader::pop ( longlong  timeout,
std::string  selector 
)

This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires.

If the timeout expires it will return null

Parameters
timeoutTime to wait in milliseconds for an event
selectorthe selection string used to filter events being popped
Returns
The popped event or null if the timeout expired
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error
std::list<nConsumeEvent*>* com::pcbsys::nirvana::client::nQueueSyncReader::popEvents ( int  prefetchSize)

This method places the client on the queue and will block until an event is placed onto the queue.

Parameters
prefetchSizethe number of events being popped
Returns
a list<nConsumeEvent*> with popped events
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error
std::list<nConsumeEvent*>* com::pcbsys::nirvana::client::nQueueSyncReader::popEvents ( int  prefetchSize,
longlong  timeout 
)

This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires.

If the timeout expires it will return null

Parameters
prefetchSizethe number of events being popped
timeoutTime to wait in milliseconds for an event
Returns
a list<nConsumeEvent*> with popped events or null if the timeout expired
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error
std::list<nConsumeEvent*>* com::pcbsys::nirvana::client::nQueueSyncReader::popEvents ( int  prefetchSize,
longlong  timeout,
std::string  selector 
)

This method places the client on the queue and will block until an event is placed onto the queue or the specified timeout expires.

If the timeout expires it will return null

Parameters
prefetchSizethe number of events being popped
timeoutTime to wait in milliseconds for an event
selectorthe selection string used to filter events being popped
Returns
a list<nConsumeEvent*> with popped events or null if the timeout expired
Exceptions
nSessionNotConnectedExceptionClient is not currently connected to the server
nSecurityExceptionIf your not authorized to perform the operation on the queue
nSessionPausedExceptionThe session is currently paused
nIllegalStateExceptionThe operation could not complete because of a session/connection error