net.i2p.router

## Class JobImpl

- java.lang.Object
- - net.i2p.router.JobImpl

- All Implemented Interfaces:
    Job
  Direct Known Subclasses:
    Analysis, BootCommSystemJob, BootNetworkDbJob, BootPeerManagerJob, BuildTrustedLinksJob, CreateRouterInfoJob, CreateSessionJob, ExpireJob, ExpireJobManager, ExpireLeasesJob, ExpireRoutersJob, FloodfillMonitorJob, FloodfillRouterInfoFloodJob, FloodfillVerifyStoreJob, FloodOnlyLookupMatchJob, FloodOnlyLookupTimeoutJob, FloodSearchJob, GetBidsJob, HandleDatabaseLookupMessageJob, HandleFloodfillDatabaseStoreMessageJob, HandleGarlicMessageJob, IterativeLookupJob, IterativeTimeoutJob, LoadClientAppsJob, LoadRouterInfoJob, LookupDestJob, MessageReceivedJob, NetDbCachingJob, OutboundClientMessageOneShotJob, PeerTestJob, PersistRouterInfoJob, PublishLocalRouterInfoJob, ReadConfigJob, RebuildRouterInfoJob, RefreshRoutersJob, ReportAbuseJob, RepublishLeaseSetJob, RequestLeaseSetJob, SearchJob, SearchJob.FailedJob, SearchReplyJob, SearchUpdateReplyFoundJob, SendMessageDirectJob, SingleLookupJob, StartAcceptingClientsJob, StartExplorersJob, StartupJob, StoreJob, TestJob, UpdateRoutingKeyModifierJob

      public abstract class JobImpl
      extends Object
      implements Job

  Base implementation of a Job For use by the router only. Not to be used by applications or plugins.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `long` | `_id`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobImpl(RouterContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dropped()` Default implementation does nothing.
    `RouterContext` | `getContext()` Get the router context that this job belongs to.
    `long` | `getJobId()` Get the unique job ID for this job.
    `long` | `getMadeReadyOn()` Get the timestamp when this job was last made ready for execution.
    `JobTiming` | `getTiming()` Get the timing object for this job.
    `void` | `madeReady(long now)` For JobQueue only, not for external use
    `protected void` | `requeue(long delayMs)` Requeue this job to run after the specified delay.
    `String` | `toString()`

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

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

    - ### Methods inherited from interface net.i2p.router.Job

      `getName, runJob`

- - ### Field Detail

    - #### _id

          public final long _id

  - ### Constructor Detail

    - #### JobImpl

          public JobImpl(RouterContext context)

  - ### Method Detail

    - #### dropped

          public void dropped()

      Default implementation does nothing. Called when the job is dropped due to router overload. Subclasses can override to perform cleanup or requeueing of other tasks.
      Specified by:
        `dropped` in interface `Job`

    - #### getContext

          public final RouterContext getContext()

      Get the router context that this job belongs to.
      Returns:
        the RouterContext for this job

    - #### getJobId

          public long getJobId()

      Get the unique job ID for this job.
      Specified by:
        `getJobId` in interface `Job`
      Returns:
        the unique job identifier

    - #### getMadeReadyOn

          public long getMadeReadyOn()

      Get the timestamp when this job was last made ready for execution.
      Returns:
        timestamp in milliseconds when job was made ready, or 0 if not yet ready

    - #### getTiming

          public JobTiming getTiming()

      Get the timing object for this job.
      Specified by:
        `getTiming` in interface `Job`
      Returns:
        the JobTiming object controlling when this job runs

    - #### madeReady

          public void madeReady(long now)

      For JobQueue only, not for external use
      Parameters:
        `now` - the current time in milliseconds

    - #### requeue

          protected void requeue(long delayMs)

      Requeue this job to run after the specified delay. Warning - only call this from runJob() or if the Job is not already queued, otherwise it may get the job queue out of order.
      Parameters:
        `delayMs` - the delay in milliseconds before the job should run again

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`