To simplify development, Session Scheduler provides an ability to define session schedules and connecting settings in configuration files for later referencing in the source code.
Once presets are defined in the file, the session scheduler can use them during the instance initialization stage (OnixS::B3::BOE::Scheduling::SessionSchedulerOptions class exposes OnixS::B3::BOE::Scheduling::SessionSchedulerOptions::configurationFile member for these purposes). Afterwards, both schedules and connection settings can be referenced in the source code using the string identifiers. Scheduler exposes the OnixS::B3::BOE::Scheduling::SessionScheduler::add overload to schedule a session with parameters described in a configuration file.
Moreover, OnixS::B3::BOE::Scheduling::SessionScheduler exposes OnixS::B3::BOE::Scheduling::SessionScheduler::findSchedule and OnixS::B3::BOE::Scheduling::SessionScheduler::findConnectionSettings members to access real instances of schedules and connection settings described in the configuration file. These members can help when a session has to be registered with a partially predefined configuration.
The following example demonstrates how a session can be registered with a predefined schedule, but custom connection settings are not described in the configuration file.
Description of Scheduler settings has XML-based syntax. The following elements are supported:
Element | Description |
---|---|
SchedulerSettings | Root element of scheduler's configuration. |
Schedules | Contains descriptions of predefined schedules. |
Schedule | Describes attributes of a particular session schedule. |
Connections | Contains descriptions of predefined session connection settings. |
Connection | Defines characteristics of a particular session connection. |
Session Schedule description consists in definition of the following attributes for the Schedule
element:
Attribute | Values | Notes |
---|---|---|
id | Non-empty String | It's a unique identifier for the schedule. The value of this attribute is used later in the source code to refer to the described schedule. It must be unique among all schedules. |
firstDay | Sunday , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday | Defines the first day of the activity week for session. |
lastDay | Sunday , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday | Defines the last day of the activity week for session. |
logonTime | Time value from 0:00 till 23:59 in 24 hours format (with optional seconds resolution). | Defines the time of logon for a session. |
logoutTime | Time value from 0:00 till 23:59 in 24 hours format (with optional seconds resolution). | Defines the time of logout for a session. |
The description of connection settings consists of the definition of the following attributes for the Connection
element:
Attribute | Values | Notes |
---|---|---|
id | Non-empty String | It's a unique identifier for the settings set. The value of this attribute is used later in the source code to refer to described settings. It must be unique among all settings sets. |
host | String | If a session must be logged on in the role of initiator, this parameter defines a remote host to which the session must connect to. Otherwise, the attribute is ignored. |
port | Number | If a session must be logged on in the role of initiator, this parameter defines a port number to which the session must connect to. Otherwise, the attribute is ignored. |
Counterparty
nodes with host
and port
attributes. Inner nodes are ignored if the master Connection
node contains host
and port
attributes.Below is a typical configuration file for Sessions Scheduler.