- Enclosing class:
IpReputation
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Connection lost before operating starting.accept()This is to be called as early as possible at connection time, ideally before SSL overhead.voidfail()To be called when operations fails.voidstarted()Indicate the action has started soabort()may no longer be performed.voidsuccess()To be called when operation succeeds.
-
Method Details
-
accept
This is to be called as early as possible at connection time, ideally before SSL overhead. May only be called afterIpReputation.init(java.net.InetAddress).Whether accepted or rejected, always adds one to "bad" score, but not past the cap. This is how the score can accumulate up to the
IpReputation.MAX_BAD_SCOREvalue. Tracks if bad score incremented, so later stages can conditionally decrement. This protects from concurrent bursts, and allows fail-fast before SSL overhead.- Returns:
- The action to take. When
IpReputation.Connection.AcceptResult.REJECT, caller is recommended to exit/close immediately (but possibly in async task/thread).
-
abort
public void abort()Connection lost before operating starting. May only be called afteraccept()returnsIpReputation.Connection.AcceptResult.ACCEPT.Example usage: our monitoring simply does SSL connection then disconnects, never speaks VNC protocol.
When aborted, remove the one from "bad" if it was incremented during
accept(), (Future:: When good implemented: do not do anything to "good"). -
started
public void started()Indicate the action has started soabort()may no longer be performed. May only be called afteraccept()returnsIpReputation.Connection.AcceptResult.ACCEPT.Don't want abort possible after operations started, bad guy could potentially use abort and timing to determine if password was good without having their "bad" score increased.
-
fail
public void fail()To be called when operations fails. After calling this, the caller should delay then exit/close. May only be called afterstarted().Keeps the one "bad" score from
accept()if it was not capped, otherwise attempts to increase by one up to cap.If the record for this address has been removed or replaced, increments the bad score on the new record (up to the cap).
-
success
public void success()To be called when operation succeeds. After calling this, the caller should allow the operation to continue. May only be called afterstarted().Remove the one from "bad" if it was incremented during
accept().Decrements one further "bad" to account for successful operation. (Future:: When good implemented: do not do second decrement and instead increment "good").
-
