Apama Capital Markets Foundation  10.5.0.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
SM_SessionInterface.h File Reference

Interface functions for the Session Manager. More...

#include <CHashMap.h>
#include <EventTransport.h>
#include <limits.h>

Go to the source code of this file.

Classes

struct  AP_SESSION_AdapterInterface
 
struct  AP_SESSION_Interface
 

Macros

#define STREAMTYPE_BBA   ("com.apama.md.BBA")
 
#define STREAMTYPE_TRADE   ("com.apama.md.T")
 
#define STREAMTYPE_MBP   ("com.apama.md.D")
 
#define STREAMTYPE_MBO   ("com.apama.md.O")
 
#define STREAMTYPE_EP   ("com.apama.md.EP")
 
#define STREAMTYPE_QUOTEBOOK   ("com.apama.md.QB")
 
#define STREAMTYPE_NEWS   ("com.apama.md.N")
 

Enumerations

enum  AP_SESSION_State {
  SESSION_UNKNOWN, SESSION_INITIAL, SESSION_REGISTERED, SESSION_DISCONNECTED,
  SESSION_CONNECTED, SESSION_LOGGEDOUT, SESSION_LOGGEDIN, SESSION_UNKNOWN,
  SESSION_INITIAL, SESSION_REGISTERED, SESSION_DISCONNECTED, SESSION_CONNECTED,
  SESSION_LOGGEDOUT, SESSION_LOGGEDIN
}
 

Functions

AP_SESSION_API void AP_SESSION_Init (AP_SESSION_AdapterInterface *adapterInterface, void *transportInternals, AP_SESSION_Interface **smi)
 
AP_SESSION_API void AP_SESSION_DeInit (AP_SESSION_Interface *smi)
 
AP_SESSION_API void AP_SESSION_AddSession (AP_SESSION_Interface *smi, const char *transportName, const char *sessionName, const char *channelName, const char *description)
 
AP_SESSION_API void AP_SESSION_AddSessionParams (AP_SESSION_Interface *smi, const char *sessionName, const char *paramName, const char *type, const char *defaultValue, const char *const allowValues[], size_t allowsize, const char *description, AP_bool required, AP_bool referenceOnly)
 
AP_SESSION_API void AP_SESSION_AddCapabilities (AP_SESSION_Interface *smi, const char *sessionName, const char *const capabilities[], size_t capsSize)
 
AP_SESSION_API void AP_SESSION_AddCapabilityParams (AP_SESSION_Interface *smi, const char *sessionName, const char *streamName, const char *key, const char *type, const char *defaultValue, const char *const allowedValues[], size_t allowsize, const char *description, AP_bool required)
 
AP_SESSION_API void AP_SESSION_AddCapabilitiesById (AP_SESSION_Interface *smi, AP_int64 sourceId, const char *const capabilities[], size_t capsSize)
 
AP_SESSION_API void AP_SESSION_AddCapabilityParamsById (AP_SESSION_Interface *smi, AP_int64 sourceId, const char *streamName, const char *key, const char *type, const char *defaultValue, const char *const allowedValues[], size_t allowsize, const char *description, AP_bool required)
 
AP_SESSION_API AP_bool AP_SESSION_HasCapability (AP_SESSION_Interface *smi, const AP_int64 sourceId, const char *capability)
 
AP_SESSION_API void AP_SESSION_RegisterSessions (AP_SESSION_Interface *smi)
 
AP_SESSION_API void AP_SESSION_RegisterSession (AP_SESSION_Interface *smi, const char *sessionName)
 
AP_SESSION_API void AP_SESSION_DeleteSessionByName (AP_SESSION_Interface *smi, const char *sessionName)
 
AP_SESSION_API void AP_SESSION_DeleteSessionById (AP_SESSION_Interface *smi, AP_int64 sourceId)
 
AP_SESSION_API void AP_SESSION_Clear (AP_SESSION_Interface *smi)
 
AP_SESSION_API void AP_SESSION_SetSessionStateByName (AP_SESSION_Interface *smi, const char *sessionName, AP_SESSION_State state, bool generateNewId=false)
 
AP_SESSION_API void AP_SESSION_SetSessionStateById (AP_SESSION_Interface *smi, AP_int64 sourceId, AP_SESSION_State state, bool generateNewId=false)
 
AP_SESSION_API AP_SESSION_State AP_SESSION_GetSessionStateByName (AP_SESSION_Interface *smi, const char *sessionName)
 
AP_SESSION_API AP_SESSION_State AP_SESSION_GetSessionStateById (AP_SESSION_Interface *smi, AP_int64 sourceId)
 
AP_SESSION_API HashMap * AP_SESSION_GetAllSessionStates (AP_SESSION_Interface *smi)
 
AP_SESSION_API void AP_SESSION_SetCorrelatorHBTimeout (AP_SESSION_Interface *smi, int timeoutInterval)
 
AP_SESSION_API void AP_SESSION_GenerateIAFStatus (AP_SESSION_Interface *smi, AP_NormalisedEvent *nevent)
 
AP_SESSION_API int AP_SESSION_ProcessEvent (AP_SESSION_Interface *smi, AP_TransportEvent event, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SetDecoder (AP_SESSION_Interface *smi, AP_EventDecoder *decoder)
 
AP_SESSION_API void AP_SESSION_SessionStartSuccess (AP_SESSION_Interface *smi, AP_int64 sourceId, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SessionStartError (AP_SESSION_Interface *smi, AP_int64 sourceId, const char *errMsg, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SessionStopSuccess (AP_SESSION_Interface *smi, AP_int64 sourceId, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SessionStopError (AP_SESSION_Interface *smi, AP_int64 sourceId, const char *errMsg, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SessionReconfigureSuccess (AP_SESSION_Interface *smi, AP_int64 sourceId, AP_TimestampSet *tss)
 
AP_SESSION_API void AP_SESSION_SessionReconfigureError (AP_SESSION_Interface *smi, AP_int64 sourceId, const char *errMsg, AP_TimestampSet *tss)
 
AP_SESSION_API const char * AP_SESSION_GetSessionName (AP_SESSION_Interface *smi, AP_int64 sourceId)
 
AP_SESSION_API AP_int64 AP_SESSION_GetSessionId (AP_SESSION_Interface *smi, const char *sessionName)
 
AP_SESSION_API void AP_SESSION_LogLatency (AP_SESSION_Interface *smi, IAF_TimestampConfig *config)
 
AP_SESSION_API void AP_SESSION_Stop (AP_SESSION_Interface *smi)
 
AP_SESSION_API void AP_SESSION_Start (AP_SESSION_Interface *smi)
 

Detailed Description

Interface functions for the Session Manager.

Enumeration Type Documentation

Session states

Enumerator
SESSION_UNKNOWN 

Maintain sequence State Unknown

SESSION_INITIAL 

Initial State

SESSION_REGISTERED 

Registered

SESSION_DISCONNECTED 

Disconnected

SESSION_CONNECTED 

Connected

SESSION_LOGGEDOUT 

Logged Out

SESSION_LOGGEDIN 

Logged In

SESSION_UNKNOWN 

State Unknown

SESSION_INITIAL 

Initial State

SESSION_REGISTERED 

Registered

SESSION_DISCONNECTED 

Disconnected

SESSION_CONNECTED 

Connected

SESSION_LOGGEDOUT 

Logged Out

SESSION_LOGGEDIN 

Logged In

Function Documentation

AP_SESSION_API void AP_SESSION_GenerateIAFStatus ( AP_SESSION_Interface smi,
AP_NormalisedEvent *  nevent 
)

Generate the IAF Status event.

Used in the getStatus() function of the Transport.

Parameters
smiThe AP_SESSION_Interface to use.
neventThe normalized event to send.
See also
onCorrelatorWatchDogTimedOut
AP_SESSION_API AP_int64 AP_SESSION_GetSessionId ( AP_SESSION_Interface smi,
const char *  sessionName 
)

Get the Id of a session by its Name.

Parameters
smiThe AP_SESSION_Interface to use.
sessionNameThe name of the session to get the Id for.
Returns
The Id of the session or -1 if not found
AP_SESSION_API const char* AP_SESSION_GetSessionName ( AP_SESSION_Interface smi,
AP_int64  sourceId 
)

Get the name of a session by its Id.

Parameters
smiThe AP_SESSION_Interface to use.
sourceIdThe Id of the session to get the name for.
Returns
The name of the session or NULL if not found
AP_SESSION_API void AP_SESSION_LogLatency ( AP_SESSION_Interface smi,
IAF_TimestampConfig *  config 
)

Set the latency logging configuration.

Parameters
smiThe AP_SESSION_Interface to use.
configThe latency logging configuration.
AP_SESSION_API int AP_SESSION_ProcessEvent ( AP_SESSION_Interface smi,
AP_TransportEvent  event,
AP_TimestampSet *  tss 
)

Process an upstream event.

Used in the sendTransportEvent() function of the Transport.

Parameters
smiThe AP_SESSION_Interface to use.
eventThe transport event to process.
tssThe timestamp set of the event.
AP_SESSION_API void AP_SESSION_SetCorrelatorHBTimeout ( AP_SESSION_Interface smi,
int  timeoutInterval 
)

Set the correlator heartbeat timeout.

Parameters
smiThe AP_SESSION_Interface to use.
timeoutIntervalThe interval before a correlator timeout is registered and AP_SESSION_AdapterInterface::onCorrelatorWatchDogTimedOut() called.
See also
onCorrelatorWatchDogTimedOut
AP_SESSION_API void AP_SESSION_SetDecoder ( AP_SESSION_Interface smi,
AP_EventDecoder *  decoder 
)

Set the event decoder.

Used in the addEventDecoder() function of the Transport.

Parameters
smiThe AP_SESSION_Interface to use.
decoderThe event decoder.
AP_SESSION_API void AP_SESSION_Start ( AP_SESSION_Interface smi)

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

Parameters
smiThe AP_SESSION_Interface to use.
See also
AP_SESSION_Stop
AP_SESSION_API void AP_SESSION_Stop ( AP_SESSION_Interface smi)

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

Parameters
smiThe AP_SESSION_Interface to use.
See also
AP_SESSION_Start