#include <SessionState.h>
Public Types | |
typedef boost::iterator_range < ReplayList::iterator > | ReplayRange |
Public Member Functions | |
SessionState (const SessionId &=SessionId(), const Configuration &=Configuration()) | |
bool | hasState () const |
const SessionId & | getId () 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 SessionPoint & | receiverGetExpected () const |
Get the incoming command point. | |
virtual const SessionPoint & | receiverGetReceived () 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. |
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.
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] |
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] |
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.