Class MonitoringReceiver
- java.lang.Object
-
- de.iip_ecosphere.platform.monitoring.MonitoringReceiver
-
public abstract class MonitoringReceiver extends java.lang.ObjectObserves IIP-Ecosphere standard transport channels and prepares the information for feeding it into the monitoring system. This class assumes thatTransportis set up.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classMonitoringReceiver.ExporterAn instance holding meters for update performing the export when needed, e.g., upon request or by timer.private classMonitoringReceiver.MeterReceptionCallbackA meter reception callback for receiving meter information from services or ECS runtime.private classMonitoringReceiver.StatusReceptionCallbackReceives status messages such as starting/stopping devices, containers, services.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,MonitoringReceiver.Exporter>registry
-
Constructor Summary
Constructors Constructor Description MonitoringReceiver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MonitoringReceiver.ExportercreateExporter(java.lang.String id)Creates an exporter instance.java.lang.Iterable<MonitoringReceiver.Exporter>exporters()Returns the exporters.protected voidnotifyExporterAdded(MonitoringReceiver.Exporter exporter)Notifies about a added exporter.protected voidnotifyExporterRemoved(MonitoringReceiver.Exporter exporter)Notifies about a removed exporter.protected voidnotifyMeterAdded(io.micrometer.core.instrument.Meter meter)Is called when a meter was added.protected voidnotifyMeterReception(java.lang.String stream, java.lang.String id, javax.json.JsonObject obj)Is called when a meter information was received via transport.protected voidnotifyStatusReceived(de.iip_ecosphere.platform.transport.status.StatusMessage msg)Is called when a status information was received via transport.protected MonitoringReceiver.ExporterobtainExporter(java.lang.String id)Obtains an exporter for the given source id.voidstart()Starts the exporter.voidstop()Stops the exporter.
-
-
-
Field Detail
-
registry
private java.util.Map<java.lang.String,MonitoringReceiver.Exporter> registry
-
-
Method Detail
-
obtainExporter
protected MonitoringReceiver.Exporter obtainExporter(java.lang.String id)
Obtains an exporter for the given source id. Creates and registers a new one if required.- Parameters:
id- the object id- Returns:
- the exporter
-
createExporter
protected abstract MonitoringReceiver.Exporter createExporter(java.lang.String id)
Creates an exporter instance.- Parameters:
id- the id of origin- Returns:
- the exporter instance
-
notifyMeterReception
protected void notifyMeterReception(java.lang.String stream, java.lang.String id, javax.json.JsonObject obj)Is called when a meter information was received via transport. [testing, debugging]- Parameters:
stream- the transport stream/channelid- the idobj- the received object
-
notifyStatusReceived
protected void notifyStatusReceived(de.iip_ecosphere.platform.transport.status.StatusMessage msg)
Is called when a status information was received via transport. [testing, debugging]- Parameters:
msg- the status message
-
notifyMeterAdded
protected void notifyMeterAdded(io.micrometer.core.instrument.Meter meter)
Is called when a meter was added. [testing, debugging]- Parameters:
meter- the meter
-
notifyExporterAdded
protected void notifyExporterAdded(MonitoringReceiver.Exporter exporter)
Notifies about a added exporter.- Parameters:
exporter- the exporter
-
notifyExporterRemoved
protected void notifyExporterRemoved(MonitoringReceiver.Exporter exporter)
Notifies about a removed exporter.- Parameters:
exporter- the exporter
-
start
public void start()
Starts the exporter.
-
stop
public void stop()
Stops the exporter.
-
exporters
public java.lang.Iterable<MonitoringReceiver.Exporter> exporters()
Returns the exporters.- Returns:
- the exporters
-
-