java.lang.Object
net.i2p.router.transport.FIFOBandwidthLimiter.NoopRequest
- All Implemented Interfaces:
FIFOBandwidthLimiter.Request, PQEntry
- Enclosing class:
FIFOBandwidthLimiter
private static class FIFOBandwidthLimiter.NoopRequestextends Object implements FIFOBandwidthLimiter.Request
A request that always succeeds without capacity.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidabort()Abort the request; no-op.voidThrow, since a satisfied request cannot be attached to.The attached object; always null.booleanWhether this request was aborted; always false.The complete listener; always null.intThe pending requested bytes; always 0.intThe request priority; always 0, as required by the PQEntry interface.longThe request time; always 0.longThe sequence number; always 0.intThe total requested bytes; always 0.voidImmediately notify the listener that the request completed.voidsetSeqNum(long num) Sequence number assigned to this request; no-op.toString()The string representation; "noop".voidWait for the next allocation; no-op.
Constructor Details
NoopRequest
private NoopRequest()A bandwidth request that transfers nothing.
Method Details
abort
public void abort()Abort the request; no-op.- Specified by:
abortin interfaceFIFOBandwidthLimiter.Request
getAborted
public boolean getAborted()Whether this request was aborted; always false.- Specified by:
getAbortedin interfaceFIFOBandwidthLimiter.Request- Returns:
- always false, a no-op request is never aborted
getPendingRequested
public int getPendingRequested()The pending requested bytes; always 0.- Specified by:
getPendingRequestedin interfaceFIFOBandwidthLimiter.Request- Returns:
- always 0, a no-op request never has anything outstanding
toString
getRequestTime
public long getRequestTime()The request time; always 0.- Specified by:
getRequestTimein interfaceFIFOBandwidthLimiter.Request- Returns:
- the request time
getTotalRequested
public int getTotalRequested()The total requested bytes; always 0.- Specified by:
getTotalRequestedin interfaceFIFOBandwidthLimiter.Request- Returns:
- the total requested
waitForNextAllocation
public void waitForNextAllocation()Wait for the next allocation; no-op.- Specified by:
waitForNextAllocationin interfaceFIFOBandwidthLimiter.Request
getCompleteListener
The complete listener; always null.- Specified by:
getCompleteListenerin interfaceFIFOBandwidthLimiter.Request- Returns:
- the complete listener
setCompleteListener
Immediately notify the listener that the request completed.- Specified by:
setCompleteListenerin interfaceFIFOBandwidthLimiter.Request- Parameters:
lsnr- notified once fully allocated; null clears any previously set listener
attach
Throw, since a satisfied request cannot be attached to.- Specified by:
attachin interfaceFIFOBandwidthLimiter.Request- Parameters:
obj- the caller's own state, returned byFIFOBandwidthLimiter.Request.attachment()
attachment
The attached object; always null.- Specified by:
attachmentin interfaceFIFOBandwidthLimiter.Request- Returns:
- the object passed to
FIFOBandwidthLimiter.Request.attach(Object), or null if none was attached
getPriority
public int getPriority()The request priority; always 0, as required by the PQEntry interface.- Specified by:
getPriorityin interfacePQEntry- Returns:
- always 0, a no-op request carries no priority
setSeqNum
getSeqNum