Search in sources :

Example 1 with LeafNode

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

the class PubSubTestCase method getRandomPubnode.

protected LeafNode getRandomPubnode(PubSubManager pubMgr, boolean persistItems, boolean deliverPayload) throws XMPPException {
    ConfigureForm form = new ConfigureForm(FormType.submit);
    form.setPersistentItems(persistItems);
    form.setDeliverPayloads(deliverPayload);
    form.setAccessModel(AccessModel.open);
    return (LeafNode) pubMgr.createNode("/test/Pubnode" + System.currentTimeMillis(), form);
}
Also used : LeafNode(org.jivesoftware.smackx.pubsub.LeafNode) ConfigureForm(org.jivesoftware.smackx.pubsub.ConfigureForm)

Example 2 with LeafNode

use of org.jivesoftware.smackx.pubsub.LeafNode 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

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