Search in sources :

Example 16 with Extensions

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()));
}
Also used : Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Example 17 with Extensions

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);
}
Also used : Locale(java.util.Locale) OwsCapabilitiesExtension(org.n52.shetland.ogc.ows.OwsCapabilitiesExtension) CapabilitiesSection(org.n52.shetland.ogc.ows.OWSConstants.CapabilitiesSection) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) OwsServiceIdentification(org.n52.shetland.ogc.ows.OwsServiceIdentification)

Example 18 with Extensions

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);
}
Also used : OwsCapabilitiesExtension(org.n52.shetland.ogc.ows.OwsCapabilitiesExtension) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) OwsServiceIdentification(org.n52.shetland.ogc.ows.OwsServiceIdentification)

Aggregations

Extensions (org.n52.shetland.ogc.ows.extension.Extensions)11 Test (org.junit.Test)10 SweText (org.n52.shetland.ogc.swe.simpleType.SweText)4 XmlObject (org.apache.xmlbeans.XmlObject)3 DecodingException (org.n52.svalbard.decode.exception.DecodingException)3 XmlException (org.apache.xmlbeans.XmlException)2 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)2 OwsCapabilities (org.n52.shetland.ogc.ows.OwsCapabilities)2 OwsCapabilitiesExtension (org.n52.shetland.ogc.ows.OwsCapabilitiesExtension)2 OwsOperationsMetadata (org.n52.shetland.ogc.ows.OwsOperationsMetadata)2 OwsServiceIdentification (org.n52.shetland.ogc.ows.OwsServiceIdentification)2 OwsServiceProvider (org.n52.shetland.ogc.ows.OwsServiceProvider)2 OwsServiceCommunicationObject (org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject)2 SosProcedureDescription (org.n52.shetland.ogc.sos.SosProcedureDescription)2 Locale (java.util.Locale)1 GetFeatureOfInterestType (net.opengis.sos.x20.GetFeatureOfInterestType)1 DeleteSensorType (net.opengis.swes.x20.DeleteSensorType)1 DescribeSensorType (net.opengis.swes.x20.DescribeSensorType)1 InsertSensorType (net.opengis.swes.x20.InsertSensorType)1 SensorDescriptionType (net.opengis.swes.x20.SensorDescriptionType)1