Search in sources :

Example 1 with WPSCapabilitiesType

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;
}
Also used : MalformedURLException(java.net.MalformedURLException) DescribeProcessResponse(org.geotools.data.wps.response.DescribeProcessResponse) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) ProcessOfferingsType(net.opengis.wps10.ProcessOfferingsType) DescribeProcessRequest(org.geotools.data.wps.request.DescribeProcessRequest) URL(java.net.URL) ProcessDescriptionsType(net.opengis.wps10.ProcessDescriptionsType) ProcessBriefTypeImpl(net.opengis.wps10.impl.ProcessBriefTypeImpl) EList(org.eclipse.emf.common.util.EList) WebProcessingService(org.geotools.data.wps.WebProcessingService) ServiceException(org.geotools.ows.ServiceException) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) WPSCapabilitiesType(net.opengis.wps10.WPSCapabilitiesType)

Aggregations

IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 ProcessDescriptionType (net.opengis.wps10.ProcessDescriptionType)1 ProcessDescriptionsType (net.opengis.wps10.ProcessDescriptionsType)1 ProcessOfferingsType (net.opengis.wps10.ProcessOfferingsType)1 WPSCapabilitiesType (net.opengis.wps10.WPSCapabilitiesType)1 ProcessBriefTypeImpl (net.opengis.wps10.impl.ProcessBriefTypeImpl)1 EList (org.eclipse.emf.common.util.EList)1 WebProcessingService (org.geotools.data.wps.WebProcessingService)1 DescribeProcessRequest (org.geotools.data.wps.request.DescribeProcessRequest)1 DescribeProcessResponse (org.geotools.data.wps.response.DescribeProcessResponse)1 ServiceException (org.geotools.ows.ServiceException)1