OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
SessionScheduler Class Reference

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)
bool isScheduled (Session *session)
void dispatchEvents ()
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 an appropriate action.

Definition at line 155 of file SessionScheduler.h.

Constructor & Destructor Documentation

◆ SessionScheduler()

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.

Member Function Documentation

◆ add() [1/2]

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.

Parameters
sessionAn instance of the session to be maintained.
scheduleThe schedule which defines the session connection time, periodicity as well as other attributes.
connectionSettings for the given session to be used when the session must be connected.

◆ add() [2/2]

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.

Parameters
sessionAn instance of the session to be maintained.
scheduleIdThe id of the predefined schedule to use for the given session.
connectionIdThe id of the predefined connection settings to use for the given session.

◆ dispatchEvents()

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.

◆ findConnectionSettings()

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.

Returns
NULL if no settings available under the given id.

◆ findSchedule()

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.

Returns
NULL if no a schedule available under the given id.

◆ isScheduled()

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'.

◆ reconnectAttempts() [1/2]

int reconnectAttempts ( ) const

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

By default, the option value is equal to 3.

◆ reconnectAttempts() [2/2]

void reconnectAttempts ( int value)

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

◆ reconnectInterval() [1/2]

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.

◆ reconnectInterval() [2/2]

void reconnectInterval ( int value)

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

(in seconds).

◆ remove()

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.

◆ serviceThreadAffinity() [1/2]

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

Returns the CPU affinity of the Scheduler service thread.

◆ serviceThreadAffinity() [2/2]

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

Sets the CPU affinity of the Scheduler service thread.

◆ utcTimeUsage() [1/2]

bool utcTimeUsage ( ) const

Returns true if the UTC time is used otherwise false.

By default, the option value is false.

◆ utcTimeUsage() [2/2]

void utcTimeUsage ( bool value)

This property allows switching the local time to the UTC time usage.