Apama Capital Markets Foundation  10.7.0.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
com::apama::session::SessionManager Class Referenceabstract

#include <Connectivity_SessionManager.h>

Public Member Functions

 SessionManager (Logger &logger)
 
virtual void setHostSide (HostSide *hostSideptr)=0
 
virtual void addSession (const std::string &chainName, const std::string &sessionName, const std::string &description, SessionInterface *sessionHandler)=0
 
virtual void RegisterSessions (int interval=5)=0
 
virtual void RegisterSession (const std::string &sessionName)=0
 
virtual bool HasCapability (const std::string &sessionName, const std::string &capability)=0
 
virtual void DeleteSessionByName (const std::string &sessionName)=0
 
virtual void DeleteSessionById (int64_t sourceId)=0
 
virtual int64_t getSessionId (const std::string &sessionName)=0
 
virtual std::string getSessionName (int64_t sessionId)=0
 
virtual void Start ()=0
 
virtual void Stop ()=0
 
virtual void Clear ()=0
 
virtual void SetSessionStateByName (const std::string &sessionName, AP_SESSION_State state, bool generateNewId=false)=0
 
virtual void SetSessionStateById (int64_t sourceId, AP_SESSION_State state, bool usePreviousGenerationId=false)=0
 
virtual AP_SESSION_State GetSessionStateByName (const std::string &sessionName)=0
 
virtual AP_SESSION_State GetSessionStateById (int64_t sourceId)=0
 
virtual void SessionStartSuccess (int64_t sourceId)=0
 
virtual void SessionStartError (int64_t sourceId, const std::string &errMsg)=0
 
virtual void SessionStopSuccess (int64_t sourceId)=0
 
virtual void SessionStopError (int64_t sourceId, const std::string &errMsg)=0
 
virtual void SessionReconfigureSuccess (int64_t sourceId)=0
 
virtual void SessionReconfigureError (int64_t sourceId, const std::string &errMsg)=0
 
virtual bool ProcessMessage (Message &msg)=0
 

Detailed Description

SessionManager class which contains all the methods to drive session related operations like add/delete

Constructor & Destructor Documentation

com::apama::session::SessionManager::SessionManager ( Logger &  logger)
inline

SessionManager constructor which takes logger object instance as input

Parameters
loggerLogger instance of connectivity plugin transport/codec.

Member Function Documentation

virtual void com::apama::session::SessionManager::addSession ( const std::string &  chainName,
const std::string &  sessionName,
const std::string &  description,
SessionInterface sessionHandler 
)
pure virtual

Add session for registration.

RegisterSession() or RegisterSessions() has to be called to actually register any added sessions.

Parameters
chainNameThe name of the transport to be added.
sessionNameThe name of the session to be added.
descriptionThe description of the session to be added.
sessionHandlerInstance of SessionInterface
virtual void com::apama::session::SessionManager::Clear ( )
pure virtual

Delete all registered sessions.

virtual void com::apama::session::SessionManager::DeleteSessionById ( int64_t  sourceId)
pure virtual

Delete a specific session by Id.

Parameters
sourceIdThe id of the session to delete.
virtual void com::apama::session::SessionManager::DeleteSessionByName ( const std::string &  sessionName)
pure virtual

Delete a specific session by Name.

Parameters
sessionNameThe name of the session to delete.
virtual int64_t com::apama::session::SessionManager::getSessionId ( const std::string &  sessionName)
pure virtual

Get the Id of a session by its Name.

Parameters
sessionNameThe name of the session to get the Id for.
Returns
The Id of the session or -1 if not found
virtual std::string com::apama::session::SessionManager::getSessionName ( int64_t  sessionId)
pure virtual

Get the name of a session by its Id.

Parameters
sessionIdThe Id of the session to get the name for.
Returns
The name of the session or NULL if not found
virtual AP_SESSION_State com::apama::session::SessionManager::GetSessionStateById ( int64_t  sourceId)
pure virtual

Get a Sessions State by Id.

Parameters
sourceIdThe Id of the session to get the state.
Returns
The session state.
virtual AP_SESSION_State com::apama::session::SessionManager::GetSessionStateByName ( const std::string &  sessionName)
pure virtual

Get a Sessions State by name.

Parameters
sessionNameThe name of the session to get the state.
Returns
The session state.
virtual bool com::apama::session::SessionManager::HasCapability ( const std::string &  sessionName,
const std::string &  capability 
)
pure virtual

Query if a session has a capability.

Parameters
sessionNameThe name of the session to register.
capabilityThe name of the capability to query for.
Returns
True if session has the capability, else false.
virtual bool com::apama::session::SessionManager::ProcessMessage ( Message &  msg)
pure virtual

Process an upstream session messge.

Parameters
msgThe session message to process.
virtual void com::apama::session::SessionManager::RegisterSession ( const std::string &  sessionName)
pure virtual

Register a specific session.

Parameters
sessionNameThe name of the session to register.
virtual void com::apama::session::SessionManager::RegisterSessions ( int  interval = 5)
pure virtual

Register all session that have been added.

Parameters
intervalRegister session interval.
virtual void com::apama::session::SessionManager::SessionReconfigureError ( int64_t  sourceId,
const std::string &  errMsg 
)
pure virtual

Callback when a Session fails to reconfigure in response to SessionInterface::onSessionReconfigure().

Parameters
sourceIdThe Id of the session that failed to reconfigure.
errMsgAn error message explaining why the session failed to reconfigure.
virtual void com::apama::session::SessionManager::SessionReconfigureSuccess ( int64_t  sourceId)
pure virtual

Callback when a Session is successfully reconfigured in response to SessionInterface::onSessionReconfigure().

Parameters
sourceIdThe Id of the session that was reconfigured.
virtual void com::apama::session::SessionManager::SessionStartError ( int64_t  sourceId,
const std::string &  errMsg 
)
pure virtual

Callback when a Session fails to start in response to SessionInterface::onSessionStart().

Parameters
sourceIdThe Id of the session that failed to start.
errMsgAn error message explaining why the session failed to start.
virtual void com::apama::session::SessionManager::SessionStartSuccess ( int64_t  sourceId)
pure virtual

Callback when a Session is successfully started in response to SessionInterface::onSessionStart().

Parameters
sourceIdThe Id of the session that was started.
virtual void com::apama::session::SessionManager::SessionStopError ( int64_t  sourceId,
const std::string &  errMsg 
)
pure virtual

Callback when a Session fails to stop in response to SessionInterface::onSessionStop().

Parameters
sourceIdThe Id of the session that failed to stop.
errMsgAn error message explaining why the session failed to stop.
virtual void com::apama::session::SessionManager::SessionStopSuccess ( int64_t  sourceId)
pure virtual

Callback when a Session is successfully stopped in response to SessionInterface::onSessionStop().

Parameters
sourceIdThe Id of the session that was stopped.
virtual void com::apama::session::SessionManager::setHostSide ( HostSide *  hostSideptr)
pure virtual

setHostSide method

This method should be called before adding and registering any session. This will be used to send messages towards host(correlator)

Parameters
hostSideptrHostside pointer provided by transport/codec.
virtual void com::apama::session::SessionManager::SetSessionStateById ( int64_t  sourceId,
AP_SESSION_State  state,
bool  usePreviousGenerationId = false 
)
pure virtual

Set a Sessions State by Id.

Parameters
sourceIdThe id of the session to set the state.
stateThe state to set the session to.
usePreviousGenerationIdWhether to generate a new connection Id.
virtual void com::apama::session::SessionManager::SetSessionStateByName ( const std::string &  sessionName,
AP_SESSION_State  state,
bool  generateNewId = false 
)
pure virtual

Set a Sessions State by name.

Parameters
sessionNameThe name of the session to set the state.
stateThe state to set the session to.
generateNewIdWhether to generate a new connection Id.
virtual void com::apama::session::SessionManager::Start ( )
pure virtual

Start the session interface. Used during start() in the transport.

virtual void com::apama::session::SessionManager::Stop ( )
pure virtual

Stop the session interface. Used during stop() in the transport.


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