public final class PepManager
extends org.jivesoftware.smack.Manager
PepManager pepManager = PepManager.getInstanceFor(smackConnection); pepManager.addPepListener(new PepListener() { public void eventReceived(EntityBareJid from, EventElement event, Message message) { LOGGER.debug("Event received: " + event); } });
Modifier and Type | Method and Description |
---|---|
boolean |
addPepListener(PepListener pepListener)
Adds a listener to PEPs.
|
static PepManager |
getInstanceFor(org.jivesoftware.smack.XMPPConnection connection) |
PubSubManager |
getPepPubSubManager() |
boolean |
isSupported() |
LeafNode |
publish(java.lang.String nodeId,
Item item)
Publish an event.
|
boolean |
removePepListener(PepListener pepListener)
Removes a listener from PEP events.
|
public static PepManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
public PubSubManager getPepPubSubManager()
public boolean addPepListener(PepListener pepListener)
pepListener
- a roster exchange listener.public boolean removePepListener(PepListener pepListener)
pepListener
- a roster exchange listener.public LeafNode publish(java.lang.String nodeId, Item item) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, PubSubException.NotALeafNodeException
nodeId
- the ID of the node to publish on.item
- the item to publish.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.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.public boolean isSupported() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException