Application Discovery
Introduction
This guide demonstrates how to discover applications available at a GRIA Job Service.
This code requires the TutorialHelpers.java class previously discussed.
The full Java file for application discovery can be downloaded.
Application Discovery Guide
Create a Proxy Factory using the Tutorial Helpers
ProxyFactory proxyFactory = new TutorialHelpers().getFactory();
Use the Proxy Factory to create a Proxy to the Job Service
RemoteJobService jobService = proxyFactory.createProxy(ConversationID.getEPR(JOB_SERVICE_ENDPOINT), RemoteJobService.class);
Call getApplications on the Job Service returning a list of applications available.
String[] applicationList = jobService.getApplications();
Loop through these applications, and print out there details by invoking another method getApplicationMetadataDetailed
if(applicationList.length > 0){
System.out.println("Found "+applicationList.length+" applications.");
for(String applicationURI : applicationList){
Document appDescription = jobService.getApplicationMetadataDetailed(applicationURI);
String strApplicationDescription = XMLUtils.DocumentToString(appDescription);
System.out.println("\t"+strApplicationDescription);
}
}else{
System.out.println("No applications found on server.");
}