java.lang.Object
net.i2p.router.tunnel.pool.BuildHandler.BuildMessageState
All Implemented Interfaces:
CDQEntry
Enclosing class:
BuildHandler

private static class BuildHandler.BuildMessageStateextends Object implements CDQEntry
Normal inbound requests from other people.
  • Field Details

    • _ctx

      private final RouterContext _ctx
      The router receiving the message.
    • msg

      final TunnelBuildMessage msg
      The received build message.
    • from

      final RouterIdentity from
      The sender's identity.
    • fromHash

      final Hash fromHash
      The sender's hash.
    • recvTime

      final long recvTime
      Time the message arrived.
    • lookupStartTime

      private long lookupStartTime
      Time the next-hop lookup began, -1 until it does.
    • _handled

      private final AtomicBoolean _handled
      Guards against a deferred lookup completing after its timeout fired, or vice versa.
  • Constructor Details

    • BuildMessageState

      public BuildMessageState(RouterContext ctx, I2NPMessage m, RouterIdentity f, Hash h)
      Either f or h may be null, but both should be null only if we're to be a IBGW and it came from us as a OBEP.
      Parameters:
      ctx - the router context
      m - the received message, cast to a tunnel build message
      f - the sender's RouterIdentity, may be null
      h - the sender's hash, may be null
  • Method Details

    • setEnqueueTime

      public void setEnqueueTime(long time)
      No-op; the enqueue time is fixed at construction.
      Specified by:
      setEnqueueTime in interface CDQEntry
      Parameters:
      time - ignored, accepted only to satisfy the interface
    • getEnqueueTime

      public long getEnqueueTime()
      The time the message was received.
      Specified by:
      getEnqueueTime in interface CDQEntry
      Returns:
      the enqueue time
    • setLookupStartTime

      public void setLookupStartTime(long time)
      The time the next hop lookup started.
      Parameters:
      time - the lookup start stamp in ms
    • getLookupStartTime

      public long getLookupStartTime()
      The time the next hop lookup started.
      Returns:
      the lookup start time
    • claimHandled

      boolean claimHandled()
      Claim exclusive handling of this request: exactly one of the deferred-lookup success job and its timeout job may act.
      Returns:
      true if this caller won and should process the request
    • drop

      public void drop()
      Mark the request as dropped due to queue overload.
      Specified by:
      drop in interface CDQEntry