What it does...
A simple application which will send a message on a given time and date. This can be used to trigger any xAP capable appliance at a given time - rather like an alarm clock might. What makes this application unusual, and different from conventional schedulers such as cron is that all interaction with the scheduler is via xAP messages. This in turn means that any xAP capable device may add or amend a schedule. The time and date on which the message is sent is set by a xAP message targeted at the scheduler. When the event fires, a xAP scheduler notification message is sent. Optionally, the alarm may be set to include a canned message, sent from a file, in addition to the standard scheduler event message. See the file SCHEDULE.xap for an example of how to set an alarm for a given time.
All scheduler events are persisted in a disk file, so if the scheduler is restarted no future events are lost. Stale events which have already passed are automatically cancelled.
Schedule Message Schema
The schema of a typical scheduler message is shown below. This example is also included in the sample schema supplied with the test harness send application.
xap-header { v=12 hop=1 uid=FF123400 class=schedule.request source=acme.my.controller target=rocket.schedule.bigben } set.once { time=16:05:00 date=22-12-2002 event="Get up you lazy bastard" file=L1_ON.xap }
Command Line Options
xap-schedule [instance name] [network interface] [udp port] [debug level]
where:
instance name is the xAP instance name assigned to this scheduler. Used to differentiate multiple schedulers connected to the same xAP network. By default this is set to BigBen.
network interface is the network interface used for outgoing xAP messages. On a Linux and Windows PC host these are named eth0, eth1. Under OSX they are named ne0 etc. By default, eth0 is used. On a Windows PC which has multiple adapters installed, even if they are not active, eth0 may not represent the active interface - some experimentation may be required!
udp port is the UDP port xAP broadcasts on. By default xAP uses its officially allocated port, 3639. Using an alternative port can be useful during isolated testing, however. Be aware that the use of ports below 1024 will fail unless the application is run by a user with administrative privileges. The use of ports below 1024 therefore has security implications and is not recommend.
debug level determines the verbosity of the output written to stdout. Verbose output can be useful for debugging unexpected behaviour. By default, the debug level is 0. Increasing levels of detail may be specified, up to a maximum of 4.
Future Enhancements
Support for arbitrary cyclic events based on day of week, last day of the month. Support for windowed events (events that occur +/- specified random interval). Support for finite repeating events (event repeats for n times, and is then removed).
Download
Scheduler Project
Event Scheduler source (requires xAP-lib) Event Scheduler windows executable (requires cygwin dll)
Schema
Event scheduler schema
|