public final class PepManager extends 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(XMPPConnection connection) |
PubSubManager |
getPepPubSubManager() |
boolean |
isSupported() |
void |
publish(Item item,
String node)
Publish an event.
|
boolean |
removePepListener(PepListener pepListener)
Removes a listener from PEP events.
|
connection, getAuthenticatedConnectionOrThrow, schedule
public static PepManager getInstanceFor(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 void publish(Item item, String node) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, PubSubException.NotAPubSubNodeException, PubSubException.NotALeafNodeException
item
- the item to publish.node
- the node to publish on.SmackException.NotConnectedException
InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
PubSubException.NotAPubSubNodeException
PubSubException.NotALeafNodeException
public boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException