Search in sources :

Example 1 with DescribeSensorDocument

use of net.opengis.sos.x10.DescribeSensorDocument in project arctic-sea by 52North.

the class SwesDecoderv20 method decode.

@Override
public OwsServiceRequest decode(XmlObject xmlObject) throws DecodingException {
    LOGGER.debug("REQUESTTYPE:" + xmlObject.getClass());
    XmlHelper.validateDocument(xmlObject);
    if (xmlObject instanceof DescribeSensorDocument) {
        return parseDescribeSensor((DescribeSensorDocument) xmlObject);
    } else if (xmlObject instanceof InsertSensorDocument) {
        return parseInsertSensor((InsertSensorDocument) xmlObject);
    } else if (xmlObject instanceof UpdateSensorDescriptionDocument) {
        return parseUpdateSensorDescription((UpdateSensorDescriptionDocument) xmlObject);
    } else if (xmlObject instanceof DeleteSensorDocument) {
        return parseDeleteSensor((DeleteSensorDocument) xmlObject);
    } else {
        throw new UnsupportedDecoderXmlInputException(this, xmlObject);
    }
}
Also used : InsertSensorDocument(net.opengis.swes.x20.InsertSensorDocument) DeleteSensorDocument(net.opengis.swes.x20.DeleteSensorDocument) DescribeSensorDocument(net.opengis.swes.x20.DescribeSensorDocument) UnsupportedDecoderXmlInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException) UpdateSensorDescriptionDocument(net.opengis.swes.x20.UpdateSensorDescriptionDocument)

Example 2 with DescribeSensorDocument

use of net.opengis.sos.x10.DescribeSensorDocument in project arctic-sea by 52North.

the class DescribeSensorV1RequestEncoder method create.

@Override
protected XmlObject create(DescribeSensorRequest request) throws EncodingException {
    DescribeSensorDocument doc = DescribeSensorDocument.Factory.newInstance(getXmlOptions());
    DescribeSensorDocument.DescribeSensor descSens = doc.addNewDescribeSensor();
    addVersion(descSens, request);
    addService(descSens, request);
    addProcedure(descSens, request);
    addOutputFormat(descSens, request);
    return doc;
}
Also used : DescribeSensorDocument(net.opengis.sos.x10.DescribeSensorDocument)

Example 3 with DescribeSensorDocument

use of net.opengis.sos.x10.DescribeSensorDocument in project arctic-sea by 52North.

the class DescribeSensorV2RequestEncoder method create.

@Override
protected XmlObject create(DescribeSensorRequest request) throws EncodingException {
    validateInput(request);
    DescribeSensorDocument doc = DescribeSensorDocument.Factory.newInstance(getXmlOptions());
    DescribeSensorType descSensType = doc.addNewDescribeSensor();
    descSensType.setVersion(request.getVersion());
    descSensType.setService(request.getService());
    descSensType.setProcedure(request.getProcedure());
    descSensType.setProcedureDescriptionFormat(request.getProcedureDescriptionFormat());
    return doc;
}
Also used : DescribeSensorDocument(net.opengis.swes.x20.DescribeSensorDocument) DescribeSensorType(net.opengis.swes.x20.DescribeSensorType)

Example 4 with DescribeSensorDocument

use of net.opengis.sos.x10.DescribeSensorDocument in project arctic-sea by 52North.

the class SosDecoderv100 method parseDescribeSensor.

/**
 * parses the XmlBean representing the describeSensor request and creates a
 * DescribeSensor request
 *
 * @param descSensorDoc
 *            XmlBean created from the incoming request stream
 * @return Returns SosDescribeSensorRequest representing the request
 */
private OwsServiceCommunicationObject parseDescribeSensor(DescribeSensorDocument descSensorDoc) {
    DescribeSensorRequest request = new DescribeSensorRequest();
    DescribeSensor descSensor = descSensorDoc.getDescribeSensor();
    request.setService(descSensor.getService());
    request.setVersion(descSensor.getVersion());
    // parse outputFormat through MediaType to ensure it's a mime type and
    // eliminate whitespace variations
    request.setProcedureDescriptionFormat(MediaType.normalizeString(descSensor.getOutputFormat()));
    request.setProcedure(descSensor.getProcedure());
    return request;
}
Also used : DescribeSensor(net.opengis.sos.x10.DescribeSensorDocument.DescribeSensor) DescribeSensorRequest(org.n52.shetland.ogc.sos.request.DescribeSensorRequest)

Example 5 with DescribeSensorDocument

use of net.opengis.sos.x10.DescribeSensorDocument in project arctic-sea by 52North.

the class SosDecoderv100 method decode.

@Override
public OwsServiceCommunicationObject decode(XmlObject xmlObject) throws DecodingException {
    OwsServiceCommunicationObject request = null;
    LOGGER.debug("REQUESTTYPE:" + xmlObject.getClass());
    /*
         * Add O&M 1.0.0 namespace to GetObservation document. XmlBeans removes
         * the namespace from the document because there are no om:... elements
         * in the document. But the validation fails if the <resultModel>
         * element is set with e.g. om:Measurement.
         */
    if (xmlObject instanceof GetObservationDocument) {
        XmlCursor cursor = xmlObject.newCursor();
        cursor.toFirstChild();
        cursor.insertNamespace(OmConstants.NS_OM_PREFIX, OmConstants.NS_OM);
        cursor.dispose();
    }
    // validate document
    XmlHelper.validateDocument(xmlObject);
    if (xmlObject instanceof GetCapabilitiesDocument) {
        // getCapabilities request
        GetCapabilitiesDocument getCapsDoc = (GetCapabilitiesDocument) xmlObject;
        request = parseGetCapabilities(getCapsDoc);
    } else if (xmlObject instanceof DescribeSensorDocument) {
        // DescribeSensor request (still SOS 1.0 NS_URI
        DescribeSensorDocument descSensorDoc = (DescribeSensorDocument) xmlObject;
        request = parseDescribeSensor(descSensorDoc);
    } else if (xmlObject instanceof GetObservationDocument) {
        // getObservation request
        GetObservationDocument getObsDoc = (GetObservationDocument) xmlObject;
        request = parseGetObservation(getObsDoc);
    } else if (xmlObject instanceof GetFeatureOfInterestDocument) {
        // getFeatureOfInterest request
        GetFeatureOfInterestDocument getFoiDoc = (GetFeatureOfInterestDocument) xmlObject;
        request = parseGetFeatureOfInterest(getFoiDoc);
    } else if (xmlObject instanceof GetObservationByIdDocument) {
        // getObservationById request
        GetObservationByIdDocument getObsByIdDoc = (GetObservationByIdDocument) xmlObject;
        request = parseGetObservationById(getObsByIdDoc);
    } else {
        throw new UnsupportedDecoderXmlInputException(this, xmlObject);
    }
    return request;
}
Also used : OwsServiceCommunicationObject(org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject) GetObservationDocument(net.opengis.sos.x10.GetObservationDocument) DescribeSensorDocument(net.opengis.sos.x10.DescribeSensorDocument) GetFeatureOfInterestDocument(net.opengis.sos.x10.GetFeatureOfInterestDocument) GetObservationByIdDocument(net.opengis.sos.x10.GetObservationByIdDocument) UnsupportedDecoderXmlInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException) GetCapabilitiesDocument(net.opengis.sos.x10.GetCapabilitiesDocument) XmlCursor(org.apache.xmlbeans.XmlCursor)

Aggregations

DescribeSensorDocument (net.opengis.sos.x10.DescribeSensorDocument)2 DescribeSensorDocument (net.opengis.swes.x20.DescribeSensorDocument)2 UnsupportedDecoderXmlInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException)2 DescribeSensor (net.opengis.sos.x10.DescribeSensorDocument.DescribeSensor)1 GetCapabilitiesDocument (net.opengis.sos.x10.GetCapabilitiesDocument)1 GetFeatureOfInterestDocument (net.opengis.sos.x10.GetFeatureOfInterestDocument)1 GetObservationByIdDocument (net.opengis.sos.x10.GetObservationByIdDocument)1 GetObservationDocument (net.opengis.sos.x10.GetObservationDocument)1 DeleteSensorDocument (net.opengis.swes.x20.DeleteSensorDocument)1 DescribeSensorType (net.opengis.swes.x20.DescribeSensorType)1 InsertSensorDocument (net.opengis.swes.x20.InsertSensorDocument)1 UpdateSensorDescriptionDocument (net.opengis.swes.x20.UpdateSensorDescriptionDocument)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 OwsServiceCommunicationObject (org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject)1 DescribeSensorRequest (org.n52.shetland.ogc.sos.request.DescribeSensorRequest)1