Package tigase.archive.processors
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected tigase.xmpp.jid.JIDstatic final Stringprotected static final Stringprotected booleanstatic final Stringstatic final Stringstatic final Stringprotected static final StringFields inherited from class tigase.xmpp.XMPPProcessor
ALL_NAMES, ALL_PATHS, cmpInfoFields inherited from interface tigase.xmpp.XMPPImplIfc
CLIENT_XMLNS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStableId(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) voidvoidgenerateStableId(tigase.server.Packet packet) String[]tigase.xmpp.jid.JIDgetRequiredStoreMucMessages(tigase.xmpp.XMPPResourceConnection session) getSettings(tigase.xmpp.jid.BareJID account, tigase.xmpp.XMPPResourceConnection session) voidbooleanloadSettings(tigase.archive.processors.MessageArchivePlugin.RepoStringSupplier dataSupplier, tigase.archive.processors.MessageArchivePlugin.RepoStringConsumer dataConsumer, Supplier<Optional<tigase.vhosts.VHostItem>> vhostSupplier) loadSettings(tigase.xmpp.XMPPResourceConnection session) voidprocess(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session, tigase.db.NonAuthUserRepository repo, Queue<tigase.server.Packet> results, Map<String, Object> settings) voidsetArchiveOffline(boolean archiveOffline) voidsetArchivingMatchers(String[] matcherStrs) voidsetCacheSize(int cacheSize) voidsetComponentJid(tigase.xmpp.jid.JID componentJid) voidsetMamProcessors(List<AbstractMAMProcessor> mamProcessors) protected tigase.xml.Element.Matcher<tigase.xml.Element>protected voiduserConnected(tigase.server.xmppsession.UserConnectedEvent event) booleanwillArchive(tigase.server.Packet packet, tigase.xmpp.jid.JID buddyJid, Settings settings, Supplier<Optional<tigase.vhosts.VHostItem>> vhostItemSupplier, Predicate<tigase.xmpp.jid.JID> isInRoster) booleanwillArchive(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) Methods inherited from class tigase.xmpp.impl.annotation.AnnotatedXMPPProcessor
id, supDiscoFeatures, supElementNamePaths, supNamespaces, supStreamFeatures, supTypesMethods inherited from class tigase.xmpp.XMPPProcessor
canHandle, compareTo, concurrentQueuesNo, getComponentInfo, getInstance, getQueueSize, getStatistics, getThreadsNo, init, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface tigase.xmpp.XMPPImplIfc
canHandle, concurrentQueuesNo, getComponentInfo, getStatistics, id, init, supDiscoFeatures, supElementNamePaths, supNamespaces, supStreamFeatures, supTypes
-
Field Details
-
DEFAULT_SAVE
- See Also:
-
MUC_SAVE
- See Also:
-
OWNER_JID
- See Also:
-
ARCHIVE
- See Also:
-
MSG_ARCHIVE_PATHS
- See Also:
-
ID
- See Also:
-
SETTINGS
- See Also:
-
componentJid
@ConfigField(desc="Message archiving component JID", alias="component-jid") protected tigase.xmpp.jid.JID componentJid -
ignorePubSubEventsFullJid
@ConfigField(desc="Ignore PubSub notifications sent to full JID", alias="ignore-pubsub-events-full-jid") protected boolean ignorePubSubEventsFullJid
-
-
Constructor Details
-
MessageArchivePlugin
public MessageArchivePlugin()
-
-
Method Details
-
isArchivingOfMixMessageEnabled
public boolean isArchivingOfMixMessageEnabled() -
setArchiveOffline
public void setArchiveOffline(boolean archiveOffline) -
setCacheSize
public void setCacheSize(int cacheSize) -
setMamProcessors
-
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:
processin interfacetigase.xmpp.XMPPProcessorIfc- Throws:
tigase.xmpp.XMPPException
-
getArchivingMatchers
-
setArchivingMatchers
-
getComponentJid
public tigase.xmpp.jid.JID getComponentJid() -
setComponentJid
public void setComponentJid(tigase.xmpp.jid.JID componentJid) -
getDefaultStoreMethod
-
getRequiredStoreMethod
-
getSettings
public Settings getSettings(tigase.xmpp.jid.BareJID account, tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException - Throws:
tigase.xmpp.NotAuthorizedException
-
getRequiredStoreMucMessages
-
initialize
public void initialize()- Specified by:
initializein interfacetigase.kernel.beans.Initializable
-
beforeUnregister
public void beforeUnregister()- Specified by:
beforeUnregisterin interfacetigase.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:
generateStableIdin interfacetigase.server.xmppsession.SessionManager.MessageArchive
-
addStableId
public void addStableId(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) - Specified by:
addStableIdin interfacetigase.server.xmppsession.SessionManager.MessageArchive
-
stanzaIdMatcher
-
willArchive
public boolean willArchive(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException - Specified by:
willArchivein interfacetigase.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
-