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);
}
Aggregations