Package tigase.spam
Interface SpamFilter
-
- All Known Subinterfaces:
ResultsAwareSpamFilter
- All Known Implementing Classes:
AbstractSpamFilter
,KnownSpammersFilter
,MessageErrorFilterEnsureErrorChild
,MessageFilterSameLongBody
,MucMessageFilterEnsureToFullJid
,PresenceSubscribeFilter
,PresenceSubscribeOutgoingFilter
public interface SpamFilter
Interface which needs to be implemented by all filters used bySpamProcessor
to detect spam. Created by andrzej on 08.04.2017.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
filter(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
Method processes packet and checks if it is a SPAM or notjava.lang.String
getId()
Method returns ID of a filterdefault double
getSpamProbability()
Method returns probability of detection of a spammer.default void
getStatistics(java.lang.String name, tigase.stats.StatisticsList list)
Method should fill thelist
parameter value with statistics about processed stanzas.
-
-
-
Method Detail
-
filter
boolean filter(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
Method processes packet and checks if it is a SPAM or not- Returns:
- false if message should be dropped as it it a SPAM
-
getId
java.lang.String getId()
Method returns ID of a filter
-
getStatistics
default void getStatistics(java.lang.String name, tigase.stats.StatisticsList list)
Method should fill thelist
parameter value with statistics about processed stanzas. Default implementation should be used if there are no meaningful values to return.
-
getSpamProbability
default double getSpamProbability()
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.- Returns:
- values between 0 and 1
-
-