class AccessFilter extends Object implements StatefulConnectionFilter
Tracks known destinations (defined in access lists) and unknown destinations (recently attempted connections). Reloads access lists from disk when modified to allow user edits. Writes recorder data to disk at intervals when new threshold breaches occur.
ALLOW, DENY| Constructor and Description |
|---|
AccessFilter(I2PAppContext context,
FilterDefinition definition)
Create a new access filter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowDestination(Destination d)
Determines if a connection to the given destination should be allowed.
|
void |
start()
Starts the filter's background tasks.
|
void |
stop()
Stops the filter's background tasks.
|
AccessFilter(I2PAppContext context, FilterDefinition definition) throws IOException
context - the context, used for scheduling and timer purposesdefinition - definition of this filterIOException - if an I/O error occurspublic boolean allowDestination(Destination d)
Checks the destination against known and unknown destination trackers. If the destination has exceeded its threshold for the current time window, the connection is denied. Unknown destinations start with the default threshold.
allowDestination in interface IncomingConnectionFilterd - the destination to checkpublic void start()
Initializes the purger and syncer timers to begin tracking connection attempts and periodically saving state to disk.
start in interface StatefulConnectionFilterpublic void stop()
Halts the purger and syncer timers. Existing connection data is retained until the next purge cycle.
stop in interface StatefulConnectionFilter