OnixS C++ ICE Binary Order Entry Handler 1.1.2
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
SessionScheduleradd (Session *session, const SessionSchedule &schedule, const SessionConnectionSettings &connection)
SessionScheduleradd (Session *session, const SessionScheduleId &scheduleId, const SessionConnectionSettingsId &connectionId)
SessionScheduleradd (BgwSession *session, const SessionSchedule &schedule, IBgwCredentialsProvider *bgwCredentialsProvider)
SessionScheduleradd (BgwSession *session, const SessionScheduleId &scheduleId, IBgwCredentialsProvider *bgwCredentialsProvider)
SessionSchedulerremove (Session *session)
void dispatchEvents ()
SessionSchedulerreconnectAttempts (int value)
int reconnectAttempts () const
SessionSchedulerreconnectInterval (int value)
int reconnectInterval () const
SessionSchedulerutcTimeUsage (bool value)
bool utcTimeUsage () const

Static Public Attributes

static const size_t TimeResolutionMs = 10

Detailed Description

Definition at line 99 of file SessionScheduler.h.

Constructor & Destructor Documentation

◆ SessionScheduler()

◆ ~SessionScheduler()

Performs the graceful shutdown of scheduling sessions.

Member Function Documentation

◆ add() [1/4]

SessionScheduler & add ( BgwSession * session,
const SessionSchedule & schedule,
IBgwCredentialsProvider * bgwCredentialsProvider )

Adds the BGW 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 added during an inactive time frame and is currently active, it will be disconnected.
  • If the session is already registered, an exception will be thrown.
Parameters
sessionthe BGW session instance to be maintained.
schedulethe schedule that defines active/inactive time frames.
bgwCredentialsProviderthe provider used to obtain BGW credentials when connecting.
Returns
a reference to this scheduler instance.

◆ add() [2/4]

SessionScheduler & add ( BgwSession * session,
const SessionScheduleId & scheduleId,
IBgwCredentialsProvider * bgwCredentialsProvider )

Adds the BGW 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 added during an inactive time frame and is currently active, it will be disconnected.
  • If the session is already registered, an exception will be thrown.
  • If no predefined schedule is found for scheduleId, an exception will be thrown.
Parameters
sessionthe BGW session instance to be maintained.
scheduleIdthe ID of the predefined schedule from Scheduler's configuration.
bgwCredentialsProviderthe provider used to obtain BGW credentials when connecting.
Returns
a reference to this scheduler instance.

◆ add() [3/4]

SessionScheduler & add ( Session * session,
const SessionSchedule & schedule,
const SessionConnectionSettings & connection )

Adds the session to the automatic connection management.

  • If the session is being added during the active time frame, it will be connected immediately.
  • If the session is being registered during the inactive time frame and is in the active state, it will be disconnected.
  • If the session is already registered, an exception will be thrown.
Parameters
sessionthe instance of the session to be maintained.
scheduleSession's schedule.
connectionSession's connection settings.
Returns
a reference to this scheduler instance.

◆ add() [4/4]

SessionScheduler & add ( Session * session,
const SessionScheduleId & scheduleId,
const SessionConnectionSettingsId & connectionId )

Adds the session to the automatic connection management.

  • If the session is being added during the active time frame, it will be connected immediately.
  • If the session is being registered during the inactive time frame and is in the active state, it will be disconnected.
  • If the session is already registered, and exception will be thrown.
Parameters
sessionthe instance of the session to be maintained.
scheduleIdthe ID of the predefined schedule.
connectionIdthe ID of the predefined connection settings.
Returns
a reference to this scheduler instance.

◆ 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 id that was specified in Scheduler's configuration file.

Returns
NULL if no settings are available for the given id.

◆ findSchedule()

const SessionSchedule * findSchedule ( const SessionScheduleId & id) const

Looks for the predefined session schedule associated with the given id that was specified in Scheduler's configuration file.

Returns
NULL if no schedule is available for the given id.

◆ reconnectAttempts() [1/2]

int reconnectAttempts ( ) const
Returns
the number of logon attempts in case of a logon failure.

The default value is 3.

◆ reconnectAttempts() [2/2]

SessionScheduler & 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 the logon attempts in case of a logon failure (in seconds).

The default value is 180 seconds.

◆ reconnectInterval() [2/2]

SessionScheduler & reconnectInterval ( int value)

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

◆ remove()

SessionScheduler & remove ( Session * session)

Removes the session from the automatic connection management services.

Parameters
sessionthe BGW session instance to be removed.
Returns
a reference to this scheduler instance.

◆ utcTimeUsage() [1/2]

bool utcTimeUsage ( ) const
Returns
true if the UTC is used, otherwise - false.

The default value is false.

◆ utcTimeUsage() [2/2]

SessionScheduler & utcTimeUsage ( bool value)

Activates the UTC usage.

Member Data Documentation

◆ TimeResolutionMs

const size_t TimeResolutionMs = 10
static

Definition at line 102 of file SessionScheduler.h.