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

typedef std::vector< AMQFrame > Replay
 SUSPENDED
 Suspended, detached from any channel.
 RESUMING
 Resuming: waiting for initial ack from peer.
 ATTACHED
 Attached to channel and operating normally.
enum  State { SUSPENDED, RESUMING, ATTACHED }
 States of a session. More...

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 () const
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, e.g.
SequenceNumber getLastSent () const
SequenceNumber getLastReceived () const

Detailed Description

Session state common to client and broker.

Stores replay frames, implements session ack/resume protcools.

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


Member Enumeration Documentation

enum qpid::framing::SessionState::State

States of a session.

Enumerator:
SUSPENDED  Suspended, detached from any channel.
RESUMING  Resuming: waiting for initial ack from 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 unacked frames have been received/sent.
N=0 disables voluntary send/solict 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 seq. number.

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

Frames to replay.

Precondition:
getState()==ATTACHED

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, e.g.

to respond 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.

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.


The documentation for this class was generated from the following file:
Generated on Thu Apr 10 11:09:09 2008 for Qpid by  doxygen 1.4.7