Package tigase.spam.filters
Class PresenceSubscribeFilter
- java.lang.Object
-
- tigase.spam.filters.AbstractSpamFilter
-
- tigase.spam.filters.PresenceSubscribeFilter
-
- All Implemented Interfaces:
tigase.kernel.beans.Initializable
,tigase.kernel.beans.UnregisterAware
,SpamFilter
@Bean(name="presence-subscribe", parent=SpamProcessor.class, active=true) public class PresenceSubscribeFilter extends AbstractSpamFilter implements tigase.kernel.beans.Initializable, tigase.kernel.beans.UnregisterAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PresenceSubscribeFilter.Counter
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
ID
-
Constructor Summary
Constructors Constructor Description PresenceSubscribeFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeUnregister()
protected void
cleanUp()
protected boolean
filterPacket(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
java.lang.String
getId()
Method returns ID of a filterdouble
getSpamProbability()
Method returns probability of detection of a spammer.void
initialize()
-
Methods inherited from class tigase.spam.filters.AbstractSpamFilter
filter, getStatistics, toString
-
-
-
-
Field Detail
-
ID
protected static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:SpamFilter
Method returns ID of a filter- Specified by:
getId
in interfaceSpamFilter
-
getSpamProbability
public double getSpamProbability()
Description copied from interface:SpamFilter
Method returns probability of detection of a spammer. If value is closer to 1 this means that it is more likely that sender of stanza marked by this filter as a spam is a spammer and should be blocked. This value is used byResultsAwareSpamFilter
implementation to decide if sender of a stanza should be blocked (ie. using number of blocked messages within a period of time and spammer detection probability returned by this method.- Specified by:
getSpamProbability
in interfaceSpamFilter
- Returns:
- values between 0 and 1
-
initialize
public void initialize()
- Specified by:
initialize
in interfacetigase.kernel.beans.Initializable
-
beforeUnregister
public void beforeUnregister()
- Specified by:
beforeUnregister
in interfacetigase.kernel.beans.UnregisterAware
-
filterPacket
protected boolean filterPacket(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
- Specified by:
filterPacket
in classAbstractSpamFilter
-
cleanUp
protected void cleanUp()
-
-