Search in sources :

Example 1 with InsertFeatureOfInterestDocument

use of net.opengis.ifoi.x10.InsertFeatureOfInterestDocument in project arctic-sea by 52North.

the class InsertFeatureOfInterestDecoder method parseInsertFeatureOfInterest.

private InsertFeatureOfInterestRequest parseInsertFeatureOfInterest(InsertFeatureOfInterestDocument ifoid) throws DecodingException {
    InsertFeatureOfInterestRequest request = null;
    InsertFeatureOfInterestType ifoit = ifoid.getInsertFeatureOfInterest();
    if (ifoit != null) {
        request = new InsertFeatureOfInterestRequest();
        request.setVersion(ifoit.getVersion());
        request.setService(ifoit.getService());
        if (CollectionHelper.isNotNullOrEmpty(ifoit.getFeatureMemberArray())) {
            parseFeatureMember(ifoit, request);
        }
    } else {
        throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
    }
    return request;
}
Also used : InsertFeatureOfInterestType(net.opengis.ifoi.x10.InsertFeatureOfInterestType) InsertFeatureOfInterestRequest(org.n52.shetland.ogc.sos.ifoi.InsertFeatureOfInterestRequest) DecodingException(org.n52.svalbard.decode.exception.DecodingException)

Example 2 with InsertFeatureOfInterestDocument

use of net.opengis.ifoi.x10.InsertFeatureOfInterestDocument in project arctic-sea by 52North.

the class InsertFeatureOfInterestDecoder method decode.

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

Aggregations

InsertFeatureOfInterestRequest (org.n52.shetland.ogc.sos.ifoi.InsertFeatureOfInterestRequest)2 InsertFeatureOfInterestDocument (net.opengis.ifoi.x10.InsertFeatureOfInterestDocument)1 InsertFeatureOfInterestType (net.opengis.ifoi.x10.InsertFeatureOfInterestType)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1