Package tigase.spam

Interface SpamFilter

    • 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 not
      java.lang.String getId()
      Method returns ID of a filter
      default double getSpamProbability()
      Method returns probability of detection of a spammer.
      default void getStatistics​(java.lang.String name, tigase.stats.StatisticsList list)
      Method should fill the list 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 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