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 by
SpamProcessor to detect spam.
Created by andrzej on 08.04.2017.-
Method Summary
Modifier and TypeMethodDescriptionbooleanfilter(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) Method processes packet and checks if it is a SPAM or notgetId()Method returns ID of a filterdefault doubleMethod returns probability of detection of a spammer.default voidgetStatistics(String name, tigase.stats.StatisticsList list) Method should fill thelistparameter value with statistics about processed stanzas.
-
Method Details
-
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
String getId()Method returns ID of a filter -
getStatistics
Method should fill thelistparameter 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 byResultsAwareSpamFilterimplementation 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
-