use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class InsertResultResponseDecoder method decode.
@Override
public InsertResultResponse decode(XmlObject xmlObject) throws DecodingException {
LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
if (!(xmlObject instanceof InsertResultResponseDocument)) {
throw new UnsupportedDecoderInputException(this, xmlObject);
}
InsertResultResponseType isr = ((InsertResultResponseDocument) xmlObject).getInsertResultResponse();
if (isr == null) {
throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
}
return new InsertResultResponse();
}
use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.
the class GetObservationByIdResponseDocumentDecoder method decode.
@Override
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
public GetObservationByIdResponse decode(GetObservationByIdResponseDocument doc) throws DecodingException {
if (doc != null) {
GetObservationByIdResponse response = new GetObservationByIdResponse();
setService(response);
setVersions(response);
GetObservationByIdResponseType type = doc.getGetObservationByIdResponse();
response.setExtensions(parseExtensibleResponse(type));
response.setObservationCollection(ObservationStream.of(parseObservations(type)));
return response;
}
throw new UnsupportedDecoderInputException(this, doc);
}
Aggregations