Class TelemetryManager
java.lang.Object
org.sentrysoftware.metricshub.engine.telemetry.TelemetryManager
The `TelemetryManager` class manages telemetry-related operations, monitors, and strategies.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNewMonitor(@NonNull Monitor monitor, @NonNull String monitorType, @NonNull String id) Add a new monitor instancefindMonitorById(String monitorId) This method finds a monitor having a given id regardless of its typefindMonitorById(String id, Map<String, Monitor> monitorsMap) Finds a monitor using its id attributefindMonitorByTypeAndId(String type, String id) Finds a monitor using its type and its id attributefindMonitorsByType(String type) Finds a monitor using its typefindParentMonitor(Monitor monitor) This method finds the parent of a given monitorgetEmbeddedFiles(String connectorId) Retrieves a map ofEmbeddedFileobjects indexed by their unique integer identifiers, associated with a specific connector identified byconnectorId.Return the root host monitor instanceReturn the configured hostnamegetVo()Get the current monitors asMonitorsVobooleanisConnectorStatusOk(Monitor currentMonitor) This method checks whether a connector status was set to "ok"voidExecutes the givenIStrategyinstances.toJson()Convert monitors to JSON format
-
Constructor Details
-
TelemetryManager
public TelemetryManager()
-
-
Method Details
-
run
Executes the givenIStrategyinstances.- Parameters:
strategies- TheIStrategyinstances to be executed.
-
toJson
Convert monitors to JSON format- Returns:
Stringvalue
-
getVo
Get the current monitors asMonitorsVo- Returns:
MonitorsVoobject
-
findMonitorByTypeAndId
Finds a monitor using its type and its id attribute- Parameters:
type- monitor's typeid- monitor's id- Returns:
- Monitor instance
-
findMonitorById
Finds a monitor using its id attribute- Parameters:
id- monitorIdmonitorsMap- a map of monitors having the same type- Returns:
Monitorinstance
-
findMonitorsByType
Finds a monitor using its type- Parameters:
type- type of the monitor. E.g. host, enclosure, network, etc.- Returns:
Monitorinstance
-
addNewMonitor
public Monitor addNewMonitor(@NonNull @NonNull Monitor monitor, @NonNull @NonNull String monitorType, @NonNull @NonNull String id) Add a new monitor instance- Parameters:
monitor- Monitor instance we wish to addmonitorType- The type of the monitorid- The monitor's identifier- Returns:
- added
Monitorinstance
-
getEndpointHostMonitor
Return the root host monitor instance- Returns:
Monitorobject representing the root instance
-
getHostname
Return the configured hostname- Returns:
Stringvalue
-
findParentMonitor
This method finds the parent of a given monitor- Parameters:
monitor- a given monitor- Returns:
- the parent monitor which is a
Monitorinstance
-
findMonitorById
This method finds a monitor having a given id regardless of its type- Parameters:
monitorId- monitor id- Returns:
Monitor
-
isConnectorStatusOk
This method checks whether a connector status was set to "ok"- Parameters:
currentMonitor- the current monitor- Returns:
- boolean whether the connector status is ok
-
getEmbeddedFiles
Retrieves a map ofEmbeddedFileobjects indexed by their unique integer identifiers, associated with a specific connector identified byconnectorId.- Parameters:
connectorId- The unique identifier of the connector whose embedded files are to be retrieved.- Returns:
- A non-null
Mapof integer IDs toEmbeddedFileinstances.
-