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 Type
    Method
    Description
    boolean
    filter(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
    Method processes packet and checks if it is a SPAM or not
    Method returns ID of a filter
    default double
    Method returns probability of detection of a spammer.
    default void
    getStatistics(String name, tigase.stats.StatisticsList list)
    Method should fill the list parameter 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

      default void getStatistics(String name, tigase.stats.StatisticsList list)
      Method should fill the list 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 by ResultsAwareSpamFilter 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