Search in sources :

Example 6 with CompositeException

use of org.n52.janmayen.exception.CompositeException in project arctic-sea by 52North.

the class AbstractKvpDecoder method decode.

@Override
public R decode(Map<String, String> parameters) throws DecodingException {
    if (parameters == null) {
        throw new DecodingException("The request does not contain any parameter!");
    }
    CompositeException exceptions = new CompositeException();
    R request = this.supplier.get();
    parameters.forEach(exceptions.wrapConsumer(getDecoder(new Builder<R>().add(this::getCommonRequestParameterDefinitions).add(this::getRequestParameterDefinitions).build()).curryFirst(request)));
    if (exceptions.hasExceptions()) {
        throw new DecodingException(exceptions);
    }
    return request;
}
Also used : CompositeException(org.n52.janmayen.exception.CompositeException) DecodingException(org.n52.svalbard.decode.exception.DecodingException)

Aggregations

CompositeException (org.n52.janmayen.exception.CompositeException)6 DecodingException (org.n52.svalbard.decode.exception.DecodingException)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 Optional (java.util.Optional)1 InsertObservationType (net.opengis.sos.x20.InsertObservationType)1 Observation (net.opengis.sos.x20.InsertObservationType.Observation)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 XmlError (org.apache.xmlbeans.XmlError)1 XmlObject (org.apache.xmlbeans.XmlObject)1 XmlOptions (org.apache.xmlbeans.XmlOptions)1 XmlString (org.apache.xmlbeans.XmlString)1 XmlValidationError (org.apache.xmlbeans.XmlValidationError)1 LocationHintException (org.n52.janmayen.exception.LocationHintException)1 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)1 Time (org.n52.shetland.ogc.gml.time.Time)1 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)1 OmObservation (org.n52.shetland.ogc.om.OmObservation)1 InvalidParameterValueException (org.n52.shetland.ogc.ows.exception.InvalidParameterValueException)1