Class IsolatedHealthMonitor<T>

java.lang.Object
io.appform.ranger.core.healthservice.monitor.IsolatedHealthMonitor<T>
All Implemented Interfaces:
Monitor<T>, Runnable
Direct Known Subclasses:
CountMonitor, PingCheckMonitor, RotationStatusMonitor

public abstract class IsolatedHealthMonitor<T> extends Object implements Runnable, Monitor<T>
A health monitor that implements a Monitor and Runnable Maintains the latest state of the Monitor, and its latest updated timestamp
See Also:
  • Field Details

    • name

      protected String name
  • Constructor Details

    • IsolatedHealthMonitor

      protected IsolatedHealthMonitor(String name, TimeEntity runInterval)
      Parameters:
      name - name of the monitor
      runInterval - initial delay, time interval of how regularly the monitor is to be run, and timeunit to specify how often the Monitor.monitor() check needs to be executed
    • IsolatedHealthMonitor

      protected IsolatedHealthMonitor(String name, TimeEntity runInterval, long stalenessAllowedInMillis)
      Parameters:
      name - name of the monitor
      runInterval - initial delay, time interval of how regularly the monitor is to be run, and timeunit to specify how often the Monitor.monitor() check needs to be executed
      stalenessAllowedInMillis - after how long (in milliseconds) should the monitor be regarded as stale (default: 60 seconds)
  • Method Details

    • run

      public void run()
      updates the healthStatus with the latest value from the monitor check also updates the lastStatusUpdateTime
      Specified by:
      run in interface Runnable
    • disable

      public void disable()
      disable the monitor, and dont use this monitor to track the aggregated health of the system monitor is enabled by default
    • enable

      public void enable()
      enable the monitor, and consider it while aggregating the health of the system monitor is enabled by default
    • getHealthStatus

      public T getHealthStatus()
    • isDisabled

      public boolean isDisabled()
      Specified by:
      isDisabled in interface Monitor<T>
      Returns:
      true if the monitor is disabled, else false
    • hasValidUpdatedTime

      public boolean hasValidUpdatedTime(Date currentTime)