java.lang.Object
net.i2p.client.TunnelRemovalEvent
Event fired when a tunnel is removed from a client tunnel pool. Allows streaming library to gracefully handle connection migration.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a tunnel was removed from a client's pool.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanTrue for an inbound tunnel.private final StringThe pool the tunnel was in.private final TunnelRemovalEvent.RemovalReasonWhy the tunnel is going away.private final longWhen the removal happened, in ms.private final TunnelIdThe tunnel being removed.Constructor Summary
ConstructorsConstructorDescriptionTunnelRemovalEvent(String poolName, TunnelId tunnelId, boolean isInbound, TunnelRemovalEvent.RemovalReason reason) Create a new tunnel removal event.Method Summary
All MethodsModifier and TypeMethodDescriptionReturn the tunnel pool name.Return the removal reason.longReturn the event timestamp.Return the tunnel ID.booleanReturn true if the tunnel is inbound.toString()Return a string representation.
Field Details
_poolName
The pool the tunnel was in._tunnelId
The tunnel being removed._isInbound
private final boolean _isInboundTrue for an inbound tunnel._reason
Why the tunnel is going away._timestamp
private final long _timestampWhen the removal happened, in ms.
Constructor Details
TunnelRemovalEvent
public TunnelRemovalEvent(String poolName, TunnelId tunnelId, boolean isInbound, TunnelRemovalEvent.RemovalReason reason) Create a new tunnel removal event.- Parameters:
poolName- the tunnel pool nametunnelId- the tunnel IDisInbound- true if inboundreason- the removal reason
Method Details
getPoolName
getTunnelId
isInbound
public boolean isInbound()Return true if the tunnel is inbound.- Returns:
- true if inbound
getReason
Return the removal reason.- Returns:
- the removal reason
getTimestamp
public long getTimestamp()Return the event timestamp.- Returns:
- the time in milliseconds since the epoch when the event was created
toString