@Override public Object operationExecuted( Request request, Operation operation, Object result) { Operation op = Dispatcher.REQUEST.get().getOperation(); assertNotNull(op); assertTrue(op.getService().getService() instanceof HelloWorld); assertTrue(op.getParameters()[0] instanceof Message); return result; } });
private GetMapRequest getGetMap(Request request) { Operation op = request.getOperation(); Object parsedRequest = op.getParameters()[0]; GetMapRequest getMap; if (parsedRequest instanceof GetMapRequest) { getMap = (GetMapRequest) parsedRequest; } else if (parsedRequest instanceof GetFeatureInfoRequest) { getMap = ((GetFeatureInfoRequest) parsedRequest).getGetMapRequest(); } else { throw new IllegalArgumentException( "Could not get a GetMapRequest out of the parsed request, the parsed request object was:_" + parsedRequest); } return getMap; }
/** * Returns the url to fetch a output resource using the GetExecutionResult call * * @param executionId - optional, if you don't have it the resource manager will use its thread * local version * @param name * @param baseUrl - optional, if you don't have it the resource manager will pick one from * Dispatcher.REQUEST * @param mimeType */ public String getOutputResourceUrl( String executionId, String name, String baseUrl, String mimeType) { // create the link Map<String, String> kvp = new LinkedHashMap<String, String>(); kvp.put("service", "WPS"); kvp.put("version", "1.0.0"); kvp.put("request", "GetExecutionResult"); kvp.put("executionId", getExecutionId(executionId)); kvp.put("outputId", name); kvp.put("mimetype", mimeType); if (baseUrl == null) { Operation op = Dispatcher.REQUEST.get().getOperation(); ExecuteType execute = (ExecuteType) op.getParameters()[0]; baseUrl = execute.getBaseUrl(); } String url = ResponseUtils.buildURL(baseUrl, "ows", kvp, URLType.SERVICE); return url; }