Package com.nt.udc.testnodechain.timeout
Class TimeoutManager
java.lang.Object
com.nt.udc.testnodechain.timeout.TimeoutManager
The TimeoutManager class represents a manager for handling timeouts for tests (TNC feature).
It provides functionality for tracking, reminding and extending timeouts for various tests.
-
Constructor Summary
ConstructorsConstructorDescriptionTimeoutManager
(long alertBefore, TimeUnit alertBeforeTimeUnit, ConsumerCallbackIfc<ReminderTask> alertCallback, ConsumerCallbackIfc<TimeoutTask> timeoutCallback) Constructs a TimeoutManager with specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
extendTestTimeout
(String testId, long extendBy, TimeUnit timeUnit) Extends the timeout duration for a test identified by the given testId.void
monitorTest
(String testId, long defaultTimeout, TimeUnit timeUnit) Monitors a test identified by the given testId with a default timeout duration.void
shutdown()
void
stopMonitoringTest
(String testId) Stops monitoring a test identified by the given testId.
-
Constructor Details
-
TimeoutManager
public TimeoutManager(long alertBefore, TimeUnit alertBeforeTimeUnit, ConsumerCallbackIfc<ReminderTask> alertCallback, ConsumerCallbackIfc<TimeoutTask> timeoutCallback) Constructs a TimeoutManager with specified parameters.- Parameters:
alertBefore
- The duration before the timeout to trigger an alert.alertBeforeTimeUnit
- The unit of time for the alertBefore duration.alertCallback
- The callback function for alerting before the timeout.timeoutCallback
- The callback function for handling the timeout event.
-
-
Method Details
-
monitorTest
Monitors a test identified by the given testId with a default timeout duration.- Parameters:
testId
- The unique identifier of the test to be monitored.defaultTimeout
- The default timeout duration for the test.timeUnit
- The unit of time for the defaultTimeout duration.
-
extendTestTimeout
Extends the timeout duration for a test identified by the given testId.- Parameters:
testId
- The unique identifier of the test to extend the timeout.extendBy
- The amount of time to extend the test timeout.timeUnit
- The unit of time for the extension (e.g., seconds, minutes).
-
stopMonitoringTest
Stops monitoring a test identified by the given testId.- Parameters:
testId
- The unique identifier of the test to stop monitoring.
-
shutdown
public void shutdown()
-