Package org.xmpp.packet

Examples of org.xmpp.packet.Message.addChildElement()


                    for (Packet p : map.keySet()) {
                        java.util.Date date = map.get(p);
                        // Add the delay information
                        if (p instanceof Message) {
                            Message storedMessage = (Message)p;
                            Element delay = storedMessage.addChildElement("x", "jabber:x:delay");
                            delay.addAttribute("stamp", UTC_FORMAT.format(date));
                            if (ModelUtil.hasLength(storedMessage.getBody())) {
                                buf.append(p.toXML());
                            }
                        }
View Full Code Here


                    for (Packet p : map.keySet()) {
                        java.util.Date date = map.get(p);
                        // Add the delay information
                        if (p instanceof Message) {
                            Message storedMessage = (Message)p;
                            Element delay = storedMessage.addChildElement("x", "jabber:x:delay");
                            delay.addAttribute("stamp", UTC_FORMAT.format(date));
                            if (ModelUtil.hasLength(storedMessage.getBody())) {
                                buf.append(p.toXML());
                            }
                        }
View Full Code Here

            // public)
            Message message = new Message();
            message.setType(Message.Type.groupchat);
            message.setBody(LocaleUtils.getLocalizedString("muc.warnnonanonymous"));
            message.setFrom(role.getRoleAddress());
            Element frag = message.addChildElement("x", "http://jabber.org/protocol/muc#user");
            frag.addElement("status").addAttribute("code", "100");
            joinRole.send(message);
        }
        if (historyRequest == null) {
            Iterator history = roomHistory.getMessageHistory();
View Full Code Here

                for(Element element : extensions) {
                    element.setParent(null);
                    message.getElement().add(element);
                }
            }
            Element frag = message.addChildElement("x", "http://jabber.org/protocol/muc#user");
            // ChatUser will be null if the room itself (ie. via admin console) made the request
            if (senderRole.getUserAddress() != null) {
                frag.addElement("invite").addAttribute("from", senderRole.getUserAddress().toBareJID());
            }
            if (reason != null && reason.length() > 0) {
View Full Code Here

            if (isPasswordProtected()) {
                frag.addElement("password").setText(getPassword());
            }

            // Include the jabber:x:conference information for backward compatibility
            frag = message.addChildElement("x", "jabber:x:conference");
            frag.addAttribute("jid", role.getRoleAddress().toBareJID());

            // Send the message with the invitation
            router.route(message);
        }
View Full Code Here

    public void sendInvitationRejection(JID to, String reason, JID sender) {
        Message message = new Message();
        message.setFrom(role.getRoleAddress());
        message.setTo(to);
        Element frag = message.addChildElement("x", "http://jabber.org/protocol/muc#user");
        frag.addElement("decline").addAttribute("from", sender.toBareJID());
        if (reason != null && reason.length() > 0) {
            frag.element("decline").addElement("reason").setText(reason);
        }
View Full Code Here

     * Clients should perform a new service discovery to see what has changed.
     */
    public void notifyDiscoInfoChanged() {
        final Message message = new Message();
        message.setFrom(serviceName + "." + componentManager.getServerName());
        Element child = message.addChildElement("event", "http://jabber.org/protocol/disco#info");
        buildFeatureSet(child);
        sessionManager.broadcast(message);
    }

    /**
 
View Full Code Here

     * @param child the newly created node that was added to this node.
     */
    void childNodeAdded(Node child) {
        // Build packet to broadcast to subscribers
        Message message = new Message();
        Element event = message.addChildElement("event", "http://jabber.org/protocol/pubsub#event");
        Element item = event.addElement("items").addElement("item");
        item.addAttribute("id", child.getNodeID());
        if (deliverPayloads) {
            item.add(child.getMetadataForm().getElement());
        }
View Full Code Here

     * @param child the deleted node that was removed from this node.
     */
    void childNodeDeleted(Node child) {
        // Build packet to broadcast to subscribers
        Message message = new Message();
        Element event = message.addChildElement("event", "http://jabber.org/protocol/pubsub#event");
        event.addElement("delete").addAttribute("node", child.getNodeID());
        // Broadcast event notification to subscribers
        broadcastCollectionNodeEvent(child, message);
    }

View Full Code Here

            }
        }

        // Build event notification packet to broadcast to subscribers
        Message message = new Message();
        Element event = message.addChildElement("event", "http://jabber.org/protocol/pubsub#event");
        // Broadcast event notification to subscribers and parent node subscribers
        Set<NodeAffiliate> affiliatesToNotify = new HashSet<NodeAffiliate>(affiliates);
        // Get affiliates that are subscribed to a parent in the hierarchy of parent nodes
        for (CollectionNode parentNode : getParents()) {
            for (NodeSubscription subscription : parentNode.getSubscriptions()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.