Java 类org.jivesoftware.smackx.pubsub.AccessModel 实例源码

项目:mangosta-android    文件:XMPPSession.java   
public void createNodeToAllowComments(String blogPostId) {
    String nodeName = PublishCommentExtension.NODE + "/" + blogPostId;

    PubSubManager pubSubManager = PubSubManager.getInstance(XMPPSession.getInstance().getXMPPConnection());
    try {
        // create node
        ConfigureForm configureForm = new ConfigureForm(DataForm.Type.submit);
        configureForm.setPublishModel(PublishModel.open);
        configureForm.setAccessModel(AccessModel.open);
        Node node = pubSubManager.createNode(nodeName, configureForm);

        // subscribe to comments
        String myJIDString = getUser().toString();
        node.subscribe(myJIDString);
    } catch (SmackException.NoResponseException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | InterruptedException e) {
        e.printStackTrace();
    }
}
项目:Smack    文件:PubSubTestCase.java   
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);
}
项目:java-bells    文件:PubSubTestCase.java   
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);
}