C++ API Library Reference  4.3.2-74-ge1d4cca
Classes | Public Functions | List of all members
SessionManager Class Reference

The SessionManager class is used to manage the flow of responses back to clients. The methods are mostly for internal use by the SDK.

Of particular interest are the methods addSessionConnectedHandler and addSessionDisconnectedHandler; they allow you to listen for connection and disconnection events and respond accordingly. This can prove especially useful in collaboration scenarios, to determine which users are connected at any point in time.

Public Functions

virtual void AddResponseProvider (Guid sessionId, IResponseProvider *pProvider)
 
void CreateSession (Guid sessionId, Typeless const &command)
 
bool DestroySession (Guid sessionId, Typeless const &command)
 
virtual bool DestroySession (Guid sessionId)
 
virtual bool RemoveResponseProvider (Guid sessionId, IResponseProvider *pProvider)
 
bool SessionRequestReceived (Guid sessionId)
 
Constructors and Destructors
 SessionManager ()
 
 ~SessionManager ()
 
Events
 DEFINE_EVENT (SessionConnected, ISessionManager &, SessionEventArgs const &)
 
 DEFINE_EVENT (SessionDisconnected, ISessionManager &, SessionEventArgs const &)
 
 DEFINE_EVENT (FlowControlChanged, SessionManager &, FlowControlEventArgs const &)
 
Events
 DEFINE_PURE_VIRTUAL_EVENT (SessionConnected, ISessionManager &, SessionEventArgs const &)
 
 DEFINE_PURE_VIRTUAL_EVENT (SessionDisconnected, ISessionManager &, SessionEventArgs const &)
 

Usage Description

void AddResponseProvider ( Guid  sessionId,
IResponseProvider pProvider 
)
virtual

Adds the specified response provider to a session.

Parameters
sessionIdThe unique identifier of the session to which will be added the response provider.
pProviderThe response provider to add.

Implements ISessionManager.

void CreateSession ( Guid  sessionId,
Typeless const &  command 
)

Creates a new session.

Parameters
sessionIdThe unique identifier of the newly created session.
commandThe command that caused the session creation.
DEFINE_EVENT ( SessionConnected  ,
ISessionManager ,
SessionEventArgs const &   
)

This event is triggered when a session gets connected to the service.

DEFINE_EVENT ( SessionDisconnected  ,
ISessionManager ,
SessionEventArgs const &   
)

This event is triggered when a session gets disconnected from the service.

DEFINE_EVENT ( FlowControlChanged  ,
SessionManager ,
FlowControlEventArgs const &   
)

This event is triggered when flow control changes for a session.

DEFINE_PURE_VIRTUAL_EVENT ( SessionConnected  ,
ISessionManager ,
SessionEventArgs const &   
)
inherited

This event is triggered when a session gets connected to the service.

DEFINE_PURE_VIRTUAL_EVENT ( SessionDisconnected  ,
ISessionManager ,
SessionEventArgs const &   
)
inherited

This event is triggered when a session gets disconnected from the service.

bool DestroySession ( Guid  sessionId,
Typeless const &  command 
)

Destroys a connected session. Will return true if the specified session was connected and destroyed, or false if there was no such session.

Parameters
sessionIdThe unique identifier of the session to destroy.
commandThe command that caused the session destruction.
bool DestroySession ( Guid  sessionId)
virtual

Destroys a connected session. Will return true if the specified session was connected and destroyed, or false if there was no such session.

Parameters
sessionIdThe unique identifier of the session to destroy.

Implements ISessionManager.

bool RemoveResponseProvider ( Guid  sessionId,
IResponseProvider pProvider 
)
virtual

Removes the specified response provider from a session. Will return true if the response provider was successfully removed or false otherwise.

Parameters
sessionIdThe unique identifier of the session from which to remove the response provider.
pProviderThe response provider to remove.

Implements ISessionManager.

bool SessionRequestReceived ( Guid  sessionId)

Notifies that a session request was received. Returns true if the session exists, otherwise returns false.