use of com.ibm.streamsx.health.prepare.uomconverter.ConverterFactory in project streamsx.health by IBMStreams.
the class UOMConverterService method build.
public void build() {
/*
* You *MUST* register all available converters here. Otherwise,
* you will end up NoConverterFoundExceptions.
*/
ConverterFactory factory = new ConverterFactory();
factory.registerConverterClass(VoltageConverter.class);
factory.registerConverterClass(CelciusToFahrenheitConverter.class);
factory.registerConverterClass(FahrenheitToCelciusConverter.class);
factory.registerConverterClass(BPSToBPMConverter.class);
factory.registerConverterClass(BPMToBPSConverter.class);
/*
* Build topology
*/
TStream<Observation> obsStream = SubscribeConnector.subscribe(topo, this.subscribeTopic);
TStream<Observation> updateObsStream = obsStream.modify(new UnitConverter(factory, uomMapFile));
PublishConnector.publishObservation(updateObsStream, getPublishedTopic());
}
Aggregations