qpid::framing::SessionState Class Reference

Session state common to client and broker. More...

#include <SessionState.h>

Inheritance diagram for qpid::framing::SessionState:

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

Collaboration graph
[legend]

List of all members.

Public Types

enum  State { SUSPENDED, RESUMING, ATTACHED }
 States of a session. More...
typedef std::vector< AMQFrame > Replay

Public Member Functions

 SessionState (uint32_t ackInterval, bool enableReplay=true, const framing::Uuid &id=framing::Uuid(true))
 Create a newly opened active session.
 SessionState (const framing::Uuid &id=framing::Uuid(true))
 Create a non-resumable session.
const framing::UuidgetId () const
State getState ()
boost::optional< SequenceNumberreceived (const AMQFrame &)
 Received incoming L3 frame.
bool sent (const AMQFrame &)
 Sent outgoing L3 frame.
void receivedAck (SequenceNumber)
 Received normal incoming ack.
Replay replay ()
 Frames to replay.
void suspend ()
 Suspend the session.
SequenceNumber resuming ()
 Start resume protocol for the session.
SequenceNumber sendingAck ()
 About to send an unscheduled ack, for example, responding to a solicit-ack.
SequenceNumber getLastSent () const
SequenceNumber getLastReceived () const


Detailed Description

Session state common to client and broker.

Stores replay frames, implements session ack/resume protocols.

A SessionState is always associated with an _open_ session (attached or suspended) it is destroyed when the session is closed.


Member Enumeration Documentation

States of a session.

Enumerator:
SUSPENDED  Suspended, detached from any channel.
RESUMING  Resuming, waiting for an initial ack from a peer.
ATTACHED  Attached to channel and operating normally.


Constructor & Destructor Documentation

qpid::framing::SessionState::SessionState ( uint32_t  ackInterval,
bool  enableReplay = true,
const framing::Uuid id = framing::Uuid(true) 
)

Create a newly opened active session.

Parameters:
ackInterval send/solicit an ack whenever N unacknowledged frames have been received/sent.
N=0 disables voluntary send/solicit ack.

qpid::framing::SessionState::SessionState ( const framing::Uuid id = framing::Uuid(true)  ) 

Create a non-resumable session.

Does not store session frames, never volunteers ack or solicit-ack.


Member Function Documentation

boost::optional<SequenceNumber> qpid::framing::SessionState::received ( const AMQFrame &   ) 

Received incoming L3 frame.

Returns:
SequenceNumber if an ack should be sent, empty otherwise. SessionState assumes that acks are sent whenever it returns a sequence number.

bool qpid::framing::SessionState::sent ( const AMQFrame &   ) 

Sent outgoing L3 frame.

Returns:
true if solicit-ack should be sent. Note the SessionState assumes that a solicit-ack is sent every time it returns true.

void qpid::framing::SessionState::receivedAck ( SequenceNumber   ) 

Received normal incoming ack.

Replay qpid::framing::SessionState::replay (  ) 

Frames to replay.

Precondition:
getState()==ATTACHED

void qpid::framing::SessionState::suspend (  ) 

Suspend the session.

SequenceNumber qpid::framing::SessionState::resuming (  ) 

Start resume protocol for the session.

Returns:
sequence number to ack immediately.

SequenceNumber qpid::framing::SessionState::sendingAck (  ) 

About to send an unscheduled ack, for example, responding to a solicit-ack.

Note: when received() returns a sequence number, this function should not be called. SessionState assumes that the ack is sent every time received() returns a sequence number.


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

Generated on Thu May 15 22:24:43 2008 for Qpid by  doxygen 1.5.5