Search in sources :

Example 1 with DeleteObservationType

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

the class DeleteObservationDecoder 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_1_0);
        delObsRequest.setVersion(xbDelObsType.getVersion());
        delObsRequest.setService(xbDelObsType.getService());
        delObsRequest.addObservationIdentifier(xbDelObsType.getObservation());
    } 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.x10.DeleteObservationType)

Example 2 with DeleteObservationType

use of net.opengis.sosdo.x20.DeleteObservationType 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)2 DecodingException (org.n52.svalbard.decode.exception.DecodingException)2 DeleteObservationType (net.opengis.sosdo.x10.DeleteObservationType)1 DeleteObservationType (net.opengis.sosdo.x20.DeleteObservationType)1