use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetFeatureOfInterest.
// private SwesExtensions parseSwesExtensions(final XmlObject[]
// extensionArray) throws OwsExceptionReport
// {
// final SwesExtensions extensions = new SwesExtensions();
// for (final XmlObject xbSwesExtension : extensionArray) {
//
// final Object obj = CodingHelper.decodeXmlElement(xbSwesExtension);
// if (obj instanceof SwesExtension<?>) {
// extensions.addSwesExtension((SwesExtension<?>) obj);
// }
// }
// return extensions;
// }
/**
* parses the passes XmlBeans document and creates a SOS
* getFeatureOfInterest request
*
* @param getFoiDoc
* XmlBeans document representing the getFeatureOfInterest
* request
* @return Returns SOS getFeatureOfInterest request
*
* @throws DecodingException
* * if validation of the request failed
*/
private OwsServiceRequest parseGetFeatureOfInterest(final GetFeatureOfInterestDocument getFoiDoc) throws DecodingException {
final GetFeatureOfInterestRequest getFoiRequest = new GetFeatureOfInterestRequest();
final GetFeatureOfInterestType getFoiType = getFoiDoc.getGetFeatureOfInterest();
getFoiRequest.setService(getFoiType.getService());
getFoiRequest.setVersion(getFoiType.getVersion());
getFoiRequest.setFeatureIdentifiers(Arrays.asList(getFoiType.getFeatureOfInterestArray()));
getFoiRequest.setObservedProperties(Arrays.asList(getFoiType.getObservedPropertyArray()));
getFoiRequest.setProcedures(Arrays.asList(getFoiType.getProcedureArray()));
getFoiRequest.setSpatialFilters(parseSpatialFilters4GetFeatureOfInterest(getFoiType.getSpatialFilterArray()));
getFoiRequest.setExtensions(parseExtensibleRequest(getFoiType));
return getFoiRequest;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SosDecoderv20 method parseInsertResultTemplate.
private OwsServiceRequest parseInsertResultTemplate(final InsertResultTemplateDocument insertResultTemplateDoc) throws DecodingException {
InsertResultTemplateRequest sosInsertResultTemplate = new InsertResultTemplateRequest();
InsertResultTemplateType insertResultTemplate = insertResultTemplateDoc.getInsertResultTemplate();
sosInsertResultTemplate.setService(insertResultTemplate.getService());
sosInsertResultTemplate.setVersion(insertResultTemplate.getVersion());
ResultTemplateType resultTemplate = insertResultTemplate.getProposedTemplate().getResultTemplate();
sosInsertResultTemplate.setIdentifier(resultTemplate.getIdentifier());
OmObservationConstellation sosObservationConstellation = parseObservationTemplate(resultTemplate.getObservationTemplate());
sosObservationConstellation.addOffering(resultTemplate.getOffering());
sosInsertResultTemplate.setObservationTemplate(sosObservationConstellation);
try {
sosInsertResultTemplate.setResultStructure(parseResultStructure(XmlObject.Factory.parse(resultTemplate.getResultStructure().xmlText())));
sosInsertResultTemplate.setResultEncoding(parseResultEncoding(XmlObject.Factory.parse(resultTemplate.getResultEncoding().xmlText())));
} catch (XmlException e) {
throw new DecodingException(e, "Error while parsing InsertResultTemplate request!");
}
sosInsertResultTemplate.setExtensions(parseExtensibleRequest(insertResultTemplate));
return sosInsertResultTemplate;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetObservationById.
private OwsServiceRequest parseGetObservationById(final GetObservationByIdDocument getObsByIdDoc) throws DecodingException {
final GetObservationByIdRequest getObsByIdRequest = new GetObservationByIdRequest();
final GetObservationByIdType getObsByIdType = getObsByIdDoc.getGetObservationById();
getObsByIdRequest.setService(getObsByIdType.getService());
getObsByIdRequest.setVersion(getObsByIdType.getVersion());
getObsByIdRequest.setObservationIdentifier(Arrays.asList(getObsByIdType.getObservationArray()));
getObsByIdRequest.setExtensions(parseExtensibleRequest(getObsByIdType));
return getObsByIdRequest;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SosDecoderv20 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
*
* @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;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SpecimenDecoderv20 method parseSpatialSamplingFeature.
private AbstractFeature parseSpatialSamplingFeature(final SFSpecimenType sfst) throws DecodingException {
final SfSpecimen specimen = new SfSpecimen(null, sfst.getId());
// parse identifier, names, description
parseAbstractFeatureType(sfst, specimen);
specimen.setSampledFeatures(getSampledFeatures(sfst.getSampledFeatureArray()));
specimen.setXml(getXmlDescription(sfst));
if (sfst.getParameterArray() != null) {
specimen.setParameters(parseNamedValueTypeArray(sfst.getParameterArray()));
}
// TODO
sfst.getMaterialClass();
specimen.setMaterialClass((ReferenceType) decodeXmlElement(sfst.getMaterialClass()));
specimen.setSamplingTime(getSamplingTime(sfst));
// samplingLocation
if (sfst.isSetSamplingLocation()) {
specimen.setSamplingLocation(getGeometry(sfst));
}
// sfst.getProcessingDetailsArray();
if (sfst.isSetSize()) {
specimen.setSize(getSize(sfst.getSize()));
}
// }
if (sfst.isSetSpecimenType()) {
specimen.setSpecimenType((ReferenceType) decodeXmlElement(sfst.getSpecimenType()));
}
return specimen;
}
Aggregations