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

#include <Connectivity_SessionInterface.h>

Public Member Functions

 SessionInterface (Logger &logger)
 
virtual void setHostSide (HostSide *hostSide)
 
void setChainName (const std::string &chainName)
 
void setSessionName (const std::string &sessionName)
 
void setChannelName (const std::string &channelName)
 
void setDescription (const std::string &description)
 
virtual void AddSessionParams (SessionParam &param)
 
virtual void AddCapabilities (Capability &capability)
 
SessionConfigsgetSessionConfiguration ()
 
virtual void SetSessionState (AP_SESSION_State state, bool generateNewId)
 
virtual AP_SESSION_State getSessionState ()
 
virtual void onSessionStart (int64_t sourceId, map_t &configParams)=0
 
virtual void onSessionStop (int64_t sourceId)=0
 
virtual void onSessionReconfigure (int64_t sourceId, map_t &configParams)=0
 
virtual void onSessionRegistrationSuccess (const std::string &sessionName, int64_t sourceId)=0
 
virtual void onSessionRegistrationError (const std::string &sessionName)=0
 

Detailed Description

SessionInterface class which contains all the methods and callbacks for each of the session created.

Constructor & Destructor Documentation

com::apama::session::SessionInterface::SessionInterface ( Logger &  logger)

SessionInterface constructor which takes connectivity plugin transport/codec's logger object.

Adapter user should create different sessionInterface instance for different sessions.

Parameters
loggerLogger instance of connectivity plugin transport/codec.

Member Function Documentation

virtual void com::apama::session::SessionInterface::AddCapabilities ( Capability capability)
virtual

AddSessionParams method

Adapter user should add all the capability of a session using this method

Parameters
capabilityCapability instance.
virtual void com::apama::session::SessionInterface::AddSessionParams ( SessionParam param)
virtual

AddSessionParams method

Adapter user should add all the session related params using this method

Parameters
paramSessionPaaram instance.
SessionConfigs& com::apama::session::SessionInterface::getSessionConfiguration ( )

getSessionConfiguration method

Adapter user can query all the session related information through this method. This will return SessionConfigs structure.

virtual AP_SESSION_State com::apama::session::SessionInterface::getSessionState ( )
virtual

getSessionState method

this methods returns session state for current sessionInterface

virtual void com::apama::session::SessionInterface::onSessionReconfigure ( int64_t  sourceId,
map_t &  configParams 
)
pure virtual

Session Reconfigure Callback

A registered session as being signalled to reconfigure. The supplied configuration parameters should be used to reconfigure. If successful, call SessionReconfigureSuccess(), else SessionReconfigureError().

Parameters
sourceIdThe source Id given to this session.
configParamsUser configuration parameters.
virtual void com::apama::session::SessionInterface::onSessionRegistrationError ( const std::string &  sessionName)
pure virtual

Session Registration Error Callback

This is called when an error occured during session registration after the adapter has called RegisterSession() or RegisterSessions() of Connectivity_SessionManager.h .

Parameters
sessionNameThe name of the session that failed registered.
virtual void com::apama::session::SessionInterface::onSessionRegistrationSuccess ( const std::string &  sessionName,
int64_t  sourceId 
)
pure virtual

Session Registration Success Callback

This is called on a successful registration of a Session after the adapter has called RegisterSession() or RegisterSessions() of Connectivity_SessionManager.h .

Parameters
sessionNameThe name of the session successfully registered.
sourceIdThe source Id given to this session.
virtual void com::apama::session::SessionInterface::onSessionStart ( int64_t  sourceId,
map_t &  configParams 
)
pure virtual

Session Start Callback

A registered session as being signalled to start, the adapter should attempt to connect to the external source. Once the session is connected, it should set the session state to SESSION_CONNECTED using SetSessionStateByName() or SetSessionStateById() and then call SessionStartSuccess(). If the connection fails, call SessionStartError() of Connectivity_SessionManager.h .

Parameters
sourceIdThe source Id given to this session.
configParamsUser configuration parameters.
virtual void com::apama::session::SessionInterface::onSessionStop ( int64_t  sourceId)
pure virtual

Session Stop Callback

A registered and started session as being signalled to stop, the adapter should attempt the following:-

  • Unsubscribe to all symbols.
  • Disconnect from the external source.
  • Once the session is disconnected, it should set the session state to SESSION_DISCONNECTED using SetSessionStateByName() or SetSessionStateById() and then call SessionStopSuccess(). If the disconnection fails, call SessionStopError().
Parameters
sourceIdThe source Id given to this session.
void com::apama::session::SessionInterface::setChainName ( const std::string &  chainName)

setChainName method

This method should be called before adding and registering any session. ChainName will be used to notify session start/stop success/error to different chains.

Parameters
chainNameChain name provided in Yaml file.
void com::apama::session::SessionInterface::setChannelName ( const std::string &  channelName)

setChannelName method

This method should be called before adding and registering any session.

Parameters
channelNameName of channel.
void com::apama::session::SessionInterface::setDescription ( const std::string &  description)

setDescription method

This method should be called before adding and registering any session. This method is used to provide simple description of session.

Parameters
descriptionThe Description of Session.
virtual void com::apama::session::SessionInterface::setHostSide ( HostSide *  hostSide)
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
hostSideHostside pointer provided by transport/codec.
void com::apama::session::SessionInterface::setSessionName ( const std::string &  sessionName)

setSessionName method

This method should be called before adding and registering any session. Session name should be different for

Parameters
sessionNameName of session.
virtual void com::apama::session::SessionInterface::SetSessionState ( AP_SESSION_State  state,
bool  generateNewId 
)
virtual

SetSessionState method

sets session state given in arugment state. If new connectionId is needed set generateNewId to true

Parameters
stateThe source Id given to this session.
generateNewIdUser configuration parameters.

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