Class RotationStatusMonitor
java.lang.Object
io.appform.ranger.core.healthservice.monitor.IsolatedHealthMonitor<HealthcheckStatus>
io.appform.ranger.core.healthservice.monitor.sample.RotationStatusMonitor
- All Implemented Interfaces:
Monitor<HealthcheckStatus>,Runnable
This is a simple service in/out rotation check monitor
Initialize this class with a filePath (location of the file)
This monitor then:
- Marks service as unhealthy when the file does not exist
- Marks service as healthy when the file exists
-
Field Summary
Fields inherited from class io.appform.ranger.core.healthservice.monitor.IsolatedHealthMonitor
name -
Constructor Summary
ConstructorsConstructorDescriptionRotationStatusMonitor(TimeEntity timeEntity, long stalenessAllowedInMillis, String filePath) RotationStatusMonitor(TimeEntity timeEntity, String filePath) RotationStatusMonitor(String filePath) -
Method Summary
Methods inherited from class io.appform.ranger.core.healthservice.monitor.IsolatedHealthMonitor
disable, enable, getHealthStatus, hasValidUpdatedTime, isDisabled, run
-
Constructor Details
-
RotationStatusMonitor
- Parameters:
filePath- location of the file
-
RotationStatusMonitor
- Parameters:
timeEntity- how often themonitor()check needs to be executedfilePath- location of the file
-
RotationStatusMonitor
- Parameters:
timeEntity- how often themonitor()check needs to be executedstalenessAllowedInMillis- after how long (in milliseconds) should the monitor be regarded as stale (default: 60 seconds)filePath- location of the file
-
-
Method Details
-
monitor
checks if the rotation file exists or not- Returns:
HealthcheckStatus.healthyif file exists elseHealthcheckStatus.unhealthywhen file doesnt exist
-