use of org.n52.shetland.ogc.ows.OwsAllowedValues 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.OwsAllowedValues 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.OwsAllowedValues 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.OwsAllowedValues in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeOwsPossibleValues.
private void encodeOwsPossibleValues(OwsPossibleValues possibleValues, DomainType xdomain) {
if (possibleValues.isAnyValue()) {
xdomain.addNewAnyValue();
} else if (possibleValues.isNoValues()) {
xdomain.addNewNoValues();
} else if (possibleValues.isValuesReference()) {
OwsValuesReference vr = possibleValues.asValuesReference();
ValuesReference xvr = xdomain.addNewValuesReference();
xvr.setReference(vr.getReference().toString());
xvr.setStringValue(vr.getValue());
} else if (possibleValues.isAllowedValues()) {
OwsAllowedValues av = possibleValues.asAllowedValues();
AllowedValues xav = xdomain.addNewAllowedValues();
av.getRestrictions().forEach(restriction -> {
if (restriction.isRange()) {
OwsRange range = restriction.asRange();
RangeType xrange = xav.addNewRange();
range.getLowerBound().map(OwsValue::getValue).ifPresent(v -> xrange.addNewMinimumValue().setStringValue(v));
range.getUpperBound().map(OwsValue::getValue).ifPresent(v -> xrange.addNewMaximumValue().setStringValue(v));
range.getSpacing().map(OwsValue::getValue).ifPresent(v -> xrange.addNewSpacing().setStringValue(v));
xrange.setRangeClosure(Collections.singletonList(range.getType()));
} else if (restriction.isValue()) {
xav.addNewValue().setStringValue(restriction.asValue().getValue());
}
});
}
}
use of org.n52.shetland.ogc.ows.OwsAllowedValues in project arctic-sea by 52North.
the class AbstractGetCapabilitiesHandler method getAcceptVersionsDomain.
private OwsDomain getAcceptVersionsDomain(String service) {
Set<String> supportedVersions = this.serviceOperatorRepository.getSupportedVersions(service);
OwsValue defaultValue = new OwsValue(Comparables.version().max(supportedVersions));
OwsPossibleValues possibleValues = new OwsAllowedValues(supportedVersions.stream().map(OwsValue::new));
return new OwsDomain(GetCapabilitiesParams.AcceptVersions, possibleValues, defaultValue);
}
Aggregations