Package com.aoindustries.noc.monitor
Class SingleResultWorker
java.lang.Object
com.aoindustries.noc.monitor.SingleResultWorker
- All Implemented Interfaces:
Runnable
The workers for single results node.
TODO: Add persistence of the last report
- Author:
- AO Industries, Inc.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Cancels the current getReport call on a best-effort basis.protected abstract AlertLevelAndMessage
getAlertLevelAndMessage
(AlertLevel curAlertLevel, SingleResult result) Determines the alert level and message for the provided result.protected int
The default startup delay is within five minutes.protected abstract String
Gets the report for this worker.protected long
getSleepDelay
(boolean lastSuccessful, AlertLevel alertLevel) The default sleep delay is five minutes when successful or one minute when unsuccessful.protected boolean
isIncrementalRampUp
(boolean isError) Enables incremental alert level ramp-up, where the node's alert level is only incremented one step at a time per monitoring pass.final void
run()
-
Field Details
-
persistenceFile
-
-
Constructor Details
-
SingleResultWorker
-
-
Method Details
-
getNextStartupDelay
protected int getNextStartupDelay()The default startup delay is within five minutes. -
isIncrementalRampUp
protected boolean isIncrementalRampUp(boolean isError) Enables incremental alert level ramp-up, where the node's alert level is only incremented one step at a time per monitoring pass. This makes the resource more tolerant of intermittent problems, at the cost of slower reaction time.Implementation Note:
Enabled by default- See Also:
-
run
public final void run() -
getSleepDelay
The default sleep delay is five minutes when successful or one minute when unsuccessful.- Parameters:
alertLevel
- Whennull
, treated asAlertLevel.UNKNOWN
-
getAlertLevelAndMessage
protected abstract AlertLevelAndMessage getAlertLevelAndMessage(AlertLevel curAlertLevel, SingleResult result) Determines the alert level and message for the provided result. -
getReport
Gets the report for this worker.- Throws:
Exception
-
cancel
Cancels the current getReport call on a best-effort basis. Implementations of this method must not block. This default implementation callsfuture.cancel(true)
.
-