java.lang.Object
net.i2p.router.tunnel.pool.BuildHandler.BuildMessageState
- All Implemented Interfaces:
CDQEntry
- Enclosing class:
BuildHandler
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router receiving the message.private final AtomicBooleanGuards against a deferred lookup completing after its timeout fired, or vice versa.(package private) final RouterIdentityThe sender's identity.(package private) final HashThe sender's hash.private longTime the next-hop lookup began, -1 until it does.(package private) final TunnelBuildMessageThe received build message.(package private) final longTime the message arrived.Constructor Summary
ConstructorsConstructorDescriptionBuildMessageState(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.Method Summary
Public MethodsModifier and TypeMethodDescription(package private) booleanClaim exclusive handling of this request: exactly one of the deferred-lookup success job and its timeout job may act.voiddrop()Mark the request as dropped due to queue overload.longThe time the message was received.longThe time the next hop lookup started.voidsetEnqueueTime(long time) No-op; the enqueue time is fixed at construction.voidsetLookupStartTime(long time) The time the next hop lookup started.
Field Details
_ctx
The router receiving the message.msg
The received build message.from
The sender's identity.fromHash
The sender's hash.recvTime
final long recvTimeTime the message arrived.lookupStartTime
private long lookupStartTimeTime the next-hop lookup began, -1 until it does._handled
Guards against a deferred lookup completing after its timeout fired, or vice versa.
Constructor Details
BuildMessageState
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 contextm- the received message, cast to a tunnel build messagef- the sender's RouterIdentity, may be nullh- 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:
setEnqueueTimein interfaceCDQEntry- Parameters:
time- ignored, accepted only to satisfy the interface
getEnqueueTime
public long getEnqueueTime()The time the message was received.- Specified by:
getEnqueueTimein interfaceCDQEntry- 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