Class MicroTeleinfoV3Adapter
java.lang.Object
energy.eddie.aiida.adapters.datasource.DataSourceAdapter<MicroTeleinfoV3DataSource>
energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter<MicroTeleinfoV3DataSource>
energy.eddie.aiida.adapters.datasource.fr.MicroTeleinfoV3Adapter
- All Implemented Interfaces:
AutoCloseable,org.eclipse.paho.mqttv5.client.MqttCallback,org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
-
Field Summary
Fields inherited from class energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter
asyncClientFields inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
dataSource, healthSink, recordSink -
Constructor Summary
ConstructorsConstructorDescriptionMicroTeleinfoV3Adapter(MicroTeleinfoV3DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper mapper, MqttConfiguration mqttConfiguration) Creates the datasource for the Micro Teleinfo V3. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.actuate.health.Healthhealth()voidmessageArrived(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message) MQTT callback function that is called when a new message from the broker is received.protected voidMethods inherited from class energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter
authPacketArrived, close, connectComplete, createConnectOptions, deliveryComplete, disconnected, mqttErrorOccurred, setKeepAliveInterval, startMethods inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
create, dataSource, emitAiidaRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
MicroTeleinfoV3Adapter
public MicroTeleinfoV3Adapter(MicroTeleinfoV3DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper mapper, MqttConfiguration mqttConfiguration) Creates the datasource for the Micro Teleinfo V3. It connects to the specified MQTT broker and expects that the adapter publishes its JSON messages on the specified topic. Any OBIS code without a time field will be assigned a Unix timestamp of 0.- Parameters:
dataSource- The entity of the data source.mapper-ObjectMapperthat is used to deserialize the JSON messages. AMicroTeleinfoV3DataFieldDeserializerwill be registered to this mapper.mqttConfiguration- The MQTT configuration that is used to connect to the MQTT broker.
-
-
Method Details
-
messageArrived
MQTT callback function that is called when a new message from the broker is received. Will convert the message toAiidaRecords and publish them on the Flux returned byMqttDataSourceAdapter.start().- Parameters:
topic- Name of the topic, the message was published to.message- The actual message.
-
health
public org.springframework.boot.actuate.health.Health health()- Specified by:
healthin interfaceorg.springframework.boot.actuate.health.HealthIndicator- Overrides:
healthin classMqttDataSourceAdapter<MicroTeleinfoV3DataSource>
-
subscribeToHealthTopic
protected void subscribeToHealthTopic()- Overrides:
subscribeToHealthTopicin classMqttDataSourceAdapter<MicroTeleinfoV3DataSource>
-