use of org.n52.svalbard.decode.json.BatchRequestDecoder in project arctic-sea by 52North.
the class BatchRequestDecodingTest method before.
@Before
public void before() throws DecodingException {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new BatchRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
InsertSensorRequestDecoder insertSensorRequestDecoder = new InsertSensorRequestDecoder();
insertSensorRequestDecoder.setDecoderRepository(decoderRepository);
InsertObservationRequestDecoder insertObservationRequestDecoder = new InsertObservationRequestDecoder();
insertObservationRequestDecoder.setDecoderRepository(decoderRepository);
SensorMLDecoderV101 sensorMLDecoder = new SensorMLDecoderV101();
sensorMLDecoder.setXmlOptions(XmlOptions::new);
sensorMLDecoder.setDecoderRepository(decoderRepository);
SweCommonDecoderV101 sweCommonDecoder = new SweCommonDecoderV101();
sweCommonDecoder.setXmlOptions(XmlOptions::new);
sweCommonDecoder.setDecoderRepository(decoderRepository);
GmlDecoderv311 gmlDecoderv311 = new GmlDecoderv311();
ObservationDecoder observationDecoder = new ObservationDecoder();
observationDecoder.setDecoderRepository(decoderRepository);
InsertResultTemplateRequestDecoder insertResultTemplateRequestDecoder = new InsertResultTemplateRequestDecoder();
insertResultTemplateRequestDecoder.setDecoderRepository(decoderRepository);
InsertResultRequestDecoder insertResultRequestDecoder = new InsertResultRequestDecoder();
insertResultRequestDecoder.setDecoderRepository(decoderRepository);
FieldDecoder fieldDecoder = new FieldDecoder();
fieldDecoder.setDecoderRepository(decoderRepository);
decoderRepository.setDecoders(Arrays.asList(decoder, insertSensorRequestDecoder, insertObservationRequestDecoder, insertResultTemplateRequestDecoder, insertResultRequestDecoder, sensorMLDecoder, sweCommonDecoder, observationDecoder, fieldDecoder, gmlDecoderv311));
decoderRepository.init();
this.request = decoder.decodeJSON(json, true);
}
Aggregations