Search in sources :

Example 1 with DeleteObservationDocument

use of net.opengis.sosdo.x20.DeleteObservationDocument in project arctic-sea by 52North.

the class DeleteObservationV20Decoder method decode.

public DeleteObservationRequest decode(XmlObject xmlObject) throws DecodingException {
    LOGGER.debug(String.format("REQUESTTYPE: %s", xmlObject != null ? xmlObject.getClass() : "null recevied"));
    // XmlHelper.validateDocument(xmlObject);
    if (xmlObject instanceof DeleteObservationDocument) {
        DeleteObservationDocument delObsDoc = (DeleteObservationDocument) xmlObject;
        DeleteObservationRequest decodedRequest = parseDeleteObservation(delObsDoc);
        LOGGER.debug(String.format("Decoded request: %s", decodedRequest));
        return decodedRequest;
    } else {
        throw new UnsupportedDecoderInputException(this, xmlObject);
    }
}
Also used : DeleteObservationRequest(org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest) DeleteObservationDocument(net.opengis.sosdo.x20.DeleteObservationDocument) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)

Example 2 with DeleteObservationDocument

use of net.opengis.sosdo.x20.DeleteObservationDocument in project arctic-sea by 52North.

the class DeleteObservationDecoder method decode.

@Override
public DeleteObservationRequest decode(XmlObject xmlObject) throws DecodingException {
    LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
    // XmlHelper.validateDocument(xmlObject);
    if (xmlObject instanceof DeleteObservationDocument) {
        DeleteObservationDocument delObsDoc = (DeleteObservationDocument) xmlObject;
        DeleteObservationRequest decodedRequest = parseDeleteObservation(delObsDoc);
        LOGGER.debug("Decoded request: {}", decodedRequest);
        return decodedRequest;
    } else {
        throw new UnsupportedDecoderInputException(this, xmlObject);
    }
}
Also used : DeleteObservationRequest(org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest) DeleteObservationDocument(net.opengis.sosdo.x10.DeleteObservationDocument) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)

Example 3 with DeleteObservationDocument

use of net.opengis.sosdo.x20.DeleteObservationDocument in project arctic-sea by 52North.

the class DeleteObservationV20Decoder method parseDeleteObservation.

private DeleteObservationRequest parseDeleteObservation(DeleteObservationDocument xbDelObsDoc) throws DecodingException {
    DeleteObservationRequest delObsRequest = null;
    DeleteObservationType xbDelObsType = xbDelObsDoc.getDeleteObservation();
    if (xbDelObsType != null) {
        delObsRequest = new DeleteObservationRequest(DeleteObservationConstants.NS_SOSDO_2_0);
        delObsRequest.setVersion(xbDelObsType.getVersion());
        delObsRequest.setService(xbDelObsType.getService());
        if (CollectionHelper.isNotNullOrEmpty(xbDelObsType.getObservationArray())) {
            delObsRequest.setObservationIdentifiers(Sets.newHashSet(xbDelObsType.getObservationArray()));
        } else {
            parseProcedure(xbDelObsType, delObsRequest);
            parseObservedProperty(xbDelObsType, delObsRequest);
            parseFeatureOfInterest(xbDelObsType, delObsRequest);
            parseOffering(xbDelObsType, delObsRequest);
            parseTemporalFilter(xbDelObsType, delObsRequest);
        }
    } else {
        throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
    }
    return delObsRequest;
}
Also used : DeleteObservationRequest(org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest) DecodingException(org.n52.svalbard.decode.exception.DecodingException) DeleteObservationType(net.opengis.sosdo.x20.DeleteObservationType)

Aggregations

DeleteObservationRequest (org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest)3 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)2 DeleteObservationDocument (net.opengis.sosdo.x10.DeleteObservationDocument)1 DeleteObservationDocument (net.opengis.sosdo.x20.DeleteObservationDocument)1 DeleteObservationType (net.opengis.sosdo.x20.DeleteObservationType)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1