Class MessageArchivePlugin

java.lang.Object
tigase.xmpp.XMPPProcessor
tigase.xmpp.impl.annotation.AnnotatedXMPPProcessor
tigase.archive.processors.MessageArchivePlugin
All Implemented Interfaces:
Comparable<tigase.xmpp.XMPPImplIfc>, tigase.kernel.beans.Initializable, tigase.kernel.beans.UnregisterAware, tigase.server.xmppsession.SessionManager.MessageArchive, tigase.xmpp.XMPPImplIfc, tigase.xmpp.XMPPProcessorConcurrencyAwareIfc, tigase.xmpp.XMPPProcessorIfc

@Bean(name="message-archive", parents={Xep0136MessageArchivingProcessor.class,Xep0313MessageArchiveManagementProcessor.class,MAM2Processor.class}, active=true, exportable=true) public class MessageArchivePlugin extends tigase.xmpp.impl.annotation.AnnotatedXMPPProcessor implements tigase.xmpp.XMPPProcessorIfc, tigase.server.xmppsession.SessionManager.MessageArchive, tigase.kernel.beans.Initializable, tigase.kernel.beans.UnregisterAware
MessageArchingPlugin is implementation of plugin which forwards messages with type set to "chat" to MessageArchivingComponent to store this messages in message archive.
  • Field Details

  • Constructor Details

    • MessageArchivePlugin

      public MessageArchivePlugin()
  • Method Details

    • isArchivingOfMixMessageEnabled

      public boolean isArchivingOfMixMessageEnabled()
    • setArchiveOffline

      public void setArchiveOffline(boolean archiveOffline)
    • setCacheSize

      public void setCacheSize(int cacheSize)
    • setMamProcessors

      public void setMamProcessors(List<AbstractMAMProcessor> mamProcessors)
    • process

      public void process(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session, tigase.db.NonAuthUserRepository repo, Queue<tigase.server.Packet> results, Map<String,Object> settings) throws tigase.xmpp.XMPPException
      Specified by:
      process in interface tigase.xmpp.XMPPProcessorIfc
      Throws:
      tigase.xmpp.XMPPException
    • getArchivingMatchers

      public String[] getArchivingMatchers()
    • setArchivingMatchers

      public void setArchivingMatchers(String[] matcherStrs)
    • getComponentJid

      public tigase.xmpp.jid.JID getComponentJid()
    • setComponentJid

      public void setComponentJid(tigase.xmpp.jid.JID componentJid)
    • getDefaultStoreMethod

      public StoreMethod getDefaultStoreMethod(Optional<MessageArchiveVHostItemExtension> maExt)
    • getRequiredStoreMethod

      public StoreMethod getRequiredStoreMethod(Optional<MessageArchiveVHostItemExtension> maExt)
    • getSettings

      public Settings getSettings(tigase.xmpp.jid.BareJID account, tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException
      Throws:
      tigase.xmpp.NotAuthorizedException
    • getRequiredStoreMucMessages

      public StoreMuc getRequiredStoreMucMessages(tigase.xmpp.XMPPResourceConnection session)
    • initialize

      public void initialize()
      Specified by:
      initialize in interface tigase.kernel.beans.Initializable
    • beforeUnregister

      public void beforeUnregister()
      Specified by:
      beforeUnregister in interface tigase.kernel.beans.UnregisterAware
    • userConnected

      @HandleEvent protected void userConnected(tigase.server.xmppsession.UserConnectedEvent event)
    • loadSettings

      public Settings loadSettings(tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException
      Throws:
      tigase.xmpp.NotAuthorizedException
    • loadSettings

      public Settings loadSettings(tigase.archive.processors.MessageArchivePlugin.RepoStringSupplier dataSupplier, tigase.archive.processors.MessageArchivePlugin.RepoStringConsumer dataConsumer, Supplier<Optional<tigase.vhosts.VHostItem>> vhostSupplier) throws tigase.xmpp.NotAuthorizedException
      Throws:
      tigase.xmpp.NotAuthorizedException
    • generateStableId

      public void generateStableId(tigase.server.Packet packet)
      Specified by:
      generateStableId in interface tigase.server.xmppsession.SessionManager.MessageArchive
    • addStableId

      public void addStableId(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session)
      Specified by:
      addStableId in interface tigase.server.xmppsession.SessionManager.MessageArchive
    • stanzaIdMatcher

      protected tigase.xml.Element.Matcher<tigase.xml.Element> stanzaIdMatcher(String by)
    • willArchive

      public boolean willArchive(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException
      Specified by:
      willArchive in interface tigase.server.xmppsession.SessionManager.MessageArchive
      Throws:
      tigase.xmpp.NotAuthorizedException
    • willArchive

      public boolean willArchive(tigase.server.Packet packet, tigase.xmpp.jid.JID buddyJid, Settings settings, Supplier<Optional<tigase.vhosts.VHostItem>> vhostItemSupplier, Predicate<tigase.xmpp.jid.JID> isInRoster) throws tigase.xmpp.NotAuthorizedException
      Throws:
      tigase.xmpp.NotAuthorizedException