net.i2p.router.tunnel.pool

## Class TestJob

- java.lang.Object
- - net.i2p.router.JobImpl
  - - net.i2p.router.tunnel.pool.TestJob

- All Implemented Interfaces:
    Job

      public class TestJob
      extends JobImpl

  Repeatedly tests a single tunnel for its lifetime to ensure it remains functional. Sends a garlic-encrypted DeliveryStatusMessage through the tunnel and validates the reply. Now includes adaptive backoff, avoids over-penalizing peers on transient failures, and limits the number of concurrent tunnel tests to avoid overwhelming the router.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestJob(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()` Descriptive name of the task
    `void` | `runJob()` Actually perform the task.
    `void` | `testSuccessful(int ms)` Called when the tunnel test completes successfully.

    - ### Methods inherited from class net.i2p.router.JobImpl

      `dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TestJob

          public TestJob(RouterContext ctx,
                         PooledTunnelCreatorConfig cfg,
                         TunnelPool pool)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `Job`
      Descriptive name of the task
      Returns:
        the descriptive name of the task

    - #### runJob

          public void runJob()

      Description copied from interface: `Job`
      Actually perform the task. This call blocks until the Job is complete.

    - #### testSuccessful

          public void testSuccessful(int ms)

      Called when the tunnel test completes successfully. Updates statistics and schedules the next test.
      Parameters:
        `ms` - time in milliseconds the test took to succeed