Package tigase.pubsub.modules
Class PublishItemModule
java.lang.Object
tigase.stats.CounterValue
tigase.stats.Counter
tigase.stats.StatisticHolderImpl
tigase.pubsub.AbstractPubSubModule
tigase.pubsub.modules.PublishItemModule
- All Implemented Interfaces:
tigase.component.modules.Module
,tigase.kernel.beans.Initializable
,tigase.kernel.beans.UnregisterAware
,tigase.stats.StatisticHolder
@Bean(name="publishItemModule",
parent=PubSubComponent.class,
active=true)
public class PublishItemModule
extends AbstractPubSubModule
implements tigase.kernel.beans.Initializable, tigase.kernel.beans.UnregisterAware
Implementation of the PubSub component module responsible for publication of new entries on the pubsub nodes.
- Version:
- 5.0.0, 2010.03.27 at 05:21:54 GMT
- Author:
- Artur Hefczyc
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final LeafNodeConfig
static final String[]
Fields inherited from class tigase.pubsub.AbstractPubSubModule
config, log, packetWriter, pubSubLogic
Fields inherited from class tigase.stats.CounterValue
counter, level, name
Fields inherited from interface tigase.component.modules.Module
EMPTY_FEATURES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
broadcastNotification
(Executor.Priority priority, tigase.xmpp.jid.BareJID serviceJID, String nodeName, tigase.xml.Element message) void
doPublishItems
(tigase.xmpp.jid.BareJID serviceJID, String nodeName, LeafNodeConfig leafNodeConfig, String publisher, List<tigase.xml.Element> itemsToSend) ensurePepNode
(tigase.xmpp.jid.BareJID toJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, tigase.xml.Element publishOptions) void
generateItemsNotifications
(tigase.xmpp.jid.BareJID serviceJID, String nodeName, List<tigase.xml.Element> itemsToSend, String uuid, boolean persistInMAM) void
generateNodeNotifications
(tigase.xmpp.jid.BareJID serviceJID, String nodeName, tigase.xml.Element payload, String uuid, boolean persistInMAM) String[]
tigase.criteria.Criteria
protected tigase.xmpp.jid.JID[]
getValidBuddies
(tigase.xmpp.jid.BareJID id) void
boolean
isPEPNodeName
(String nodeName) static void
protected void
protected void
void
process
(tigase.server.Packet packet) publishItems
(tigase.xmpp.jid.BareJID toJid, String nodeName, tigase.xmpp.jid.JID publisher, List<tigase.xml.Element> itemsToPublish, tigase.xml.Element publishOptions) protected void
publishLastItem
(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.JID buddyJid) void
publishLastItem
(tigase.xmpp.jid.BareJID serviceJid, AbstractNodeConfig nodeConfig, tigase.xmpp.jid.JID destinationJID) void
sendNotification
(tigase.xmpp.jid.BareJID serviceJID, String nodeName, tigase.xml.Element item, String uuid, Map<String, String> headers, tigase.xmpp.jid.JID recipient, tigase.xmpp.StanzaType stanzaType) void
trimItems
(tigase.xmpp.jid.BareJID serviceJid, String nodeName, Integer maxItems, CollectionItemsOrdering collectionItemsOrdering) Methods inherited from class tigase.pubsub.AbstractPubSubModule
canHandle, getRepository, makeArray, makeArray
Methods inherited from class tigase.stats.StatisticHolderImpl
getStatistics, setStatisticsPrefix, statisticExecutedIn
Methods inherited from class tigase.stats.Counter
everyHour, everyMinute, everySecond, getPerHour, getPerMinute, getPerSecond
Methods inherited from class tigase.stats.CounterValue
getLevel, getName, getValue, inc, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tigase.stats.StatisticHolder
everyHour, everyMinute, everySecond
-
Field Details
-
AMP_XMLNS
- See Also:
-
SUPPORTED_PEP_XMLNS
-
defaultPepNodeConfig
-
pepNodes
-
-
Constructor Details
-
PublishItemModule
public PublishItemModule()
-
-
Method Details
-
main
-
doPublishItems
public void doPublishItems(tigase.xmpp.jid.BareJID serviceJID, String nodeName, LeafNodeConfig leafNodeConfig, String publisher, List<tigase.xml.Element> itemsToSend) throws tigase.component.exceptions.RepositoryException, PubSubException - Throws:
tigase.component.exceptions.RepositoryException
PubSubException
-
generateItemsNotifications
public void generateItemsNotifications(tigase.xmpp.jid.BareJID serviceJID, String nodeName, List<tigase.xml.Element> itemsToSend, String uuid, boolean persistInMAM) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
generateNodeNotifications
public void generateNodeNotifications(tigase.xmpp.jid.BareJID serviceJID, String nodeName, tigase.xml.Element payload, String uuid, boolean persistInMAM) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
sendNotification
-
broadcastNotification
public void broadcastNotification(Executor.Priority priority, tigase.xmpp.jid.BareJID serviceJID, String nodeName, tigase.xml.Element message) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
ensurePepNode
public AbstractNodeConfig ensurePepNode(tigase.xmpp.jid.BareJID toJid, String nodeName, tigase.xmpp.jid.BareJID ownerJid, tigase.xml.Element publishOptions) throws PubSubException - Throws:
PubSubException
-
getFeatures
- Specified by:
getFeatures
in interfacetigase.component.modules.Module
-
getModuleCriteria
public tigase.criteria.Criteria getModuleCriteria()- Specified by:
getModuleCriteria
in interfacetigase.component.modules.Module
-
initialize
public void initialize()- Specified by:
initialize
in interfacetigase.kernel.beans.Initializable
-
isPEPNodeName
-
process
- Specified by:
process
in interfacetigase.component.modules.Module
- Throws:
PubSubException
-
publishItems
public List<String> publishItems(tigase.xmpp.jid.BareJID toJid, String nodeName, tigase.xmpp.jid.JID publisher, List<tigase.xml.Element> itemsToPublish, tigase.xml.Element publishOptions) throws tigase.component.exceptions.RepositoryException, PubSubException - Throws:
tigase.component.exceptions.RepositoryException
PubSubException
-
publishLastItem
public void publishLastItem(tigase.xmpp.jid.BareJID serviceJid, AbstractNodeConfig nodeConfig, tigase.xmpp.jid.JID destinationJID) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
trimItems
public void trimItems(tigase.xmpp.jid.BareJID serviceJid, String nodeName, Integer maxItems, CollectionItemsOrdering collectionItemsOrdering) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
beforeUnregister
public void beforeUnregister()- Specified by:
beforeUnregister
in interfacetigase.kernel.beans.UnregisterAware
-
getValidBuddies
protected tigase.xmpp.jid.JID[] getValidBuddies(tigase.xmpp.jid.BareJID id) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
onCapsChange
@HandleEvent protected void onCapsChange(PresenceCollectorModule.CapsChangeEvent event) throws tigase.util.stringprep.TigaseStringprepException - Throws:
tigase.util.stringprep.TigaseStringprepException
-
publishLastItem
protected void publishLastItem(tigase.xmpp.jid.BareJID serviceJid, String nodeName, tigase.xmpp.jid.JID buddyJid) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
onPresenceChangeEvent
@HandleEvent protected void onPresenceChangeEvent(PresenceCollectorModule.PresenceChangeEvent event) throws tigase.util.stringprep.TigaseStringprepException - Throws:
tigase.util.stringprep.TigaseStringprepException
-