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::CME::iLink3::Scheduling::SessionSchedulerOptions class exposes OnixS::CME::iLink3::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::CME::iLink3::Scheduling::SessionScheduler::add overload to schedule a session with parameters described in a configuration file.
Moreover, OnixS::CME::iLink3::Scheduling::SessionScheduler exposes OnixS::CME::iLink3::Scheduling::SessionScheduler::findSchedule and OnixS::CME::iLink3::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 tags are supported:
Session Schedule description consists in definition of the following attributes for the Schedule element:
Name: id
Values: 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.
Name: firstDay
Values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Defines the first day of the activity week for session.
Name: lastDay
Values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Defines the last day of the activity week for session.
Name: logonTime
Values: Time value from 0:00 till 23:59 in 24 hours format (with optional seconds resolution).
Defines the time of logon for a session.
Name: logoutTime
Values: 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:
Name: id
Values: 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.
Name: host
Values: 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.
Name: port
Values: 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.
Below is a typical configuration file for Sessions Scheduler.