Search in sources :

Example 1 with ConfigureForm

use of org.jivesoftware.smackx.pubsub.ConfigureForm in project ecf by eclipse.

the class NodeUtils method getFormFromPacket.

/**
 * Get a {@link ConfigureForm} from a packet.
 *
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem) {
    FormNode config = (FormNode) packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);
}
Also used : FormNode(org.jivesoftware.smackx.pubsub.FormNode) Form(org.jivesoftware.smackx.Form) ConfigureForm(org.jivesoftware.smackx.pubsub.ConfigureForm) ConfigureForm(org.jivesoftware.smackx.pubsub.ConfigureForm)

Example 2 with ConfigureForm

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

Aggregations

ConfigureForm (org.jivesoftware.smackx.pubsub.ConfigureForm)2 Form (org.jivesoftware.smackx.Form)1 FormNode (org.jivesoftware.smackx.pubsub.FormNode)1 LeafNode (org.jivesoftware.smackx.pubsub.LeafNode)1