use of org.n52.shetland.ogc.ows.extension.Extensions in project arctic-sea by 52North.
the class SwesExtensionsTest method getExtension_for_enum_created_with_string_schould_return_true.
@Test
public void getExtension_for_enum_created_with_string_schould_return_true() {
final Extensions extensions = new Extensions();
extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(VALUE_1));
extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(VALUE_2));
extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(VALUE_3));
assertThat(extensions.getExtension(DEFINITION_1).orElse(null).getValue(), instanceOf(VALUE_1.getClass()));
assertThat(extensions.getExtension(DEFINITION_2).orElse(null).getValue(), instanceOf(VALUE_2.getClass()));
assertThat(extensions.getExtension(DEFINITION_3).orElse(null).getValue(), instanceOf(VALUE_3.getClass()));
}
use of org.n52.shetland.ogc.ows.extension.Extensions in project arctic-sea by 52North.
the class AbstractGetCapabilitiesHandler method createCapabilities.
private OwsCapabilities createCapabilities(GetCapabilitiesRequest request, String service, String version) throws OwsExceptionReport {
Set<CapabilitiesSection> sections = getRequestedSections(request);
Locale requestedLocale = getRequestedLocale(request);
String updateSequence = null;
OwsServiceIdentification serviceIdentification = null;
if (sections.contains(CapabilitiesSection.ServiceIdentification)) {
serviceIdentification = getServiceIdentification(service, requestedLocale);
}
OwsServiceProvider serviceProvider = null;
if (sections.contains(CapabilitiesSection.ServiceProvider)) {
serviceProvider = getServiceProvider(service, requestedLocale);
}
OwsOperationsMetadata operationsMetadata = null;
if (sections.contains(CapabilitiesSection.OperationsMetadata)) {
operationsMetadata = getOperations(service, version);
}
Set<String> languages = null;
if (sections.contains(CapabilitiesSection.Languages)) {
languages = getLanguages();
}
T contents = null;
if (sections.contains(CapabilitiesSection.Contents)) {
contents = createContents(service, version);
}
Collection<OwsCapabilitiesExtension> extensions = getExtensions(request, service, version);
OwsCapabilities capabilities = new OwsCapabilities(service, version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, languages, extensions);
return createCapabilities(capabilities, contents);
}
use of org.n52.shetland.ogc.ows.extension.Extensions in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseCapabilitiesBaseType.
protected OwsCapabilities parseCapabilitiesBaseType(String service, CapabilitiesBaseType cbt) throws DecodingException {
if (cbt == null) {
return null;
}
OwsServiceIdentification serviceIdentification = parseServiceIdentification(cbt.getServiceIdentification());
OwsServiceProvider serviceProvider = parseServiceProvider(cbt.getServiceProvider());
OwsOperationsMetadata operationsMetadata = parseOperationMetadata(cbt.getOperationsMetadata());
Collection<String> languages = null;
Collection<OwsCapabilitiesExtension> extensions = null;
return new OwsCapabilities(service, cbt.getVersion(), cbt.getUpdateSequence(), serviceIdentification, serviceProvider, operationsMetadata, languages, extensions);
}
Aggregations