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
Modifier and TypeFieldDescriptionstatic final String
protected tigase.xmpp.jid.JID
static final String
protected static final String
protected boolean
static final String
static final String
static final String
protected static final String
Fields inherited from class tigase.xmpp.XMPPProcessor
ALL_NAMES, ALL_PATHS, cmpInfo
Fields inherited from interface tigase.xmpp.XMPPImplIfc
CLIENT_XMLNS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStableId
(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) void
void
generateStableId
(tigase.server.Packet packet) String[]
tigase.xmpp.jid.JID
getRequiredStoreMucMessages
(tigase.xmpp.XMPPResourceConnection session) getSettings
(tigase.xmpp.jid.BareJID account, tigase.xmpp.XMPPResourceConnection session) void
boolean
loadSettings
(tigase.archive.processors.MessageArchivePlugin.RepoStringSupplier dataSupplier, tigase.archive.processors.MessageArchivePlugin.RepoStringConsumer dataConsumer, Supplier<Optional<tigase.vhosts.VHostItem>> vhostSupplier) loadSettings
(tigase.xmpp.XMPPResourceConnection session) void
process
(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session, tigase.db.NonAuthUserRepository repo, Queue<tigase.server.Packet> results, Map<String, Object> settings) void
setArchiveOffline
(boolean archiveOffline) void
setArchivingMatchers
(String[] matcherStrs) void
setCacheSize
(int cacheSize) void
setComponentJid
(tigase.xmpp.jid.JID componentJid) void
setMamProcessors
(List<AbstractMAMProcessor> mamProcessors) protected tigase.xml.Element.Matcher<tigase.xml.Element>
protected void
userConnected
(tigase.server.xmppsession.UserConnectedEvent event) 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) boolean
willArchive
(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) Methods inherited from class tigase.xmpp.impl.annotation.AnnotatedXMPPProcessor
id, supDiscoFeatures, supElementNamePaths, supNamespaces, supStreamFeatures, supTypes
Methods inherited from class tigase.xmpp.XMPPProcessor
canHandle, compareTo, concurrentQueuesNo, getComponentInfo, getInstance, getQueueSize, getStatistics, getThreadsNo, init, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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:
process
in 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:
initialize
in interfacetigase.kernel.beans.Initializable
-
beforeUnregister
public void beforeUnregister()- Specified by:
beforeUnregister
in 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:
generateStableId
in interfacetigase.server.xmppsession.SessionManager.MessageArchive
-
addStableId
public void addStableId(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) - Specified by:
addStableId
in interfacetigase.server.xmppsession.SessionManager.MessageArchive
-
stanzaIdMatcher
-
willArchive
public boolean willArchive(tigase.server.Packet packet, tigase.xmpp.XMPPResourceConnection session) throws tigase.xmpp.NotAuthorizedException - Specified by:
willArchive
in 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
-