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

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

本文整理了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

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

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

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

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

/**
 * 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;
}

相关文章