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);
}
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);
}
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);
}
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())));
}
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);
}
Aggregations