use of net.opengis.wps10.WPSCapabilitiesType in project sldeditor by robward-scisys.
the class GeoServerWPSClient method getCapabilities.
/**
* Gets the capabilities.
*
* @return returns true if capabilities read, false if error
*/
@SuppressWarnings({ "rawtypes" })
@Override
public boolean getCapabilities() {
boolean ok = false;
try {
processList.clear();
String connectionString = connection.getUrl().toURI().toASCIIString();
URL url = new URL(connectionString + WPS_REQUEST_GET_CAPABILITIES);
WebProcessingService wps = new WebProcessingService(url);
WPSCapabilitiesType capabilities = wps.getCapabilities();
ProcessOfferingsType processOfferings = capabilities.getProcessOfferings();
EList processObjList = processOfferings.getProcess();
for (Object processObj : processObjList) {
ProcessBriefTypeImpl process = (ProcessBriefTypeImpl) processObj;
String functionIdentifier = process.getIdentifier().getValue();
// create a WebProcessingService as shown above,
// then do a full describeprocess on my process
DescribeProcessRequest descRequest = wps.createDescribeProcessRequest();
// describe the double addition process
descRequest.setIdentifier(functionIdentifier);
// send the request and get the ProcessDescriptionType bean to create a WPSFactory
DescribeProcessResponse descResponse = wps.issueRequest(descRequest);
ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
ProcessDescriptionType pdt = (ProcessDescriptionType) processDesc.getProcessDescription().get(0);
processList.add(pdt);
}
ok = true;
} catch (URISyntaxException e) {
ConsoleManager.getInstance().exception(this, e);
} catch (MalformedURLException e) {
ConsoleManager.getInstance().exception(this, e);
} catch (ServiceException e) {
ConsoleManager.getInstance().exception(this, e);
ConsoleManager.getInstance().error(this, Localisation.getString(GeoServerWPSClient.class, "GeoServerWPSClient.noCapabilities"));
} catch (IOException e) {
ConsoleManager.getInstance().exception(this, e);
}
return ok;
}
Aggregations