Class TestSpamModule

All Implemented Interfaces:
Module

@Bean(name="test-spam-module", parent=TestComponent.class, active=true) public class TestSpamModule extends AbstractModule
  • Field Details

    • badWords

      @ConfigField(desc="Bad words", alias="bad-words") protected String[] badWords
      This might be changed in one threads while it is iterated in processPacket(...) in another thread. We expect that changes are very rare and small, most of operations are just iterations.
    • whiteList

      @ConfigField(desc="White listed addresses", alias="white-list") protected String[] whiteList
  • Constructor Details

    • TestSpamModule

      public TestSpamModule()
  • Method Details

    • everyMinute

      public void everyMinute()
    • getModuleCriteria

      public Criteria getModuleCriteria()
      Description copied from interface: Module
      Returns critera used by Component to select module to handle incoming stanza.
      Returns:
      criteria of selecting module.
    • process

      public void process(Packet packet) throws ComponentException, TigaseStringprepException
      Description copied from interface: Module
      Process incoming stanza.
      Parameters:
      packet - received stanza.
      Throws:
      ComponentException - if stanza can't be processed correctly. ComponentException is converted to error stanza and returned to stanza sender.
      TigaseStringprepException - if there was an error during stringprep processing.
    • getMessagesCounter

      public long getMessagesCounter()
    • getTotalSpamCounter

      public long getTotalSpamCounter()
    • setPacketTypes

      public void setPacketTypes(String[] packetTypes)
    • initBindings

      public void initBindings(Bindings binds)