本文整理了Java中org.geoserver.ows.Request.getRequest
方法的一些代码示例,展示了Request.getRequest
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRequest
方法的具体详情如下:
包路径:org.geoserver.ows.Request
类名称:Request
方法名:getRequest
[英]The operation requested against the service
[中]针对该服务请求的操作
代码示例来源:origin: geoserver/geoserver
/**
* Returns true if the caching headers are enabled and the request is a GetCapabilities one
*
* @param request
* @return
*/
private boolean handleCachingHeaders(Request request) {
return capabilitiesCacheHeadersEnabled
&& "GetCapabilities".equalsIgnoreCase(request.getRequest());
}
代码示例来源:origin: geoserver/geoserver
private boolean isOgcCapabilitiesRequest() {
Request request = Dispatcher.REQUEST.get();
return request != null && "GetCapabilities".equalsIgnoreCase(request.getRequest());
}
代码示例来源:origin: geoserver/geoserver
private boolean shouldApplyFilter() {
Request request = Dispatcher.REQUEST.get();
// for the moment, match any recognized OGC request
return request != null && request.getService() != null && request.getRequest() != null;
}
代码示例来源:origin: geoserver/geoserver
private boolean operationExists(Request req, Service serviceDescriptor) {
boolean exists = false;
for (String op : serviceDescriptor.getOperations()) {
if (op.equalsIgnoreCase(req.getRequest())) {
exists = true;
break;
}
}
return exists;
}
代码示例来源:origin: geoserver/geoserver
@Override
public AbstractGridFormat getFormat() {
Request request = Dispatcher.REQUEST.get();
if (policy.level == AccessLevel.METADATA
&& (request == null || !"GetCapabilities".equalsIgnoreCase(request.getRequest()))) {
throw SecureCatalogImpl.unauthorizedAccess(this.getName());
}
return super.getFormat();
}
}
代码示例来源:origin: geoserver/geoserver
public String toString() {
return getService() + " " + getVersion() + " " + getRequest();
}
代码示例来源:origin: geoserver/geoserver
@Override
public GridCoverageReader getGridCoverageReader(ProgressListener listener, Hints hints)
throws IOException {
Request request = Dispatcher.REQUEST.get();
if (policy.level == AccessLevel.METADATA
&& (request == null || !"GetCapabilities".equalsIgnoreCase(request.getRequest()))) {
throw SecureCatalogImpl.unauthorizedAccess(this.getName());
}
GridCoverageReader reader = super.getGridCoverageReader(listener, hints);
return (GridCoverageReader) SecuredObjects.secure(reader, policy);
}
代码示例来源:origin: geoserver/geoserver
public boolean hideLayer(LayerInfo layer) {
PublishedInfo local = LocalPublished.get();
if (local == null) {
return false;
} else if (local instanceof LayerInfo) {
return !local.equals(layer);
} else if (local instanceof LayerGroupInfo) {
LayerGroupInfo lg = (LayerGroupInfo) local;
Request request = Dispatcher.REQUEST.get();
if (request != null
&& "WMS".equalsIgnoreCase(request.getService())
&& "GetCapabilities".equals(request.getRequest())
&& lg.getMode() == Mode.SINGLE) {
return true;
} else {
return !new LayerGroupHelper(lg).allLayers().contains(layer);
}
} else {
throw new RuntimeException("Unknown PublishedInfo of type " + local.getClass());
}
}
代码示例来源:origin: geoserver/geoserver
/**
* Returns true if the layer should be hidden, false otherwise
*
* <ol>
* <li>has a request
* <li>is a GetCapabilities request
* <li>is not for a layer-specific virtual service
* </ol>
*/
boolean checkCapabilitiesRequest(ResourceInfo resource) {
Request request = Dispatcher.REQUEST.get();
if (request != null) {
if ("GetCapabilities".equalsIgnoreCase(request.getRequest())) {
String resourceContext =
resource.getNamespace().getPrefix() + "/" + resource.getName();
return !resourceContext.equalsIgnoreCase(request.getContext());
}
}
return false;
}
代码示例来源:origin: geoserver/geoserver
if (request == null || !"GetCapabilities".equalsIgnoreCase(request.getRequest())) {
return group;
代码示例来源:origin: geoserver/geoserver
public Operation operationDispatched(Request request, Operation operation) {
String service = request.getService();
String method = request.getRequest();
代码示例来源:origin: geoserver/geoserver
private boolean isFilterSubject() {
return request() != null
&& request().getService() != null
&& request().getRequest() != null;
}
代码示例来源:origin: geoserver/geoserver
protected Query getReadQuery() {
if (policy.getAccessLevel() == AccessLevel.HIDDEN
|| policy.getAccessLevel() == AccessLevel.METADATA) {
return new Query(null, Filter.EXCLUDE);
} else if (policy.getLimits() == null) {
return Query.ALL;
} else if (policy.getLimits() instanceof VectorAccessLimits) {
VectorAccessLimits val = (VectorAccessLimits) policy.getLimits();
// Ugly hack: during WFS transactions the reads we do are used to count the number of
// features
// we are deleting/updating: use the write filter instead of the read filter
Request request = Dispatcher.REQUEST.get();
if (request != null
&& request.getService().equalsIgnoreCase("WFS")
&& request.getRequest().equalsIgnoreCase("Transaction")) {
return val.getWriteQuery();
} else {
return val.getReadQuery();
}
} else {
throw new IllegalArgumentException(
"SecureFeatureSources has been fed "
+ "with unexpected AccessLimits class "
+ policy.getLimits().getClass());
}
}
代码示例来源:origin: geoserver/geoserver
if (request != null
&& "WMS".equalsIgnoreCase(request.getService())
&& "GetCapabilities".equals(request.getRequest())
&& lg.getMode() == Mode.SINGLE) {
return !lg.equals(layerGroup);
代码示例来源:origin: geoserver/geoserver
Operation dispatch(Request req, Service serviceDescriptor) throws Throwable {
if (req.getRequest() == null) {
String msg =
"Could not determine geoserver request from http request "
Method operation = OwsUtils.method(serviceBean.getClass(), req.getRequest());
throw new ServiceException(msg, "OperationNotSupported", req.getRequest());
if (!"GetCapabilities".equalsIgnoreCase(req.getRequest())) {
if (req.getVersion() == null) {
Operation op = new Operation(req.getRequest(), serviceDescriptor, operation, parameters);
return fireOperationDispatchedCallback(req, op);
代码示例来源:origin: geoserver/geoserver
if (request != null
&& "WMS".equalsIgnoreCase(request.getService())
&& "GetCapabilities".equals(request.getRequest())
&& lg.getMode() == Mode.SINGLE) {
代码示例来源:origin: geoserver/geoserver
if ((service == null) || (req.getRequest() == null)) {
Map map = readOpContext(req);
if (req.getRequest() == null) {
req.setRequest(normalize((String) map.get("request")));
if (serviceDescriptor != null) {
if (req.getRequest() == null) {
req.setRequest(req.getService());
代码示例来源:origin: org.geoserver.extension/control-flow
@Override
boolean matchesRequest(Request request) {
if (!service.equalsIgnoreCase(request.getService()))
return false;
if (method == null)
return true;
else if (!method.equalsIgnoreCase(request.getRequest()))
return false;
if (outputFormat == null)
return true;
else if (!outputFormat.equalsIgnoreCase(request.getOutputFormat()))
return false;
return true;
}
代码示例来源:origin: org.geoserver.community/gs-wfs3
@Override
public Service serviceDispatched(Request request, Service service) throws ServiceException {
Service wfs3 =
this.wfs3.getOrCompute(() -> (Service) GeoServerExtensions.bean("wfsService-3.0"));
Service fallback =
this.fallback.getOrCompute(
() -> (Service) GeoServerExtensions.bean("wfsService-2.0"));
if (wfs3.equals(service) && "GetCapabilities".equals(request.getRequest())) {
request.setServiceDescriptor(fallback);
return fallback;
}
return service;
}
代码示例来源:origin: org.geoserver.community/gs-params-extractor
@Override
public void mangleURL(
StringBuilder baseURL, StringBuilder path, Map<String, String> kvp, URLType type) {
Request request = Dispatcher.REQUEST.get();
if (request == null || !"GetCapabilities".equalsIgnoreCase(request.getRequest())) {
return;
}
forwardOriginalUri(request, path);
Map requestRawKvp = request.getRawKvp();
if (request.getHttpRequest() instanceof RequestWrapper) {
RequestWrapper requestWrapper = (RequestWrapper) request.getHttpRequest();
Map parameters = requestWrapper.getOriginalParameters();
requestRawKvp = new KvpMap(KvpUtils.normalize(parameters));
}
forwardParameters(requestRawKvp, kvp);
}
内容来源于网络,如有侵权,请联系作者删除!