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

x33g5p2x  于2022-01-30 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(108)

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

Service.getVersion介绍

暂无

代码示例

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

public int compare(Object o1, Object o2) {
    Service s1 = (Service) o1;
    Service s2 = (Service) o2;
    return s1.getVersion().compareTo(s2.getVersion());
  }
};

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

Service s = (Service) itr.next();
if (version.equals(s.getVersion())) {
  continue;

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

String version = null;
if (useServiceVersion && request.getServiceDescriptor() != null) {
  version = request.getServiceDescriptor().getVersion().toString();

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

Service service = (Service) s.next();
if (version.equals(service.getVersion())) {
  found = true;

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

@Override
public String getAttachmentFileName(Object value, Operation operation) {
  return "getcapabilities_" + operation.getService().getVersion().toString() + ".xml";
}

代码示例来源:origin: org.geoserver/wcs1_1

/**
 * Makes sure this triggers only
 * </p>
 */
public boolean canHandle(Operation operation) {
  // is this a wcs 1.1.1 or 1.1.0 one?
  return "GetCapabilities".equalsIgnoreCase(operation.getId()) && 
      operation.getService().getId().equals("wcs") &&
      (operation.getService().getVersion().toString().equals("1.1.0") ||
          operation.getService().getVersion().toString().equals("1.1.1"));
}

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

@Override
  public void onApplicationEvent(ContextRefreshedEvent event) {
    // configure the extra operation in WFS 2.0
    List<Service> services = GeoServerExtensions.extensions(Service.class);
    for (Service s : services) {
      if ("wfs".equals(s.getId().toLowerCase())
          && Integer.valueOf(2).equals(s.getVersion().getMajor())) {
        if (!s.getOperations().contains(PAGE_RESULTS)) {
          s.getOperations().add(PAGE_RESULTS);
        }
      }
    }
  }
}

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

/** Makes sure this triggers only */
public boolean canHandle(Operation operation) {
  // is this a wcs 1.1.1 or 1.1.0 one?
  return "GetCapabilities".equalsIgnoreCase(operation.getId())
      && operation.getService().getId().equals("wcs")
      && (operation.getService().getVersion().toString().equals("1.1.0")
          || operation.getService().getVersion().toString().equals("1.1.1"));
}

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

/** Makes sure this triggers only */
@Override
public boolean canHandle(Operation operation) {
  return "GetCapabilities".equalsIgnoreCase(operation.getId())
      && operation.getService().getId().equals(WCS20Const.SERVICE_NAME)
      && (operation.getService().getVersion().toString().equals(WCS20Const.V201)
          || operation.getService().getVersion().toString().equals(WCS20Const.V20));
}

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

@Override
public Service serviceDispatched(Request request, Service service) throws ServiceException {
  Object req = request.getKvp().get("REQUEST");
  if ("wfs".equals(service.getId().toLowerCase()) && PAGE_RESULTS.equals(req)) {
    // allow the request to be successfully parsed as a GetFeature (needs at least a
    // typename or a featureId)
    request.getKvp().put("featureId", Collections.singletonList("dummy"));
    // replace the service
    return new Service(
        service.getId(), this.service, service.getVersion(), service.getOperations());
  }
  return service;
}

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

/** Makes sure this triggers only */
public boolean canHandle(Operation operation) {
  return "GetCapabilities".equalsIgnoreCase(operation.getId())
      && operation.getService().getId().equals("wcs")
      && operation.getService().getVersion().toString().equals("1.0.0");
}

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

/** @see org.geoserver.web.CapabilitiesHomePageLinkProvider#getCapabilitiesComponent */
  public Component getCapabilitiesComponent(final String id) {

    List<CapsInfo> serviceInfoLinks = new ArrayList<CapabilitiesHomePagePanel.CapsInfo>();

    List<Service> extensions = GeoServerExtensions.extensions(Service.class);
    for (Service si : extensions) {
      if (si.getCustomCapabilitiesLink() != null) {
        String serviceId = si.getId();
        String capsLink = si.getCustomCapabilitiesLink();
        CapsInfo ci = new CapsInfo(serviceId, si.getVersion(), capsLink);
        serviceInfoLinks.add(ci);
      } else if (si.getOperations().contains("GetCapabilities")) {
        String serviceId = si.getId();
        String capsLink =
            "../ows?service="
                + serviceId
                + "&version="
                + si.getVersion().toString()
                + "&request=GetCapabilities";
        CapsInfo ci = new CapsInfo(serviceId, si.getVersion(), capsLink);
        serviceInfoLinks.add(ci);
      }
    }
    return new CapabilitiesHomePagePanel(id, serviceInfoLinks);
  }
}

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

if (new Version("1.1.0").equals(operation.getService().getVersion())) {
  write1_1(lockResponse, output, operation);

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

public void write(Object value, OutputStream output, Operation operation)
    throws IOException, ServiceException {
  TransactionResponseType response = (TransactionResponseType) value;
  if (new Version("1.0.0").equals(operation.getService().getVersion())) {
    v_1_0(response, output, operation);
  } else {
    v_1_1(response, output, operation);
  }
}

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

@Override
public Response responseDispatched(
    Request request, Operation operation, Object result, Response response) {
  Service service = operation.getService();
  if (service == null
      || service.getId() == null
      || !service.getId().equalsIgnoreCase("wfs")) {
    // not a WFS service so we are not interested in it
    return response;
  }
  String responseMimeType = response.getMimeType(result, operation);
  if (!isGmlBased(responseMimeType)) {
    // no a GML based response
    return response;
  }
  WFSInfo wfs = geoserver.getService(WFSInfo.class);
  GMLInfo gmlInfo =
      wfs.getGML().get(WFSInfo.Version.negotiate(service.getVersion().toString()));
  if (gmlInfo == null || !gmlInfo.getMimeTypeToForce().isPresent()) {
    // we don't need to force any specific MIME type
    return response;
  }
  // enforce the configured MIME type
  String mimeType = gmlInfo.getMimeTypeToForce().get();
  LOGGER.info(
      String.format(
          "Overriding MIME type '%s' with '%s' for WFS operation '%s'.",
          responseMimeType, mimeType, operation.getId()));
  return new ResponseWrapper(response, mimeType);
}

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

String toJSON(Operation op, Map<String, Object> opts) {
  int depth = Converters.convert(opts.getOrDefault(OPT_DEPTH, 3), Integer.class);
  JSONStringer out = new JSONStringer();
  out.object();
  Service srv = op.getService();
  out.key("service")
      .object()
      .key("name")
      .value(srv.getId())
      .key("version")
      .value(srv.getVersion())
      .endObject();
  out.key("operation").object().key("name").value(op.getId());
  Object req = Arrays.stream(op.getParameters()).findFirst().orElse(null);
  if (req != null) {
    out.key("request");
    traverse(req, 0, depth, out);
  }
  out.endObject(); // operation
  out.endObject();
  return out.toString();
}

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

version = request.getServiceDescriptor().getVersion().toString();

相关文章