Class TimeoutManager

java.lang.Object
com.nt.udc.testnodechain.timeout.TimeoutManager

public class TimeoutManager extends Object
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 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

      public void monitorTest(String testId, long defaultTimeout, TimeUnit timeUnit)
      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

      public boolean extendTestTimeout(String testId, long extendBy, TimeUnit timeUnit)
      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

      public void stopMonitoringTest(String testId)
      Stops monitoring a test identified by the given testId.
      Parameters:
      testId - The unique identifier of the test to stop monitoring.
    • shutdown

      public void shutdown()