This document includes information for how to integrate and automate some JobServer's exposed functions and services with your own IT tools and environment. This document will cover the following topics:
JobServer exposes some of its services and admin functions through a lightweight web services API. This API can allow developers to integrate external tools and applications with JobServer. There are currently several operations that are available and they include.
JobServer uses the Hessian web services framework for accessing the available JobServer remote features and functions.
Hessian is an open source Java binary web services
API that is very easy to use and integrate with. It allows building and invoking remote web services
using a simple Java API. All you need to do is compile your remote application with
the hessian.jar
and jobserver-webservice.jar
JAR files. You can locate these
JARs in your JobServer installation at jobserver/sys/lib/sdk
.
Below are the JavaDocs for the JobServer Web Service API that you can use
in your Java application to access the JobServer web services:
Below is an example of a simple Java
standalone application that can make web services calls to JobServer. The URI to access the web services is:
http://<HOSTNAME>:<WEB_PORT>/jobserver/simplesoa
. . . String hostname="acme.com"; //host that JobServer is running on int jobserverWebPort=8020; //JobServer http port String sturl = "http://" + hostname + ":" + jobserverWebPort + "/jobserver/simplesoa"; //Create JobServer remote web service interface using Hessian factory HessianProxyFactory factory = new HessianProxyFactory(); JobServerOpenService service = (JobServerOpenService) factory.create(JobServerOpenService.class, sturl); //Invoke JobServer service that performs a simple status check service.webserverHeartBeat(); . . .
This simple example above shows how easy it is to use JobServer's web services Hessian interface. Include
this code in any Java server or client and you can access any method/service available from the
JobServerOpenService
interface.
JobServer has a command-line tool called jsmonitor
. You can use this command-line tool
to script a variety of services available in JobServer.
Run the command jsmonitor -help
to see all the available functions.
From this script, you can monitor the overall JobServer environment status and configuration and perform other operations such as exporting and importing jobs, among other functions and services.
JobServer comes with powerful export and import features. This allows exporting/importing jobs in XML format. This can be useful for saving jobs outside the JobServer environment and to move Jobs between different JobServer environments.
You can export/import jobs using the jsmonitor
command-line tool. These
export/import functions are also available
from within JobServer's GUI tools. This allows you to export jobs individually or by Partition or Group
and even export jobs remotely between multiple JobServer environment (for example between QA environments and
Production environments).
Refer to the JobServer help documentation for more details.
JobServer's developer SDK, soafaces, has an internal API that allows server-side Tasklets to access certain services such as triggering/running jobs and managing job Dependency Rules. Refer to the soafaces javadoc documentation for details. Here are some useful links to learn more about the soafaces SDK and API:
The soafaces UniversalClient
interface allows for easy access to a variety of messaging services. It allows
your soafaces Weblet/GWT clients to make direct calls to Mule endpoints and soafaces server-side services.
The API allows passing POJO
and JSON objects and returning POJO and JSON objects back from the remote
services that are invoked. Refer to the soafaces UniversalClient JavaDocs for more information.