Package net.i2p.i2ptunnel.access
Class AccessFilter
java.lang.Object
net.i2p.i2ptunnel.access.AccessFilter
- All Implemented Interfaces:
IncomingConnectionFilter
,StatefulConnectionFilter
class AccessFilter extends Object implements StatefulConnectionFilter
A filter for incoming connections which can be configured
based on access list rules.
It keeps a track of known destinations - those defined in existing access
lists and unknown ones - those who are not defined in such lists but have
recently attempted to connect to us.
Every SYNC_INTERVAL seconds the access lists are reloaded from disk if they
have changed according to file modification time. This
allows the user to edit them. Also, if any recorders are defined in the
access rules, they will write to disk at such interval if there have been
any new breaches.
- Since:
- 0.9.40
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AccessFilter(I2PAppContext context, FilterDefinition definition)
-
Method Summary
Modifier and Type Method Description boolean
allowDestination(Destination d)
void
start()
Tells this filter to startvoid
stop()
Tells this filter to stop and release any resources
-
Constructor Details
-
AccessFilter
- Parameters:
context
- the context, used for scheduling and timer purposesdefinition
- definition of this filter- Throws:
IOException
-
-
Method Details
-
start
public void start()Description copied from interface:StatefulConnectionFilter
Tells this filter to start- Specified by:
start
in interfaceStatefulConnectionFilter
-
stop
public void stop()Description copied from interface:StatefulConnectionFilter
Tells this filter to stop and release any resources- Specified by:
stop
in interfaceStatefulConnectionFilter
-
allowDestination
- Specified by:
allowDestination
in interfaceIncomingConnectionFilter
- Parameters:
d
- the destination that wants to establish an incoming connection- Returns:
- true if the connection should be allowed.
-