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);
}
}
Aggregations