Class MonitorFactory

java.lang.Object
org.sentrysoftware.metricshub.engine.telemetry.MonitorFactory

public class MonitorFactory extends Object
Factory class for creating and updating Monitor instances.
  • Constructor Details

    • MonitorFactory

      public MonitorFactory()
  • Method Details

    • createOrUpdateMonitor

      public Monitor createOrUpdateMonitor(String id)
      This method creates or updates the monitor
      Parameters:
      id - identifier of the monitor
      Returns:
      created or updated Monitor instance
    • createOrUpdateMonitor

      public Monitor createOrUpdateMonitor()
      This method creates or updates the monitor
      Returns:
      created or updated Monitor instance
    • createEndpointHostMonitor

      public Monitor createEndpointHostMonitor(boolean isLocalhost)
      Creates the endpoint Host monitor
      Parameters:
      isLocalhost - Whether the host should be localhost or not.
      Returns:
      Monitor instance
    • buildMonitorId

      public static String buildMonitorId(@NonNull @NonNull String connectorId, @NonNull @NonNull String monitorType, @NonNull @NonNull String id)
      Build the monitor unique identifier [connectorid]_[monitorType]_[id]
      Parameters:
      connectorId - The connector compiled file name (identifier)
      monitorType - The type of the monitor.
      id - The id of the monitor we wish to build its identifier
      Returns:
      String value containing the key of the monitor