use of org.n52.shetland.ogc.ows.service.OwsServiceKey in project arctic-sea by 52North.
the class SimpleBinding method getServiceOperator.
protected ServiceOperator getServiceOperator(OwsServiceRequest request) throws OwsExceptionReport {
checkServiceOperatorKeyTypes(request);
String service = request.getService();
String version = request.getVersion();
if (request instanceof GetCapabilitiesRequest) {
GetCapabilitiesRequest gcr = (GetCapabilitiesRequest) request;
if (gcr.isSetAcceptVersions()) {
return gcr.getAcceptVersions().stream().map(v -> new OwsServiceKey(service, v)).map(this::getServiceOperator).filter(Objects::nonNull).findFirst().orElseThrow(() -> new InvalidServiceOrVersionException(service, version));
} else {
Set<String> supportedVersions = serviceOperatorRepository.getSupportedVersions(service);
String newest = supportedVersions.stream().max(Comparables.version()).orElseThrow(() -> new InvalidServiceParameterException(service));
return getServiceOperator(new OwsServiceKey(service, newest));
}
} else {
return getServiceOperator(new OwsServiceKey(service, version));
}
}
use of org.n52.shetland.ogc.ows.service.OwsServiceKey in project arctic-sea by 52North.
the class JsonActivationDao method matches.
protected Predicate<JsonNode> matches(RequestOperatorKey key) {
OwsServiceKey sok = key == null ? null : key.getServiceOperatorKey();
String operationName = key == null ? null : key.getOperationName();
return matches(sok).and(matchesOperationName(operationName));
}
use of org.n52.shetland.ogc.ows.service.OwsServiceKey in project arctic-sea by 52North.
the class AbstractGetCapabilitiesHandler method getOperations.
private OwsOperationsMetadata getOperations(String service, String version) throws OwsExceptionReport {
Collection<OwsDomain> parameters = getCommonParameters(service);
Collection<OwsDomain> constraints = null;
Collection<OwsOperation> operations = new LinkedList<>();
OwsOperationMetadataExtension extension = getOperationsMetadataExtension(service, version);
for (RequestOperatorKey operatorKey : requestOperatorRepository.getActiveRequestOperatorKeys(new OwsServiceKey(service, version))) {
Optional.ofNullable(requestOperatorRepository.getRequestOperator(operatorKey).getOperationMetadata(service, version)).ifPresent(operations::add);
}
return new OwsOperationsMetadata(operations, parameters, constraints, extension);
}
use of org.n52.shetland.ogc.ows.service.OwsServiceKey in project arctic-sea by 52North.
the class AbstractJsonActivationDao method matches.
protected Predicate<JsonNode> matches(AbstractComparableServiceVersionDomainKey<?> key) {
OwsServiceKey sok = key == null ? null : key.getServiceOperatorKey();
String domain = key == null ? null : key.getDomain();
return matches(sok).and(matchesDomain(domain));
}
Aggregations