Package org.jivesoftware.smackx.pubsub

Examples of org.jivesoftware.smackx.pubsub.Node$NodeConfigTranslator


    }
   
    public void actionPerformed(ActionEvent e) {
        PubSubManager pubsubMgr = parent.getPubsubMgr();
       
        Node node = getNode(pubsubMgr);
        if(node == null) return;
       
        String message = getMessage();

        Item<SimplePayload> item = createItem(message);
View Full Code Here


        Item<SimplePayload> item = new Item<SimplePayload>(itemId, new SimplePayload(ELEMENT, NAMESPACE, message));
        return item;
    }

    private Node getNode(PubSubManager pubsubMgr) {
        Node node = null;
        try {
            node = pubsubMgr.getNode(nodeID);
        } catch (XMPPException e1) {
            System.err.println("Couldn't get the node object for " + nodeID);
            e1.printStackTrace();
View Full Code Here

        if(event.getType() == TableModelEvent.UPDATE) {
            try {
                Boolean sub = (Boolean)dtm.getValueAt(event.getFirstRow(), event.getColumn());
                String nodeName = (String)dtm.getValueAt(event.getFirstRow(), 0);
   
                Node node = pubsubMgr.getNode(nodeName);
   
                if(sub.booleanValue()) { // contains the new value (soll)
                    node.subscribe(jid);
                    System.out.println(jid + " subscribed to " + node.getId());
                } else {
                    node.unsubscribe(jid);
                    System.out.println(jid + " unsubscribed from " + node.getId());
                }
            } catch(Exception ex) {
                ex.printStackTrace();
            }
        }
View Full Code Here

        tableModel.startBulkAdd();
        for(PubsubNode n : lookup.values()) {
            tableModel.bulkAddRow(n);
           
            try {
                Node node = pubsubMgr.getNode(n.getNode());
                node.removeItemEventListener(pel); // remove the listener in cases we already know the node
                node.addItemEventListener(pel); // add the listener for events
            } catch (XMPPException e) {
                e.printStackTrace();
            }
        }
        tableModel.endBulkAdd();
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
        PubSubManager pubsubMgr = parent.getPubsubMgr();

        Node node = getNode(pubsubMgr);
        if (node == null)
            return;

        String message = getMessage();
View Full Code Here

        Item<SimplePayload> item = new Item<SimplePayload>(itemId, new SimplePayload(ELEMENT, NAMESPACE, message));
        return item;
    }

    private Node getNode(PubSubManager pubsubMgr) {
        Node node = null;
        try {
            node = pubsubMgr.getNode(nodeID);
        } catch (XMPPException e1) {
            System.err.println("Couldn't get the node object for " + nodeID);
            e1.printStackTrace();
View Full Code Here

        if (event.getType() == TableModelEvent.UPDATE) {
            try {
                Boolean sub = (Boolean) dtm.getValueAt(event.getFirstRow(), event.getColumn());
                String nodeName = (String) dtm.getValueAt(event.getFirstRow(), 0);

                Node node = pubsubMgr.getNode(nodeName);

                if (sub.booleanValue()) { // contains the new value (soll)
                    node.subscribe(jid);
                    System.out.println(jid + " subscribed to " + node.getId());
                } else {
                    node.unsubscribe(jid);
                    System.out.println(jid + " unsubscribed from " + node.getId());
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
View Full Code Here

        tableModel.startBulkAdd();
        for (PubsubNode n : lookup.values()) {
            tableModel.bulkAddRow(n);

            try {
                Node node = pubsubMgr.getNode(n.getNode());
                node.removeItemEventListener(pel); // remove the listener in cases we already know the node
                node.addItemEventListener(pel); // add the listener for events
            } catch (XMPPException e) {
                e.printStackTrace();
            }
        }
        tableModel.endBulkAdd();
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.pubsub.Node$NodeConfigTranslator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.