Search in sources :

Example 1 with GetDataAvailabilityRequest

use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityRequest in project arctic-sea by 52North.

the class GetDataAvailabilityV20XmlDecoder method parseGetDataAvailability.

/**
 * Parse the GetDataAvailability XML request
 *
 * @param xml
 *            GetDataAvailability XML request
 * @return {@code GetDataAvailabilityRequest}
 * @throws OwsExceptionReport
 *             If the document could no be parsed
 */
private GetDataAvailabilityRequest parseGetDataAvailability(GetDataAvailabilityDocument xml) throws DecodingException {
    GetDataAvailabilityRequest request = new GetDataAvailabilityRequest();
    GetDataAvailabilityType gdat = xml.getGetDataAvailability();
    request.setNamespace(XmlHelper.getNamespace(xml));
    request.setResponseFormat(XmlHelper.getNamespace(xml));
    request.setService(gdat.getService());
    request.setVersion(gdat.getVersion());
    if (CollectionHelper.isNotNullOrEmpty(gdat.getObservedPropertyArray())) {
        for (String s : gdat.getObservedPropertyArray()) {
            request.addObservedProperty(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getProcedureArray())) {
        for (String s : gdat.getProcedureArray()) {
            request.addProcedure(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getFeatureOfInterestArray())) {
        for (String s : gdat.getFeatureOfInterestArray()) {
            request.addFeatureOfInterest(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getOfferingArray())) {
        for (String s : gdat.getOfferingArray()) {
            request.addOffering(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getResponseFormatArray())) {
        for (String s : gdat.getResponseFormatArray()) {
            request.setResponseFormat(s);
        }
    }
    request.setExtensions(parseExtensibleRequest(gdat));
    return request;
}
Also used : GetDataAvailabilityRequest(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityRequest) GetDataAvailabilityType(net.opengis.sosgda.x20.GetDataAvailabilityType)

Example 2 with GetDataAvailabilityRequest

use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityRequest in project arctic-sea by 52North.

the class GetDataAvailabilityXmlDecoder method parseGetDataAvailability.

/**
 * Parse the GetDataAvailability XML request
 *
 * @param xml
 *            GetDataAvailability XML request
 * @return {@code GetDataAvailabilityRequest}
 * @throws DecodingException
 *             If the document could no be parsed
 */
private GetDataAvailabilityRequest parseGetDataAvailability(GetDataAvailabilityDocument xml) throws DecodingException {
    GetDataAvailabilityRequest request = new GetDataAvailabilityRequest();
    GetDataAvailabilityType gdat = xml.getGetDataAvailability();
    String namespace = XmlHelper.getNamespace(xml);
    request.setNamespace(namespace);
    request.setResponseFormat(namespace);
    request.setService(gdat.getService());
    request.setVersion(gdat.getVersion());
    if (CollectionHelper.isNotNullOrEmpty(gdat.getObservedPropertyArray())) {
        for (String s : gdat.getObservedPropertyArray()) {
            request.addObservedProperty(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getProcedureArray())) {
        for (String s : gdat.getProcedureArray()) {
            request.addProcedure(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getFeatureOfInterestArray())) {
        for (String s : gdat.getFeatureOfInterestArray()) {
            request.addFeatureOfInterest(s);
        }
    }
    if (CollectionHelper.isNotNullOrEmpty(gdat.getOfferingArray())) {
        for (String s : gdat.getOfferingArray()) {
            request.addOffering(s);
        }
    }
    request.setExtensions(parseExtensibleRequest(gdat));
    return request;
}
Also used : GetDataAvailabilityRequest(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityRequest) GetDataAvailabilityType(net.opengis.sosgda.x10.GetDataAvailabilityType)

Aggregations

GetDataAvailabilityRequest (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityRequest)2 GetDataAvailabilityType (net.opengis.sosgda.x10.GetDataAvailabilityType)1 GetDataAvailabilityType (net.opengis.sosgda.x20.GetDataAvailabilityType)1