The JobScheduler can be controlled by commands (e.g. starting a jobs) from external applications (or scripts).
More information of all available commands can be found here: Jetty/xml_commands.xml Command List].
The syntax of the command is similar to the xml syntax which is used to implement JobScheduler objects. The external API contains commands, like "start_job, add_order, show_state, ...". Everytime when a command is sent to the JobScheduler engine, the engine will reply an answer. This answer is pure XML as well. JOC, for Example, is using this external API very intensive.
An external application, which is able and has the authorisation to send such commands to the JSEngine can use http(s) or tcp/ip to establish the communication. That means, that even a script language like javascript can be used to communicate. For Java users we have a wrapper class paket which was created using JAXB and the xsd schema for the commands and answers.
Protocols
The commands can be transferred to the JobScheduler via the following protocols:
- HTTP
- HTTPS
- TCP
- UDP
and telnet.
In addition a command line interface (CLI) is available via the "jobscheduler.sh" script.
Example using JOC
You can use JOC to send a command using the URL:
http://[scheduler_host]:[scheduler_port]/<show_state/>
or if you open JOC with Jetty then type:
http://[scheduler_host]:[jetty_port]/jobscheduler/engine-cpp/<show_state/>
where <show_state/> is an example for a command of the JobScheduler external API.
Example using the JobScheduler script
You can use the startscript found in ./bin to send a command too.
An example for using the command line option
jobscheduler.sh command "<show_state/>"
The answer of jobscheduler.sh command ... is without indent and newlines.
If you want a more readable answer then type
jobscheduler.sh command "<show_state/>" | sed -e 's;[^>]*$;;' | xmllint --format -
Object Model: start an order
Resources
Examples in detail