use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class ReportObligationJSONDecoder method decodeJSON.
@Override
public ReportObligation decodeJSON(JsonNode node, boolean validate) throws DecodingException {
ReportObligation reportObligation = new ReportObligation();
reportObligation.setChange(decodeJsonToObject(node.path(AQDJSONConstants.CHANGE), EReportingChange.class));
reportObligation.setInspireID(decodeJsonToObject(node.path(AQDJSONConstants.INSPIRE_ID), Identifier.class));
reportObligation.setReportingPeriod(parseReferenceableTime(node.path(AQDJSONConstants.REPORTING_PERIOD)));
return reportObligation;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class GetObservationRequestDecoder method decodeRequest.
@Override
public GetObservationRequest decodeRequest(JsonNode node) throws DecodingException {
GetObservationRequest r = new GetObservationRequest();
r.setFeatureIdentifiers(parseStringOrStringList(node.path(JSONConstants.FEATURE_OF_INTEREST)));
r.setObservedProperties(parseStringOrStringList(node.path(JSONConstants.OBSERVED_PROPERTY)));
r.setOfferings(parseStringOrStringList(node.path(JSONConstants.OFFERING)));
r.setProcedures(parseStringOrStringList(node.path(JSONConstants.PROCEDURE)));
r.setResponseFormat(node.path(JSONConstants.RESPONSE_FORMAT).textValue());
r.setResponseMode(node.path(JSONConstants.RESPONSE_MODE).textValue());
r.setResultModel(node.path(JSONConstants.RESULT_MODEL).textValue());
r.setResultFilter(parseComparisonFilter(node.path(JSONConstants.RESULT_FILTER)));
r.setSpatialFilter(parseSpatialFilter(node.path(JSONConstants.SPATIAL_FILTER)));
r.setTemporalFilters(parseTemporalFilters(node.path(JSONConstants.TEMPORAL_FILTER)));
// TODO whats that for?
r.setRequestString(Json.print(node));
return r;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class InsertObservationRequestDecoder method decodeRequest.
@Override
public InsertObservationRequest decodeRequest(JsonNode node) throws DecodingException {
InsertObservationRequest r = new InsertObservationRequest();
r.setObservation(decodeJsonToObjectList(node.path(JSONConstants.OBSERVATION), OmObservation.class));
r.setOfferings(parseStringOrStringList(node.path(JSONConstants.OFFERING)));
return r;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class InsertResultTemplateRequestDecoder method parseObservationTemplate.
private OmObservationConstellation parseObservationTemplate(JsonNode node) throws DecodingException {
OmObservationConstellation oc = observationDecoder.parseObservationConstellation(node.path(JSONConstants.OBSERVATION_TEMPLATE));
oc.addOffering(node.path(JSONConstants.OFFERING).textValue());
return oc;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseConnections.
private SmlConnection parseConnections(ConnectionListPropertyType connections) throws DecodingException {
SmlConnection sosSmlConnection = new SmlConnection();
if (connections.isSetConnectionList() && connections.getConnectionList().getConnectionArray() != null) {
for (final Connection connection : connections.getConnectionList().getConnectionArray()) {
if (connection.getLink() != null) {
LinkType link = connection.getLink();
sosSmlConnection.addConnection(new SmlLink(link.getDestination().getRef(), link.getSource().getRef()));
}
}
}
return sosSmlConnection;
}
Aggregations