Search in sources :

Example 1 with GetResultRequest

use of org.geotoolkit.wps.client.GetResultRequest in project geotoolkit by Geomatys.

the class WPS2Process method fillOutputs.

/**
 * Fill {@link ParameterValueGroup parameters} of the process using the WPS
 * {@link ExecuteResponse response}.
 *
 * @throws ProcessException if data conversion fails.
 */
private void fillOutputs(Object response) throws ProcessException {
    try {
        if (response == null) {
            // request the result from the server
            final GetResultRequest request = registry.getClient().createGetResult(jobId);
            request.setDebug(debug);
            request.setClientSecurity(security);
            response = request.getResponse();
        }
        if (response instanceof Result) {
            final Result result = (Result) response;
            for (DataOutput out : result.getOutput()) {
                fillOutputs(outputParameters, out);
            }
        } else if (response instanceof ExceptionResponse) {
            final ExceptionResponse report = (ExceptionResponse) response;
            throw new ProcessException("Exception when getting process result.", this, report.toException());
        }
    } catch (JAXBException ex) {
        Logger.getLogger(WPS2Process.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(WPS2Process.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : DataOutput(org.geotoolkit.wps.xml.v200.DataOutput) GetResultRequest(org.geotoolkit.wps.client.GetResultRequest) ProcessException(org.geotoolkit.process.ProcessException) DismissProcessException(org.geotoolkit.process.DismissProcessException) ExceptionResponse(org.geotoolkit.ows.xml.ExceptionResponse) JAXBException(javax.xml.bind.JAXBException) IOException(java.io.IOException) Result(org.geotoolkit.wps.xml.v200.Result)

Aggregations

IOException (java.io.IOException)1 JAXBException (javax.xml.bind.JAXBException)1 ExceptionResponse (org.geotoolkit.ows.xml.ExceptionResponse)1 DismissProcessException (org.geotoolkit.process.DismissProcessException)1 ProcessException (org.geotoolkit.process.ProcessException)1 GetResultRequest (org.geotoolkit.wps.client.GetResultRequest)1 DataOutput (org.geotoolkit.wps.xml.v200.DataOutput)1 Result (org.geotoolkit.wps.xml.v200.Result)1