java.lang.Object
net.i2p.client.streaming.impl.ConnectionManager.Reason
- Enclosing class:
ConnectionManager
Encapsulates a connection rejection reason with an optional Retry-After duration in seconds.
Field Details
txt
The refusal message to log.seconds
private final int secondsHow long the ban lasts.silent
private final boolean silentTrue to keep the refusal out of the logs.
Constructor Details
Reason
Record a rejection reason that logs at WARN on every occurrence.- Parameters:
text- text recorded as the reason and returned bytoString()secs- seconds for the Retry-After header
Reason
Record a rejection reason, optionally suppressing its WARN log.- Parameters:
text- text recorded as the reason and returned by toString()secs- seconds for the Retry-After headersilentFlags- if true, suppress the per-rejection WARN log. Used for repeated rejections of an already-temp-banned dest so a hammering peer doesn't spam the log on every SYN.
Method Details
toString
getSeconds
public int getSeconds()Seconds for the Retry-After header.- Returns:
- the Retry-After delay in seconds, 0 for none
isSilent
public boolean isSilent()Whether per-rejection logging should be suppressed.- Returns:
- true to skip the WARN log for this rejection