/** * 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; }
/** * 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 * * * @throws OwsExceptionReport * * If parsing the XmlBean failed */ private AbstractServiceRequest<?> parseGetCapabilities(GetCapabilitiesDocument getCapsDoc) throws OwsExceptionReport { GetCapabilitiesRequest request = new GetCapabilitiesRequest(); GetCapabilities getCaps = getCapsDoc.getGetCapabilities(); request.setService(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; }
/** * 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 * * * @throws DecodingException * * If parsing the XmlBean failed */ private OwsServiceRequest parseGetCapabilities(final GetCapabilitiesDocument getCapsDoc) throws DecodingException { final GetCapabilitiesType getCapsType = getCapsDoc.getGetCapabilities2(); final GetCapabilitiesRequest request = new GetCapabilitiesRequest(getCapsType.getService()); if (getCapsType.getAcceptFormats() != null && getCapsType.getAcceptFormats().sizeOfOutputFormatArray() != 0) { request.setAcceptFormats(Arrays.asList(getCapsType.getAcceptFormats().getOutputFormatArray())); } if (getCapsType.getAcceptVersions() != null && getCapsType.getAcceptVersions().sizeOfVersionArray() != 0) { request.setAcceptVersions(Arrays.asList(getCapsType.getAcceptVersions().getVersionArray())); } if (getCapsType.getSections() != null && getCapsType.getSections().getSectionArray().length != 0) { request.setSections(Arrays.asList(getCapsType.getSections().getSectionArray())); } if (getCapsType.getExtensionArray() != null && getCapsType.getExtensionArray().length > 0) { request.setExtensions(parseExtensibleRequestExtension(getCapsType.getExtensionArray())); } return request; }