Package org.jivesoftware.smackx.pep
Class PepManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.pep.PepManager
public final class PepManager
extends org.jivesoftware.smack.Manager
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 org.jivesoftware.smack.packet.ExtensionElement>
booleanaddPepEventListener(String node, Class<E> extensionElementType, PepEventListener<E> pepEventListener) static PepManagergetInstanceFor(org.jivesoftware.smack.XMPPConnection connection) booleanPublish an event.booleanremovePepEventListener(PepEventListener<?> pepEventListener) Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
-
addPepEventListener
public <E extends org.jivesoftware.smack.packet.ExtensionElement> boolean addPepEventListener(String node, Class<E> extensionElementType, PepEventListener<E> pepEventListener) -
removePepEventListener
-
getPepPubSubManager
-
publish
public LeafNode publish(String nodeId, Item item) throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.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:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.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.
-
isSupported
public boolean isSupported() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException- Throws:
org.jivesoftware.smack.SmackException.NoResponseExceptionorg.jivesoftware.smack.XMPPException.XMPPErrorExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionInterruptedException
-