Search in sources :

Example 1 with OwsServiceKey

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));
    }
}
Also used : GetCapabilitiesRequest(org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest) InvalidServiceParameterException(org.n52.iceland.exception.ows.concrete.InvalidServiceParameterException) OwsServiceKey(org.n52.shetland.ogc.ows.service.OwsServiceKey) Objects(java.util.Objects) InvalidServiceOrVersionException(org.n52.iceland.exception.ows.concrete.InvalidServiceOrVersionException)

Example 2 with OwsServiceKey

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));
}
Also used : OwsServiceKey(org.n52.shetland.ogc.ows.service.OwsServiceKey)

Example 3 with OwsServiceKey

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);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) RequestOperatorKey(org.n52.iceland.request.operator.RequestOperatorKey) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsOperation(org.n52.shetland.ogc.ows.OwsOperation) OwsServiceKey(org.n52.shetland.ogc.ows.service.OwsServiceKey) OwsOperationMetadataExtension(org.n52.shetland.ogc.ows.OwsOperationMetadataExtension) LinkedList(java.util.LinkedList)

Example 4 with OwsServiceKey

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));
}
Also used : OwsServiceKey(org.n52.shetland.ogc.ows.service.OwsServiceKey)

Aggregations

OwsServiceKey (org.n52.shetland.ogc.ows.service.OwsServiceKey)4 LinkedList (java.util.LinkedList)1 Objects (java.util.Objects)1 InvalidServiceOrVersionException (org.n52.iceland.exception.ows.concrete.InvalidServiceOrVersionException)1 InvalidServiceParameterException (org.n52.iceland.exception.ows.concrete.InvalidServiceParameterException)1 RequestOperatorKey (org.n52.iceland.request.operator.RequestOperatorKey)1 OwsDomain (org.n52.shetland.ogc.ows.OwsDomain)1 OwsOperation (org.n52.shetland.ogc.ows.OwsOperation)1 OwsOperationMetadataExtension (org.n52.shetland.ogc.ows.OwsOperationMetadataExtension)1 OwsOperationsMetadata (org.n52.shetland.ogc.ows.OwsOperationsMetadata)1 GetCapabilitiesRequest (org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest)1