Package org.jivesoftware.smackx.pep
Class PepManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.pep.PepManager
Manages Personal Event Publishing (XEP-163). A PEPManager provides a high level access to
PubSub personal events. It also provides an easy way
to hook up custom logic when events are received from another XMPP client through PEPListeners.
Use example:
PepManager pepManager = PepManager.getInstanceFor(smackConnection); pepManager.addPepListener(new PepListener() { public void eventReceived(EntityBareJid from, EventElement event, Message message) { LOGGER.debug("Event received: " + event); } });
-
Method Summary
Modifier and TypeMethodDescription<E extends ExtensionElement>
booleanaddPepEventListener
(String node, Class<E> extensionElementType, PepEventListener<E> pepEventListener) static PepManager
getInstanceFor
(XMPPConnection connection) boolean
Publish an event.boolean
removePepEventListener
(PepEventListener<?> pepEventListener) Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
-
addPepEventListener
public <E extends ExtensionElement> boolean addPepEventListener(String node, Class<E> extensionElementType, PepEventListener<E> pepEventListener) -
removePepEventListener
-
getPepPubSubManager
-
publish
public LeafNode publish(String nodeId, Item item) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, PubSubException.NotALeafNodeException Publish an event.- Parameters:
nodeId
- the ID of the node to publish on.item
- the item to publish.- Returns:
- the leaf node the item was published on.
- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.PubSubException.NotALeafNodeException
- if a PubSub leaf node operation was attempted on a non-leaf node.
-
isSupported
-