use of org.n52.iceland.exception.ows.concrete.InvalidAcceptVersionsParameterException in project arctic-sea by 52North.
the class SimpleBinding method checkServiceOperatorKeyTypes.
protected void checkServiceOperatorKeyTypes(OwsServiceRequest request) throws OwsExceptionReport {
String service = request.getService();
String version = request.getVersion();
if (service == null || service.isEmpty()) {
throw new MissingServiceParameterException();
} else if (!getServiceOperatorRepository().isServiceSupported(service)) {
throw new InvalidServiceParameterException(service);
} else if (request instanceof GetCapabilitiesRequest) {
GetCapabilitiesRequest gcr = (GetCapabilitiesRequest) request;
if (gcr.isSetAcceptVersions() && !gcr.getAcceptVersions().stream().anyMatch(v -> isVersionSupported(service, v))) {
throw new InvalidAcceptVersionsParameterException(gcr.getAcceptVersions());
}
} else if (version == null || version.isEmpty()) {
throw new MissingVersionParameterException();
} else if (!isVersionSupported(service, version)) {
throw new VersionNotSupportedException();
}
}
Aggregations