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