com.pcbsys.nirvana.client.nQueueReaderContext Class Reference

This class is used to construct a Queue Reader. More...

Public Member Functions

bool canMaintainPriority ()
 Returns whether the queue has a priority order where only 1 consumer at a time will consume from the queue More...
 
nEventListener getListener ()
 Returns the current event listener being used More...
 
int getPeekBatchSize ()
 Returns the current peek batch size, used only for synchronous queue readers More...
 
string getSelector ()
 Returns the current selector that this context was constructed with, could be null. More...
 
nMessageValidator getValidator ()
 Retrieves the current message validator. More...
 
int getWindow ()
 Retrieves the current window size. More...
 
 nQueueReaderContext ()
 Default constructor, useful for creating a standard synchronous queue reader. More...
 
 nQueueReaderContext (string selector)
 This constructor supports a standard synchronous queue reader with the message selector applied. More...
 
 nQueueReaderContext (nEventListener aListener)
 This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More...
 
 nQueueReaderContext (nEventListener aListener, int windowSize)
 This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More...
 
 nQueueReaderContext (nEventListener aListener, string selector)
 This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More...
 
 nQueueReaderContext (nEventListener aListener, string selector, int windowSize)
 This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More...
 
void setListener (nEventListener listener)
 Sets the current listener. More...
 
void setMaintainPriority (bool flag)
 Sets whether the reader will observe the priority ordering where only 1 consumer will actively consume events More...
 
void setPeekBatchSize (int peekBatchSize)
 Sets the current peek batch size, used only for synchronous queue readers. More...
 
void setSelector (string selector)
 Sets the message selector. More...
 
void setValidator (nMessageValidator validator)
 Sets the current message validator. More...
 
void setWindow (int window)
 Sets the window size. More...
 

Detailed Description

This class is used to construct a Queue Reader.

Constructor & Destructor Documentation

com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( )

Default constructor, useful for creating a standard synchronous queue reader.

com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( string  selector)

This constructor supports a standard synchronous queue reader with the message selector applied.

Parameters
selectorMessage selector to be applied to the events prior to being delivered to the client
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( nEventListener  aListener)

This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.

When applied as an asynchronous queue reader the window size will default to 1.

Parameters
aListenerAsynchronous callback object
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( nEventListener  aListener,
int  windowSize 
)

This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.

Parameters
aListenerAsynchronous callback object
windowSizeNumber of events that the server will deliver prior to expecting a commit or rollback
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( nEventListener  aListener,
string  selector 
)

This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.

The message selector will be applied to all events prior to being delivered to the client from the server.

Parameters
aListenerAsynchronous callback object
selectorMessage selector to be applied to the events prior to being delivered to the client
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext ( nEventListener  aListener,
string  selector,
int  windowSize 
)

This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.

The message selector will be applied to all events prior to being delivered to the client from the server.

Parameters
aListenerAsynchronous callback object
selectorMessage selector to be applied to the events prior to being delivered to the client
windowSizeNumber of events that the server will deliver prior to expecting a commit or rollback

Member Function Documentation

bool com.pcbsys.nirvana.client.nQueueReaderContext.canMaintainPriority ( )

Returns whether the queue has a priority order where only 1 consumer at a time will consume from the queue

Returns
True if priority is set
nEventListener com.pcbsys.nirvana.client.nQueueReaderContext.getListener ( )

Returns the current event listener being used

Returns
current listener
int com.pcbsys.nirvana.client.nQueueReaderContext.getPeekBatchSize ( )

Returns the current peek batch size, used only for synchronous queue readers

Returns
the number of events per pop taken in a batch
string com.pcbsys.nirvana.client.nQueueReaderContext.getSelector ( )

Returns the current selector that this context was constructed with, could be null.

Returns
Message Selector
nMessageValidator com.pcbsys.nirvana.client.nQueueReaderContext.getValidator ( )

Retrieves the current message validator.

This could be null.

Returns
Message Validator
int com.pcbsys.nirvana.client.nQueueReaderContext.getWindow ( )

Retrieves the current window size.

This is the number of events the server will send prior to expecting an rollback or a commit. No more events will be sent when this number is reached an no call is made.

Returns
current window size
void com.pcbsys.nirvana.client.nQueueReaderContext.setListener ( nEventListener  listener)

Sets the current listener.

This has no effect if the reader has been created prior to calling this method. The reader will need to be destroyed and recreated.

Parameters
listenerEvent listener.
void com.pcbsys.nirvana.client.nQueueReaderContext.setMaintainPriority ( bool  flag)

Sets whether the reader will observe the priority ordering where only 1 consumer will actively consume events

Parameters
flagtrue / false to set the priority flag
void com.pcbsys.nirvana.client.nQueueReaderContext.setPeekBatchSize ( int  peekBatchSize)

Sets the current peek batch size, used only for synchronous queue readers.

Parameters
peekBatchSizethe number of events to fetch when doing a pop
void com.pcbsys.nirvana.client.nQueueReaderContext.setSelector ( string  selector)

Sets the message selector.

If the reader has already been created this method does nothing. If the reader is an asynchronous queue reader then the existing reader must be destroyed and recreated before this selector will take effect else the next pop will take this into account

Parameters
selectora Message selector
void com.pcbsys.nirvana.client.nQueueReaderContext.setValidator ( nMessageValidator  validator)

Sets the current message validator.

It has no effect if the reader is an asynchronous queue reader and the reader will need to be destroyed and recreated prior to this taking effect. If the reader is an synchronous queue reader the next event popped will use the message validator.

Parameters
validatorThe message validator to use.
void com.pcbsys.nirvana.client.nQueueReaderContext.setWindow ( int  window)

Sets the window size.

This function has no effect on synchronous readers and if the asynchronous reader is constructed prior to this method then it will not take effect until the reader is destroyed and recreated.

Parameters
windowthe window size to use