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

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

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

Request.getVersion介绍

[英]The service version
[中]服务版本

代码示例

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

  1. public String toString() {
  2. return getService() + " " + getVersion() + " " + getRequest();
  3. }

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

  1. if (req.getVersion() == null) {
  2. req.setVersion(
  3. normalizeVersion(
  4. if (req.getVersion() == null) {
  5. } else {
  6. if (!req.getVersion().matches("[0-99].[0-99].[0-99]")) {
  7. throw new ServiceException(
  8. "Invalid version: " + req.getVersion(),
  9. "InvalidParameterValue",
  10. "version");
  11. Version version = new Version(req.getVersion());
  12. "Invalid version: " + req.getVersion(),
  13. "InvalidParameterValue",
  14. "version");

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

  1. Service serviceDescriptor = findService(service, req.getVersion(), req.getNamespace());
  2. if (serviceDescriptor == null) {
  3. findService(req.getContext(), req.getVersion(), req.getNamespace());
  4. if (serviceDescriptor != null) {

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

  1. /**
  2. * Returns the WFS3 featureId, or null if it's missing or the request is not a WFS3 one
  3. *
  4. * @return
  5. */
  6. private String getWFS3FeatureId() {
  7. Request dr = Dispatcher.REQUEST.get();
  8. String featureId = null;
  9. if (dr != null && (new Version(dr.getVersion()).getMajor().equals(3))) {
  10. Object featureIdValue = dr.getKvp().get("featureId");
  11. if (featureIdValue instanceof List) {
  12. featureId = (String) ((List) featureIdValue).get(0);
  13. }
  14. }
  15. return featureId;
  16. }

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

  1. private void handleDefault(
  2. ServiceException exception, Request request, String charset, boolean verbose) {
  3. if ("1.0.0".equals(request.getVersion())) {
  4. handle1_0(exception, request.getHttpResponse());
  5. } else {
  6. super.handleServiceException(exception, request);
  7. }
  8. }

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

  1. /**
  2. * Generate download links for the specified info object.
  3. *
  4. * @param info
  5. */
  6. public CloseableIterator<String> generateDownloadLinks(CatalogInfo info) {
  7. Request request = Dispatcher.REQUEST.get();
  8. String baseURL = null;
  9. // Retrieve the baseURL (something like: http://host:port/geoserver/...)
  10. try {
  11. if (baseURL == null) {
  12. baseURL = ResponseUtils.baseURL(request.getHttpRequest());
  13. }
  14. baseURL = ResponseUtils.buildURL(baseURL, "/", null, URLType.SERVICE);
  15. } catch (Exception e) {
  16. }
  17. if (baseURL == null) {
  18. throw new IllegalArgumentException("baseURL is required to create download links");
  19. }
  20. baseURL += LINK;
  21. baseURL = baseURL.replace("${version}", request.getVersion());
  22. if (info instanceof CoverageInfo) {
  23. return linksFromCoverage(baseURL, (CoverageInfo) info);
  24. } else {
  25. if (LOGGER.isLoggable(Level.WARNING)) {
  26. LOGGER.warning("Download link for vectors isn't supported." + " Returning null");
  27. }
  28. }
  29. return null;
  30. }

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

  1. Version version = WMS.negotiateVersion(request.getVersion());
  2. if (version == WMS.VERSION_1_1_1) {

代码示例来源:origin: org.geoserver.community/gs-nsg-wfs-profile

  1. @Override
  2. public Operation operationDispatched(Request request, Operation operation) {
  3. String version = request.getVersion();
  4. String method = request.getRequest();
  5. long timeout = getTimeoutMilliseconds(operation);
  6. if ("WFS".equalsIgnoreCase(request.getService())
  7. && (version == null || V_20.compareTo(new Version(version)) <= 0)
  8. && method != null
  9. && (method.equalsIgnoreCase("GetFeature")
  10. || method.equalsIgnoreCase("GetFeatureWithLock")
  11. || method.equalsIgnoreCase("GetPropertyValue"))
  12. && timeout > 0
  13. && operation.getParameters().length > 0
  14. && operation.getParameters()[0] instanceof BaseRequestType) {
  15. if (LOGGER.isLoggable(Level.FINE)) {
  16. LOGGER.fine("Starting to track NSG timeout on this request");
  17. }
  18. // start tracking time
  19. TimeoutVerifier timeoutVerifier =
  20. new TimeoutVerifier((BaseRequestType) operation.getParameters()[0], timeout);
  21. // need to wrap the http response and its output stream
  22. request.setHttpResponse(
  23. new TimeoutCancellingResponse(request.getHttpResponse(), timeoutVerifier));
  24. // set in the thread local for later use
  25. TIMEOUT_VERIFIER.set(timeoutVerifier);
  26. }
  27. return operation;
  28. }

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

  1. json.object()
  2. .key("version")
  3. .value(request.getVersion())
  4. .key("exceptions")
  5. .array()

相关文章