Search in sources :

Example 6 with UnsupportedDecoderInputException

use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.

the class CapabilitiesDecoder method decode.

@Override
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
public SosCapabilities decode(Capabilities c) throws DecodingException {
    if (c != null) {
        OwsCapabilities owsCapabilities = parseCapabilitiesBaseType(SosConstants.SOS, c);
        FilterCapabilities filterCapabilities = parseFilterCapabilities(c.getFilterCapabilities());
        Collection<SosObservationOffering> contents = parseContents(c.getContents());
        return new SosCapabilities(owsCapabilities, filterCapabilities, contents);
    }
    throw new UnsupportedDecoderInputException(this, c);
}
Also used : FilterCapabilities(org.n52.shetland.ogc.filter.FilterCapabilities) SosCapabilities(org.n52.shetland.ogc.sos.SosCapabilities) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) SosObservationOffering(org.n52.shetland.ogc.sos.SosObservationOffering) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 7 with UnsupportedDecoderInputException

use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.

the class CapabilitiesTypeDecoder method decode.

@Override
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
public SosCapabilities decode(CapabilitiesType ct) throws DecodingException {
    if (ct != null) {
        OwsCapabilities owsCapabilities = parseCapabilitiesBaseType(SosConstants.SOS, ct);
        FilterCapabilities filterCapabilities = parseFilterCapabilities(ct.getFilterCapabilities());
        Collection<SosObservationOffering> contents = parseContents(ct.getContents());
        return new SosCapabilities(owsCapabilities, filterCapabilities, contents);
    }
    throw new UnsupportedDecoderInputException(this, ct);
}
Also used : FilterCapabilities(org.n52.shetland.ogc.filter.FilterCapabilities) SosCapabilities(org.n52.shetland.ogc.sos.SosCapabilities) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) SosObservationOffering(org.n52.shetland.ogc.sos.SosObservationOffering) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 8 with UnsupportedDecoderInputException

use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.

the class CapabilitiesV1DocumentDecoder method decode.

@Override
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
public GetCapabilitiesResponse decode(CapabilitiesDocument cd) throws DecodingException {
    if (cd != null) {
        GetCapabilitiesResponse response = new GetCapabilitiesResponse();
        OwsCapabilities capabilities = (OwsCapabilities) decodeXmlObject(cd.getCapabilities());
        response.setCapabilities(capabilities);
        return response;
    }
    throw new UnsupportedDecoderInputException(this, cd);
}
Also used : GetCapabilitiesResponse(org.n52.shetland.ogc.ows.service.GetCapabilitiesResponse) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 9 with UnsupportedDecoderInputException

use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException 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 10 with UnsupportedDecoderInputException

use of org.n52.svalbard.decode.exception.UnsupportedDecoderInputException in project arctic-sea by 52North.

the class DeleteResultTemplateDecoder method decode.

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

Aggregations

UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)21 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)7 OwsCapabilities (org.n52.shetland.ogc.ows.OwsCapabilities)4 XmlObject (org.apache.xmlbeans.XmlObject)3 DecodingException (org.n52.svalbard.decode.exception.DecodingException)3 FilterCapabilities (org.n52.shetland.ogc.filter.FilterCapabilities)2 NamedValue (org.n52.shetland.ogc.om.NamedValue)2 GetCapabilitiesResponse (org.n52.shetland.ogc.ows.service.GetCapabilitiesResponse)2 SosCapabilities (org.n52.shetland.ogc.sos.SosCapabilities)2 SosObservationOffering (org.n52.shetland.ogc.sos.SosObservationOffering)2 DeleteObservationRequest (org.n52.shetland.ogc.sos.delobs.DeleteObservationRequest)2 DocumentCitationType (eu.europa.ec.inspire.schemas.base2.x20.DocumentCitationType)1 Link (eu.europa.ec.inspire.schemas.base2.x20.DocumentCitationType.Link)1 RelatedPartyType (eu.europa.ec.inspire.schemas.base2.x20.RelatedPartyType)1 BigDecimal (java.math.BigDecimal)1 DeleteResultTemplateDocument (net.opengis.drt.x10.DeleteResultTemplateDocument)1 ReferenceType (net.opengis.gml.x32.ReferenceType)1 InsertFeatureOfInterestDocument (net.opengis.ifoi.x10.InsertFeatureOfInterestDocument)1 NamedValueType (net.opengis.om.x20.NamedValueType)1 GetFeatureOfInterestResponseType (net.opengis.sos.x20.GetFeatureOfInterestResponseType)1