#include <OnixS/FIXEngine/FIX/Scheduling/SessionScheduler.h>
Public Member Functions | |
SessionScheduler (const SessionSchedulerOptions &options) | |
~SessionScheduler () | |
const SessionSchedule * | findSchedule (const SessionScheduleId &id) const |
const SessionConnectionSettings * | findConnectionSettings (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::CpuIndexes & | serviceThreadAffinity () const |
void | reconnectAttempts (int value) |
int | reconnectAttempts () const |
void | reconnectInterval (int value) |
int | reconnectInterval () const |
void | utcTimeUsage (bool value) |
bool | utcTimeUsage () const |
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.
SessionScheduler | ( | const SessionSchedulerOptions & | options | ) |
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.
~SessionScheduler | ( | ) |
Performs graceful shutdown of scheduling services.
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.
session | Instance of session to be maintained. |
schedule | Schedule which defines session connection time, periodicity as well as other attributes. |
connection | settings 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.
session | Instance of session to be maintained. |
scheduleId | Id of predefined schedule to use for given session. |
connectionId | Id 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.
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.
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.