OnixS C++ FIX Engine  4.12.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)
 
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

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.

Performs the graceful shutdown of scheduling services.

Member Function Documentation

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

Returns
NULL if no settings available under the given id.
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.
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.


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