|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.filters.SpamFilter
A filter to eliminate Gnutella spam. Subclass to implement custom filters. Each Gnutella connection has two SpamFilters; the personal filter (for filtering results and the search monitor) and a route filter (for deciding what I even consider). (Strategy pattern.) Note that a packet stopped by the route filter will never reach the personal filter.
Because one filter is used per connection, and only one invocation of the run(..) method is used, filters are not synchronized by default. The exception is BlackListFilter, which uses the Singleton pattern and thus must be synchronized.
Constructor Summary | |
SpamFilter()
|
Method Summary | |
abstract boolean |
allow(Message m)
Returns true iff this is considered spam and should not be processed. |
static SpamFilter |
newPersonalFilter()
Returns a new instance of a SpamFilter subclass based on the current settings manager. |
static SpamFilter |
newRouteFilter()
Returns a new instance of a SpamFilter subclass based on the current settings manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SpamFilter()
Method Detail |
public static SpamFilter newPersonalFilter()
public static SpamFilter newRouteFilter()
public abstract boolean allow(Message m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |