Search in sources :

Example 21 with UnsupportedDecoderInputException

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();
}
Also used : InsertResultResponseType(net.opengis.sos.x20.InsertResultResponseType) DecodingException(org.n52.svalbard.decode.exception.DecodingException) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) InsertResultResponseDocument(net.opengis.sos.x20.InsertResultResponseDocument) InsertResultResponse(org.n52.shetland.ogc.sos.response.InsertResultResponse)

Example 22 with UnsupportedDecoderInputException

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);
}
Also used : GetObservationByIdResponse(org.n52.shetland.ogc.sos.response.GetObservationByIdResponse) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) GetObservationByIdResponseType(net.opengis.sos.x20.GetObservationByIdResponseType) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Aggregations

UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)21 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)7 OwsCapabilities (org.n52.shetland.ogc.ows.OwsCapabilities)4 XmlObject (org.apache.xmlbeans.XmlObject)3 DecodingException (org.n52.svalbard.decode.exception.DecodingException)3 FilterCapabilities (org.n52.shetland.ogc.filter.FilterCapabilities)2 NamedValue (org.n52.shetland.ogc.om.NamedValue)2 GetCapabilitiesResponse (org.n52.shetland.ogc.ows.service.GetCapabilitiesResponse)2 SosCapabilities (org.n52.shetland.ogc.sos.SosCapabilities)2 SosObservationOffering (org.n52.shetland.ogc.sos.SosObservationOffering)2 DeleteObservationRequest (org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest)2 DocumentCitationType (eu.europa.ec.inspire.schemas.base2.x20.DocumentCitationType)1 Link (eu.europa.ec.inspire.schemas.base2.x20.DocumentCitationType.Link)1 RelatedPartyType (eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType)1 BigDecimal (java.math.BigDecimal)1 DeleteResultTemplateDocument (net.opengis.drt.x10.DeleteResultTemplateDocument)1 ReferenceType (net.opengis.gml.x32.ReferenceType)1 InsertFeatureOfInterestDocument (net.opengis.ifoi.x10.InsertFeatureOfInterestDocument)1 NamedValueType (net.opengis.om.x20.NamedValueType)1 GetFeatureOfInterestResponseType (net.opengis.sos.x20.GetFeatureOfInterestResponseType)1