com.pcbsys.nirvana.client.nQueueSyncTransactionReader Class Reference

This reader provides a synchronous queue reader model. More...

Inheritance diagram for com.pcbsys.nirvana.client.nQueueSyncTransactionReader:

com.pcbsys.nirvana.client.nQueueSyncReader com.pcbsys.nirvana.client.nQueueTransactionReader com.pcbsys.nirvana.client.nQueueReader

Public Member Functions

final void commit (final long eventId) throws nSessionNotConnectedException,nSessionPausedException, nRequestTimedOutException, nIllegalStateException
 Committs all events up to the event id specified.
final void commit () throws nSessionNotConnectedException, nSessionPausedException,nRequestTimedOutException, nIllegalStateException
 Commits all received events so far.
final void rollback (final long eventId) throws nSessionNotConnectedException, nSessionPausedException,nRequestTimedOutException, nIllegalStateException
 Rollbacks all events up to the specified event id that have not been committed or rollbacked previously.
final void rollback () throws nSessionNotConnectedException,nSessionPausedException, nRequestTimedOutException, nIllegalStateException
 Rollbacks all received events that have not been committed or rollbacked previously.

Detailed Description

This reader provides a synchronous queue reader model.

Where the client can pop() events from the queue and then decide either to commit the event, ie. successfully processed it or to rollback, ie unable to process this event.

When the window size is reached and the client has yet to call commit or rollback the server will raise an exception on the pop() command until the client has called either method.


Member Function Documentation

final void com.pcbsys.nirvana.client.nQueueSyncTransactionReader.commit ( final long  eventId  )  throws nSessionNotConnectedException,nSessionPausedException, nRequestTimedOutException, nIllegalStateException

Committs all events up to the event id specified.

This means you can partially commit received events.

Parameters:
eventId Event ID to commit to, inclusive
Exceptions:
nSessionNotConnectedException Client is not currently connected to the server
nSessionPausedException The session is currently paused
nIllegalStateException The operation could not complete because of a session/connection error

final void com.pcbsys.nirvana.client.nQueueSyncTransactionReader.commit (  )  throws nSessionNotConnectedException, nSessionPausedException,nRequestTimedOutException, nIllegalStateException [virtual]

Commits all received events so far.

Exceptions:
nSessionNotConnectedException Client is not currently connected to the server
nSessionPausedException The session is currently paused
nIllegalStateException The operation could not complete because of a session/connection error

Implements com.pcbsys.nirvana.client.nQueueTransactionReader.

final void com.pcbsys.nirvana.client.nQueueSyncTransactionReader.rollback ( final long  eventId  )  throws nSessionNotConnectedException, nSessionPausedException,nRequestTimedOutException, nIllegalStateException

Rollbacks all events up to the specified event id that have not been committed or rollbacked previously.

These events are then pushed back onto the queue for redelivery.

Parameters:
eventId Event Id to rollback to, inclusive
Exceptions:
nSessionNotConnectedException Client is not currently connected to the server
nSessionPausedException The session is currently paused
nIllegalStateException The operation could not complete because of a session/connection error

final void com.pcbsys.nirvana.client.nQueueSyncTransactionReader.rollback (  )  throws nSessionNotConnectedException,nSessionPausedException, nRequestTimedOutException, nIllegalStateException [virtual]

Rollbacks all received events that have not been committed or rollbacked previously.

These events are then pushed back onto the queue for redelivery.

Exceptions:
nSessionNotConnectedException Client is not currently connected to the server
nSessionPausedException The session is currently paused
nIllegalStateException The operation could not complete because of a session/connection error

Implements com.pcbsys.nirvana.client.nQueueTransactionReader.