use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class InsertObservationResponseV20Decoder method decode.
@Override
public InsertObservationResponse decode(XmlObject xmlObject) throws DecodingException {
LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
if (!(xmlObject instanceof InsertObservationResponseDocument)) {
throw new UnsupportedDecoderInputException(this, xmlObject);
}
InsertObservationResponseType isr = ((InsertObservationResponseDocument) xmlObject).getInsertObservationResponse();
if (isr == null) {
throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
}
return new InsertObservationResponse();
}
use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class InsertResultTemplateResponseDecoder method decode.
@Override
public InsertResultTemplateResponse decode(XmlObject xmlObject) throws DecodingException {
LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
if (!(xmlObject instanceof InsertResultTemplateResponseDocument)) {
throw new UnsupportedDecoderInputException(this, xmlObject);
}
InsertResultTemplateResponseDocument isrd = (InsertResultTemplateResponseDocument) xmlObject;
InsertResultTemplateResponseType isr = isrd.getInsertResultTemplateResponse();
if (isr == null) {
throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
}
InsertResultTemplateResponse decodedResponse = new InsertResultTemplateResponse(SosConstants.SOS, Sos2Constants.SERVICEVERSION);
decodedResponse.setAcceptedTemplate(isr.getAcceptedTemplate());
return decodedResponse;
}
use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class InsertSensorResponseDecoder method decode.
@Override
public InsertSensorResponse decode(XmlObject xmlObject) throws DecodingException {
LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
if (!(xmlObject instanceof InsertSensorResponseDocument)) {
throw new UnsupportedDecoderInputException(this, xmlObject);
}
InsertSensorResponseDocument isrd = (InsertSensorResponseDocument) xmlObject;
InsertSensorResponseType isr = isrd.getInsertSensorResponse();
if (isr == null) {
throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
}
InsertSensorResponse decodedResponse = new InsertSensorResponse(SosConstants.SOS, Sos2Constants.SERVICEVERSION);
decodedResponse.setAssignedOffering(isr.getAssignedOffering());
decodedResponse.setAssignedProcedure(isr.getAssignedProcedure());
return decodedResponse;
}
use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class SwesExtensionDecoderv20 method decode.
@Override
public SwesExtension<?> decode(XmlObject xmlObject) throws DecodingException, UnsupportedDecoderInputException {
if (isSwesExtension(xmlObject)) {
XmlObject[] children = xmlObject.selectPath("./*");
if (children.length == 1) {
Object xmlObj = decodeXmlElement(children[0]);
if (xmlObj instanceof SweAbstractDataComponent) {
SwesExtension<SweAbstractDataComponent> extension = new SwesExtension<>();
extension.setValue((SweAbstractDataComponent) xmlObj);
return extension;
}
}
}
throw new UnsupportedDecoderXmlInputException(this, xmlObject);
}
use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class RelatedPartyTypeDecoder method decode.
@Override
public RelatedParty decode(XmlObject xmlObject) throws DecodingException {
if (xmlObject instanceof RelatedPartyType) {
RelatedPartyType rpt = (RelatedPartyType) xmlObject;
RelatedParty relatedParty = new RelatedParty();
relatedParty.setContact(parseContact(rpt));
relatedParty.setIndividualName((PT_FreeText) decodeXmlElement(rpt.getIndividualName()));
relatedParty.setOrganisationName((PT_FreeText) decodeXmlElement(rpt.getOrganisationName()));
relatedParty.setPositionName((PT_FreeText) decodeXmlElement(rpt.getPositionName()));
relatedParty.setRoles(parseRole(rpt));
return relatedParty;
}
throw new UnsupportedDecoderInputException(this, xmlObject);
}
Aggregations