Search in sources :

Example 1 with PubSubManager

use of org.jivesoftware.smackx.pubsub.PubSubManager in project Smack by igniterealtime.

the class PEPManager method publish.

/**
     * Publish an event.
     * 
     * @param item the item to publish.
     * @param node the node to publish on.
     * @throws NotConnectedException
     * @throws InterruptedException
     * @throws XMPPErrorException
     * @throws NoResponseException
     */
public void publish(Item item, String node) throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException {
    XMPPConnection connection = connection();
    PubSubManager pubSubManager = PubSubManager.getInstance(connection, connection.getUser().asEntityBareJid());
    LeafNode pubSubNode = pubSubManager.getNode(node);
    pubSubNode.publish(item);
}
Also used : PubSubManager(org.jivesoftware.smackx.pubsub.PubSubManager) LeafNode(org.jivesoftware.smackx.pubsub.LeafNode) XMPPConnection(org.jivesoftware.smack.XMPPConnection)

Aggregations

XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 LeafNode (org.jivesoftware.smackx.pubsub.LeafNode)1 PubSubManager (org.jivesoftware.smackx.pubsub.PubSubManager)1