org.geoserver.ows.Request.getOperation()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(252)

本文整理了Java中org.geoserver.ows.Request.getOperation方法的一些代码示例,展示了Request.getOperation的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getOperation方法的具体详情如下:
包路径:org.geoserver.ows.Request
类名称:Request
方法名:getOperation

Request.getOperation介绍

[英]The Operation used to call the service code. Available only after dispatching is done, it provides access to the current service object, and the parsed request
[中]用于调用服务代码的操作。只有在分派完成后才可用,它提供对当前服务对象和解析请求的访问

代码示例

代码示例来源:origin: geoserver/geoserver

  1. @Override
  2. public Object operationExecuted(
  3. Request request, Operation operation, Object result) {
  4. Operation op = Dispatcher.REQUEST.get().getOperation();
  5. assertNotNull(op);
  6. assertTrue(op.getService().getService() instanceof HelloWorld);
  7. assertTrue(op.getParameters()[0] instanceof Message);
  8. return result;
  9. }
  10. });

代码示例来源:origin: org.geoserver.community/gs-dyndimension

  1. private GetMapRequest getGetMap(Request request) {
  2. Operation op = request.getOperation();
  3. Object parsedRequest = op.getParameters()[0];
  4. GetMapRequest getMap;
  5. if (parsedRequest instanceof GetMapRequest) {
  6. getMap = (GetMapRequest) parsedRequest;
  7. } else if (parsedRequest instanceof GetFeatureInfoRequest) {
  8. getMap = ((GetFeatureInfoRequest) parsedRequest).getGetMapRequest();
  9. } else {
  10. throw new IllegalArgumentException(
  11. "Could not get a GetMapRequest out of the parsed request, the parsed request object was:_"
  12. + parsedRequest);
  13. }
  14. return getMap;
  15. }

代码示例来源:origin: org.geoserver.extension/gs-wps-core

  1. /**
  2. * Returns the url to fetch a output resource using the GetExecutionResult call
  3. *
  4. * @param executionId - optional, if you don't have it the resource manager will use its thread
  5. * local version
  6. * @param name
  7. * @param baseUrl - optional, if you don't have it the resource manager will pick one from
  8. * Dispatcher.REQUEST
  9. * @param mimeType
  10. */
  11. public String getOutputResourceUrl(
  12. String executionId, String name, String baseUrl, String mimeType) {
  13. // create the link
  14. Map<String, String> kvp = new LinkedHashMap<String, String>();
  15. kvp.put("service", "WPS");
  16. kvp.put("version", "1.0.0");
  17. kvp.put("request", "GetExecutionResult");
  18. kvp.put("executionId", getExecutionId(executionId));
  19. kvp.put("outputId", name);
  20. kvp.put("mimetype", mimeType);
  21. if (baseUrl == null) {
  22. Operation op = Dispatcher.REQUEST.get().getOperation();
  23. ExecuteType execute = (ExecuteType) op.getParameters()[0];
  24. baseUrl = execute.getBaseUrl();
  25. }
  26. String url = ResponseUtils.buildURL(baseUrl, "ows", kvp, URLType.SERVICE);
  27. return url;
  28. }

相关文章