Class SmartGatewaysAdapter
java.lang.Object
energy.eddie.aiida.adapters.datasource.DataSourceAdapter<SmartGatewaysDataSource>
energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter<SmartGatewaysDataSource>
energy.eddie.aiida.adapters.datasource.sga.SmartGatewaysAdapter
- 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
ConstructorsConstructorDescriptionSmartGatewaysAdapter(SmartGatewaysDataSource dataSource, MqttConfiguration mqttConfiguration) Creates the datasource for the Smart Gateways Adapter. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close any open connections and free resources used by this class.voidmessageArrived(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message) Methods inherited from class energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter
authPacketArrived, connectComplete, createConnectOptions, deliveryComplete, disconnected, health, mqttErrorOccurred, setKeepAliveInterval, start, subscribeToHealthTopicMethods 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
-
SmartGatewaysAdapter
public SmartGatewaysAdapter(SmartGatewaysDataSource dataSource, MqttConfiguration mqttConfiguration) Creates the datasource for the Smart Gateways Adapter. 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.
-
-
Method Details
-
messageArrived
-
close
public void close()Description copied from class:MqttDataSourceAdapterClose any open connections and free resources used by this class. Also emit a complete signal on therecordSinkof this datasource.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classMqttDataSourceAdapter<SmartGatewaysDataSource>
-