#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) |
bool | isScheduled (Session *session) |
void | dispatchEvents () |
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 an appropriate action.
Definition at line 155 of file SessionScheduler.h.
SessionScheduler | ( | const SessionSchedulerOptions & | options | ) |
Initializes the Scheduler instance according to the options specified in the given configuration file.
If specified, the Scheduler extracts from the configuration a set of predefined session schedules and connection settings later available through Schedules and ConnectionSettings properties.
~SessionScheduler | ( | ) |
Performs the graceful shutdown of scheduling services.
void add | ( | Session * | session, |
const SessionSchedule & | schedule, | ||
const SessionConnectionSettings & | connection | ||
) |
Adds the session to the automatic connection management.
If the session is added during an active time frame, it will be connected immediately. If the session is registered during an inactive time frame and has an active state, it will be disconnected. If the session is already registered, an exception will be thrown.
session | An instance of the session to be maintained. |
schedule | The schedule which defines the session connection time, periodicity as well as other attributes. |
connection | Settings for the given session to be used when the session must be connected. |
void add | ( | Session * | session, |
const SessionScheduleId & | scheduleId, | ||
const SessionConnectionSettingsId & | connectionId | ||
) |
Adds the session to the automatic connection management.
If the session is added during an active time frame, it will be connected immediately. If the session is registered during an inactive time frame and has an active state, it will be disconnected. If the session is already registered, an exception will be thrown.
session | An instance of the session to be maintained. |
scheduleId | The id of the predefined schedule to use for the given session. |
connectionId | The id of the predefined connection settings to use for the given session. |
void dispatchEvents | ( | ) |
Processes events on the Scheduler and performs the necessary session management.
This method should be called periodically and only when the ExternalThread threading model is used. This method is not thread-safe.
const SessionConnectionSettings* findConnectionSettings | ( | const SessionConnectionSettingsId & | id | ) | const |
Looks for the predefined session connection settings associated with the given unique names (ids) as it was specified in the Scheduler's configuration file.
const SessionSchedule* findSchedule | ( | const SessionScheduleId & | id | ) | const |
Looks for the predefined session schedule associated with the given unique names (ids) as it was specified in the Scheduler's configuration file.
bool isScheduled | ( | Session * | session | ) |
Checks if the session is scheduled for the automatic connection management services.
Returns 'true' if the session is registered, otherwise - 'false'.
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 logon attempts in case of a logon failure.
(in seconds).
int reconnectInterval | ( | ) | const |
Returns the time interval between logon attempts in case of a logon failure.
(in seconds). By default, the option value is equal to 180 seconds.
void remove | ( | Session * | session | ) |
Removes the session from the automatic connection management services.
If the session were not registered before, an exception will be thrown.
void serviceThreadAffinity | ( | const OnixS::Threading::CpuIndexes & | cpuIndexes | ) |
Sets the CPU affinity of the Scheduler service thread.
const OnixS::Threading::CpuIndexes& serviceThreadAffinity | ( | ) | const |
Returns the CPU affinity of the Scheduler service thread.
void utcTimeUsage | ( | bool | value | ) |
This property allows switching the local time to the UTC time usage.
bool utcTimeUsage | ( | ) | const |
Returns true if the UTC time is used otherwise false.
By default, the option value is false.