Search in sources :

Example 1 with OwsValue

use of org.n52.shetland.ogc.ows.OwsValue in project arctic-sea by 52North.

the class AbstractGetCapabilitiesHandler method getCommonParameters.

private Collection<OwsDomain> getCommonParameters(String service) {
    OwsDomain serviceParameter = new OwsDomain(OWSConstants.RequestParams.service, new OwsAllowedValues(new OwsValue(service)));
    OwsDomain versionParameter = new OwsDomain(OWSConstants.RequestParams.version, getSupportedVersions(service));
    return Arrays.asList(serviceParameter, versionParameter);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Example 2 with OwsValue

use of org.n52.shetland.ogc.ows.OwsValue in project arctic-sea by 52North.

the class AbstractGetCapabilitiesHandler method getAcceptLanguagesDomain.

private OwsDomain getAcceptLanguagesDomain() {
    Set<Locale> availableLocales = serviceMetadataRepository.getAvailableLocales();
    OwsPossibleValues possibleValues = new OwsAllowedValues(availableLocales.stream().map(LocaleHelper::encode).map(OwsValue::new));
    return new OwsDomain(GetCapabilitiesParams.AcceptLanguages, possibleValues);
}
Also used : Locale(java.util.Locale) OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) LocaleHelper(org.n52.janmayen.i18n.LocaleHelper) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues)

Example 3 with OwsValue

use of org.n52.shetland.ogc.ows.OwsValue in project arctic-sea by 52North.

the class AbstractGetCapabilitiesHandler method getSectionsDomain.

private OwsDomain getSectionsDomain() {
    OwsPossibleValues possibleValues = new OwsAllowedValues(Arrays.stream(OWSConstants.CapabilitiesSection.values()).map(Object::toString).map(OwsValue::new));
    OwsValue defaultValue = new OwsValue(OWSConstants.CapabilitiesSection.All.toString());
    return new OwsDomain(GetCapabilitiesParams.Sections, possibleValues, defaultValue);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Example 4 with OwsValue

use of org.n52.shetland.ogc.ows.OwsValue in project arctic-sea by 52North.

the class AbstractOperationHandler method getRequestMethodsForServiceURL.

private Stream<OwsRequestMethod> getRequestMethodsForServiceURL(OwsOperationKey operation) {
    Map<String, Set<OwsValue>> mediaTypesByMethod = new HashMap<>(HTTPMethods.METHODS.size());
    this.bindingRepository.getBindings().values().stream().forEach(binding -> HTTPMethods.METHODS.stream().filter(isMethodSupported(binding, operation)).forEach(method -> mediaTypesByMethod.computeIfAbsent(method, Functions.forSupplier(HashSet::new)).addAll(getMediaTypes(binding))));
    return mediaTypesByMethod.entrySet().stream().map(e -> new OwsRequestMethod(this.serviceURL, e.getKey(), createContentTypeDomains(e.getValue())));
}
Also used : Binding(org.n52.iceland.binding.Binding) HTTPException(org.n52.iceland.exception.HTTPException) ConfigurationError(org.n52.faroe.ConfigurationError) HashMap(java.util.HashMap) OwsDCP(org.n52.shetland.ogc.ows.OwsDCP) MediaType(org.n52.janmayen.http.MediaType) I18NSettings(org.n52.iceland.i18n.I18NSettings) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) HashSet(java.util.HashSet) Inject(javax.inject.Inject) BindingRepository(org.n52.iceland.binding.BindingRepository) Locale(java.util.Locale) Map(java.util.Map) Validation(org.n52.faroe.Validation) URI(java.net.URI) OwsRequestMethod(org.n52.shetland.ogc.ows.OwsRequestMethod) Functions(org.n52.janmayen.function.Functions) OwsValue(org.n52.shetland.ogc.ows.OwsValue) Collectors.toSet(java.util.stream.Collectors.toSet) MediaTypeBindingKey(org.n52.iceland.binding.MediaTypeBindingKey) OwsOperationKey(org.n52.shetland.ogc.ows.service.OwsOperationKey) Predicate(java.util.function.Predicate) Set(java.util.Set) Setting(org.n52.faroe.annotation.Setting) LocaleHelper(org.n52.janmayen.i18n.LocaleHelper) OwsMetadata(org.n52.shetland.ogc.ows.OwsMetadata) HTTPMethods(org.n52.janmayen.http.HTTPMethods) OwsExceptionReport(org.n52.shetland.ogc.ows.exception.OwsExceptionReport) OwsServiceRequest(org.n52.shetland.ogc.ows.service.OwsServiceRequest) Objects(java.util.Objects) Stream(java.util.stream.Stream) OwsHttp(org.n52.shetland.ogc.ows.OwsHttp) HTTPHeaders(org.n52.janmayen.http.HTTPHeaders) Optional(java.util.Optional) Configurable(org.n52.faroe.annotation.Configurable) PathBindingKey(org.n52.iceland.binding.PathBindingKey) ServiceSettings(org.n52.iceland.service.ServiceSettings) OwsOperation(org.n52.shetland.ogc.ows.OwsOperation) Collections(java.util.Collections) OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) HashSet(java.util.HashSet) Collectors.toSet(java.util.stream.Collectors.toSet) Set(java.util.Set) HashMap(java.util.HashMap) OwsRequestMethod(org.n52.shetland.ogc.ows.OwsRequestMethod) HashSet(java.util.HashSet)

Example 5 with OwsValue

use of org.n52.shetland.ogc.ows.OwsValue in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseDomain.

private OwsDomain parseDomain(DomainType domain) {
    if (domain == null) {
        return null;
    }
    OwsValue defaultValue = parseValue(domain.getDefaultValue());
    Collection<OwsMetadata> metadata = parseMetadata(domain.getMetadataArray());
    OwsDomainMetadata meaning = parseDomainMetadata(domain.getMeaning());
    OwsDomainMetadata dataType = parseDomainMetadata(domain.getDataType());
    OwsValuesUnit valuesUnit = Stream.of(parseUom(domain.getUOM()), parseReferenceSystem(domain.getReferenceSystem())).filter(Objects::nonNull).findFirst().orElse(null);
    OwsPossibleValues possibleValues = Stream.of(parseAnyValue(domain.getAnyValue()), parseAllowedValues(domain.getAllowedValues()), parseValuesReference(domain.getValuesReference()), parseNoValues(domain.getNoValues())).filter(Objects::nonNull).findFirst().orElse(null);
    return new OwsDomain(domain.getName(), possibleValues, defaultValue, meaning, dataType, valuesUnit, metadata);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsDomainMetadata(org.n52.shetland.ogc.ows.OwsDomainMetadata) OwsMetadata(org.n52.shetland.ogc.ows.OwsMetadata) OwsValuesUnit(org.n52.shetland.ogc.ows.OwsValuesUnit) Objects(java.util.Objects) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Aggregations

OwsDomain (org.n52.shetland.ogc.ows.OwsDomain)8 OwsValue (org.n52.shetland.ogc.ows.OwsValue)8 OwsAllowedValues (org.n52.shetland.ogc.ows.OwsAllowedValues)7 OwsPossibleValues (org.n52.shetland.ogc.ows.OwsPossibleValues)6 LocaleHelper (org.n52.janmayen.i18n.LocaleHelper)3 OwsMetadata (org.n52.shetland.ogc.ows.OwsMetadata)3 URI (java.net.URI)2 Collections (java.util.Collections)2 Locale (java.util.Locale)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Stream (java.util.stream.Stream)2 Configurable (org.n52.faroe.annotation.Configurable)2 Setting (org.n52.faroe.annotation.Setting)2 HTTPMethods (org.n52.janmayen.http.HTTPMethods)2 OwsDCP (org.n52.shetland.ogc.ows.OwsDCP)2 OwsDomainMetadata (org.n52.shetland.ogc.ows.OwsDomainMetadata)2 OwsHttp (org.n52.shetland.ogc.ows.OwsHttp)2