OnixS C++ FIX Engine  4.9.0
API Documentation
SessionScheduler Class Reference

#include <OnixS/FIXEngine/FIX/Scheduling/SessionScheduler.h>

Public Member Functions

 SessionScheduler (const SessionSchedulerOptions &options)
 
 ~SessionScheduler ()
 
const SessionSchedulefindSchedule (const SessionScheduleId &id) const
 
const SessionConnectionSettingsfindConnectionSettings (const SessionConnectionSettingsId &id) const
 
void add (Session *session, const SessionSchedule &schedule, const SessionConnectionSettings &connection)
 
void add (Session *session, const SessionScheduleId &scheduleId, const SessionConnectionSettingsId &connectionId)
 
void remove (Session *session)
 
void serviceThreadAffinity (const OnixS::Threading::CpuIndexes &cpuIndexes)
 
const OnixS::Threading::CpuIndexesserviceThreadAffinity () const
 
void reconnectAttempts (int value)
 
int reconnectAttempts () const
 
void reconnectInterval (int value)
 
int reconnectInterval () const
 
void utcTimeUsage (bool value)
 
bool utcTimeUsage () const
 

Detailed Description

It monitors whenever criteria to log a particular session either on or off is triggered and automatically executes appropriate action.

Definition at line 139 of file SessionScheduler.h.

Constructor & Destructor Documentation

Initializes Scheduler instance according to the options specified in given configuration file.

If specified, Scheduler extracts from configuration a set of predefined session schedules and connection settings later available through Schedules and ConnectionSettings properties.

Performs graceful shutdown of scheduling services.

Member Function Documentation

void add ( Session session,
const SessionSchedule schedule,
const SessionConnectionSettings connection 
)

Adds session to automatic connection management.

If session is being added during active time frame, it will be connected immediately. If session is being registered during inactive time frame and has active state, it will be disconnected. If session already registered, exception will be thrown.

Parameters
sessionInstance of session to be maintained.
scheduleSchedule which defines session connection time, periodicity as well as other attributes.
connectionsettings for given session to be used when session must be connected.
void add ( Session session,
const SessionScheduleId scheduleId,
const SessionConnectionSettingsId connectionId 
)

Adds session to automatic connection management.

If session is being added during active time frame, it will be connected immediately. If session is being registered during inactive time frame and has active state, it will be disconnected. If session already registered, exception will be thrown.

Parameters
sessionInstance of session to be maintained.
scheduleIdId of predefined schedule to use for given session.
connectionIdId of predefined connection settings to use for given session.
const SessionConnectionSettings* findConnectionSettings ( const SessionConnectionSettingsId id) const

Looks for the predefined session connection settings associated with given unique names (ids) as it was specified in Scheduler's configuration file.

Returns
NULL if no settings available under given id.
const SessionSchedule* findSchedule ( const SessionScheduleId id) const

Looks for the predefined session schedule associated with given unique names (ids) as it was specified in Scheduler's configuration file.

Returns
NULL if no schedule available under given id.
void reconnectAttempts ( int  value)

Sets the number of logon attempts in case of a logon failure.

int reconnectAttempts ( ) const

Returns the number of logon attempts in case of a logon failure.

By default, the option value is equal to 3.

void reconnectInterval ( int  value)

Sets the time interval between the logon attempts in case of a logon failure.

(in seconds).

int reconnectInterval ( ) const

Returns the time interval between the logon attempts in case of a logon failure.

(in seconds). By default, the option value is equal to 180 second.

void remove ( Session session)

Removes session from automatic connection management services.

If session were not registered before, does actually nothing.

void serviceThreadAffinity ( const OnixS::Threading::CpuIndexes cpuIndexes)

Sets the CPU affinity of the Scheduller service thread.

const OnixS::Threading::CpuIndexes& serviceThreadAffinity ( ) const

Returns the CPU affinity of the Scheduller service thread.

void utcTimeUsage ( bool  value)

This property allows switching local time to UTC time usage.

bool utcTimeUsage ( ) const

Returns true if the UTC time is used otherwise false.

By default, the option value is false.


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