qpid::SessionState Class Reference

Support for session idempotence barrier and resume as defined in AMQP 0-10. More...

#include <SessionState.h>

Inheritance diagram for qpid::SessionState:

Inheritance graph
[legend]
Collaboration diagram for qpid::SessionState:

Collaboration graph
[legend]

List of all members.

Public Types

typedef boost::iterator_range
< ReplayList::iterator > 
ReplayRange

Public Member Functions

 SessionState (const SessionId &=SessionId(), const Configuration &=Configuration())
bool hasState () const
const SessionIdgetId () const
uint32_t getTimeout () const
void setTimeout (uint32_t seconds)
bool operator== (const SessionId &other) const
bool operator== (const SessionState &other) const
virtual void senderRecord (const framing::AMQFrame &f)
 Record frame f for replay.
virtual bool senderNeedFlush () const
virtual void senderRecordFlush ()
 Called when flush for confirmed and completed commands is sent to peer.
virtual bool senderNeedKnownCompleted () const
 True if we should reply to the next incoming completed command.
virtual void senderRecordKnownCompleted ()
 Called when knownCompleted is sent to peer.
virtual void senderConfirmed (const SessionPoint &confirmed)
 Called when the peer confirms up to comfirmed.
virtual void senderCompleted (const SequenceSet &commands)
 Called when the peer indicates commands completed.
virtual SessionPoint senderGetCommandPoint ()
 Point from which the next new (not replayed) data will be sent.
virtual SequenceSet senderGetIncomplete () const
 Set of outstanding incomplete commands.
virtual SessionPoint senderGetReplayPoint () const
 Point from which we can replay.
virtual ReplayRange senderExpected (const SessionPoint &expected)
 Peer expecting commands from this point.
virtual void receiverSetCommandPoint (const SessionPoint &point)
 Set the command point.
virtual bool receiverRecord (const framing::AMQFrame &f)
 Returns true if frame should be be processed, false if it is a duplicate.
virtual void receiverCompleted (SequenceNumber command, bool cumulative=false)
 Command completed locally.
virtual void receiverKnownCompleted (const SequenceSet &commands)
 Peer has indicated commands are known completed.
virtual bool receiverNeedKnownCompleted () const
 True if the next completed control should set the timely-reply argument to request a knonw-completed response.
virtual const SessionPointreceiverGetExpected () const
 Get the incoming command point.
virtual const SessionPointreceiverGetReceived () const
 Get the received high-water-mark, may be > getExpected() during replay.
virtual const SequenceSet & receiverGetUnknownComplete () const
 Completed received commands that the peer may not know about.
virtual const SequenceSet & receiverGetIncomplete () const
 Incomplete received commands.
virtual SequenceNumber receiverGetCurrent () const
 ID of the command currently being handled.
virtual void setState (const SequenceNumber &replayStart, const SequenceNumber &sendCommandPoint, const SequenceSet &sentIncomplete, const SequenceNumber &expected, const SequenceNumber &received, const SequenceSet &unknownCompleted, const SequenceSet &receivedIncomplete)
 Set the state variables, used to create a session that will resume from some previously established point.


Detailed Description

Support for session idempotence barrier and resume as defined in AMQP 0-10.

We only issue/use contiguous confirmations, out-of-order confirmation is ignored. Out of order completion is fully supported.

Raises NotImplemented if the command point is set greater than the max currently received command data, either explicitly via session.command-point or implicitly via session.gap.

Partial replay is not supported, replay always begins on a command boundary, and we never confirm partial commands.

The SessionPoint data structure does store offsets so this class could be extended to support partial replay without source-incompatbile API changes.

Definition at line 73 of file SessionState.h.


Member Function Documentation

virtual void qpid::SessionState::senderRecord ( const framing::AMQFrame &  f  )  [virtual]

Record frame f for replay.

Should not be called during replay.

virtual bool qpid::SessionState::senderNeedFlush (  )  const [virtual]

Returns:
true if we should send flush for confirmed and completed commands.

virtual void qpid::SessionState::senderRecordFlush (  )  [virtual]

Called when flush for confirmed and completed commands is sent to peer.

virtual void qpid::SessionState::senderRecordKnownCompleted (  )  [virtual]

Called when knownCompleted is sent to peer.

virtual void qpid::SessionState::senderConfirmed ( const SessionPoint confirmed  )  [virtual]

Called when the peer confirms up to comfirmed.

virtual SessionPoint qpid::SessionState::senderGetCommandPoint (  )  [virtual]

Point from which the next new (not replayed) data will be sent.

virtual SessionPoint qpid::SessionState::senderGetReplayPoint (  )  const [virtual]

Point from which we can replay.

virtual ReplayRange qpid::SessionState::senderExpected ( const SessionPoint expected  )  [virtual]

Peer expecting commands from this point.

Returns:
Range of frames to be replayed.

virtual void qpid::SessionState::receiverSetCommandPoint ( const SessionPoint point  )  [virtual]

Set the command point.

virtual bool qpid::SessionState::receiverRecord ( const framing::AMQFrame &  f  )  [virtual]

Returns true if frame should be be processed, false if it is a duplicate.

virtual const SequenceSet& qpid::SessionState::receiverGetUnknownComplete (  )  const [virtual]

Completed received commands that the peer may not know about.

virtual const SequenceSet& qpid::SessionState::receiverGetIncomplete (  )  const [virtual]

Incomplete received commands.

virtual SequenceNumber qpid::SessionState::receiverGetCurrent (  )  const [virtual]

ID of the command currently being handled.


The documentation for this class was generated from the following file:

Generated on Thu Oct 16 13:37:58 2008 for Qpid by  doxygen 1.5.6