Search in sources :

Example 6 with GetCapabilitiesRequest

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

the class EventHandlerFinderTest method findNoHandlers.

@Test(expected = NullPointerException.class)
public void findNoHandlers() {
    Map<String, StatisticsServiceEventHandler<?>> handlers = new HashMap<>();
    DefaultServiceEventHandler handler = new DefaultServiceEventHandler();
    handlers.put("morpheus", handler);
    GetCapabilitiesRequest request = new GetCapabilitiesRequest("SOS");
    EventHandlerFinder.findHandler(request, handlers);
}
Also used : GetCapabilitiesRequest(org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest) HashMap(java.util.HashMap) StatisticsServiceEventHandler(org.n52.iceland.statistics.api.interfaces.StatisticsServiceEventHandler) DefaultServiceEventHandler(org.n52.iceland.statistics.impl.handlers.DefaultServiceEventHandler) Test(org.junit.Test)

Example 7 with GetCapabilitiesRequest

use of org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest 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 8 with GetCapabilitiesRequest

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

the class SosDecoderv100 method parseGetCapabilities.

/**
 * parses the XmlBean representing the getCapabilities request and creates a
 * SosGetCapabilities request
 *
 * @param getCapsDoc
 *            XmlBean created from the incoming request stream
 * @return Returns SosGetCapabilitiesRequest representing the request
 */
private OwsServiceRequest parseGetCapabilities(GetCapabilitiesDocument getCapsDoc) {
    GetCapabilities getCaps = getCapsDoc.getGetCapabilities();
    GetCapabilitiesRequest request = new GetCapabilitiesRequest(getCaps.getService());
    if (getCaps.getAcceptFormats() != null && getCaps.getAcceptFormats().sizeOfOutputFormatArray() != 0) {
        request.setAcceptFormats(Arrays.asList(getCaps.getAcceptFormats().getOutputFormatArray()));
    }
    if (getCaps.getAcceptVersions() != null && getCaps.getAcceptVersions().sizeOfVersionArray() != 0) {
        request.setAcceptVersions(Arrays.asList(getCaps.getAcceptVersions().getVersionArray()));
    }
    if (getCaps.getSections() != null && getCaps.getSections().getSectionArray().length != 0) {
        request.setSections(Arrays.asList(getCaps.getSections().getSectionArray()));
    }
    return request;
}
Also used : GetCapabilitiesRequest(org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest) GetCapabilities(net.opengis.sos.x10.GetCapabilitiesDocument.GetCapabilities)

Aggregations

GetCapabilitiesRequest (org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest)6 InvalidServiceParameterException (org.n52.iceland.exception.ows.concrete.InvalidServiceParameterException)2 HashMap (java.util.HashMap)1 Locale (java.util.Locale)1 Objects (java.util.Objects)1 GetCapabilities (net.opengis.sos.x10.GetCapabilitiesDocument.GetCapabilities)1 GetCapabilitiesType (net.opengis.sos.x20.GetCapabilitiesType)1 Test (org.junit.Test)1 InvalidAcceptVersionsParameterException (org.n52.iceland.exception.ows.concrete.InvalidAcceptVersionsParameterException)1 InvalidServiceOrVersionException (org.n52.iceland.exception.ows.concrete.InvalidServiceOrVersionException)1 VersionNotSupportedException (org.n52.iceland.exception.ows.concrete.VersionNotSupportedException)1 StatisticsServiceEventHandler (org.n52.iceland.statistics.api.interfaces.StatisticsServiceEventHandler)1 DefaultServiceEventHandler (org.n52.iceland.statistics.impl.handlers.DefaultServiceEventHandler)1 CapabilitiesSection (org.n52.shetland.ogc.ows.OWSConstants.CapabilitiesSection)1 OwsCapabilities (org.n52.shetland.ogc.ows.OwsCapabilities)1 OwsCapabilitiesExtension (org.n52.shetland.ogc.ows.OwsCapabilitiesExtension)1 OwsOperationsMetadata (org.n52.shetland.ogc.ows.OwsOperationsMetadata)1 OwsServiceIdentification (org.n52.shetland.ogc.ows.OwsServiceIdentification)1 OwsServiceProvider (org.n52.shetland.ogc.ows.OwsServiceProvider)1 MissingServiceParameterException (org.n52.shetland.ogc.ows.exception.MissingServiceParameterException)1