How to Get the Status of LiveCycle Services

Sometimes, there is a need to know if LiveCycle is up and running. I’ve seen a few techniques being used to try to get the status of LiveCycle:

- HTTP GET call to adminui
- Orchestration that returns true/false

LiveCycle has a service API that can return the status of any LiveCycle service.
I’ve written a simple web application that does the following:

- Returns the list of all services with their status.
- Return the status of a particular service.

1- Returns the list of all services with their status

This snippet of code will return the status of all services:

serviceReg = new ServiceRegistryClient(myfactory);

List lstServiceConfig = serviceReg.getServiceConfigurations();

try{
for(int i=0;i< lstServiceConfig.size();i++){
ServiceConfiguration sr = (ServiceConfiguration)lstServiceConfig.get(i);

int state = sr.getState();

response.setContentType("text/html");
response.getOutputStream().println("Name of the service : " + sr.getServiceId()
+ " " + sr.getMajorVersion() + "." + sr.getMinorVersion() + " : ");

response.getOutputStream().println("State : " + getStateValue(state) + "
“);
}
}

catch(Exception e){
System.out.println(“Error: ” + e.getMessage() + “\n”);
}

If you use the attached servlet you can get the result using the following url:

http://:8080/GetServiceInfo/GetServiceStatus

2- Return the status of a particular service.

This snippet of code will return the status of a specific service:

try{
ServiceConfiguration serviceConfig = serviceReg.getServiceConfiguration(serviceName, max, min);

int state = serviceConfig.getState();

response.setContentType(“text/html”);
response.getOutputStream().println(“Name of the service : ”
+ serviceConfig.getServiceId() + max + “.” + min + ” : “);
response.getOutputStream().println(“State : ” + getStateValue(state) + “
“);
}
catch(Exception e){
System.out.println(“Error retrieving service ” + serviceName + ” with version ” + max + “.” + min);
}

If you use the attached servlet you can get the result using the following url:

http://:8080/GetServiceInfo/GetServiceStatus?ServiceName=FTP&MaxVersion=1&MinVersion=0

Just deploy the attached war file and give it a try.

You can also get additional examples for the service api at the following url:

http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000067.html#1548277

You can get the source from here.

Jasmin

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)
This entry was posted in Adobe LiveCycle ES2 (9.0.x), General Interest and tagged , , , . Bookmark the permalink.

3 Responses to How to Get the Status of LiveCycle Services

  1. HDao says:

    Hi Jasmin,

    Thanks for posting this useful techniques.
    Can this be applied to LiveCycle ES (8.2.1)?

    Thanks,
    Han

  2. Jasmin says:

    Yes. You would need to change the client jars in the war file to use the ES ones, but other than that it should work.

    Jasmin

  3. Steve Fletcher says:

    What would I need to do to get this working with LC ES 2.5 and WebSphere 7.0.0.9?

    Thanks,

    Steve Fletcher