Search in sources :

Example 1 with ConverterFactory

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());
}
Also used : Observation(com.ibm.streamsx.health.ingest.types.model.Observation) ConverterFactory(com.ibm.streamsx.health.prepare.uomconverter.ConverterFactory)

Aggregations

Observation (com.ibm.streamsx.health.ingest.types.model.Observation)1 ConverterFactory (com.ibm.streamsx.health.prepare.uomconverter.ConverterFactory)1