Package org.apache.vysper.xmpp.stanza

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.build()


            if(history != null) {
              xInnerElms.add(history);
            }
            stanzaBuilder.addPreparedElement(new X(xInnerElms));
        }
        Stanza presenceStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(presenceStanza, userSessionContext.getServerRuntimeContext(), true, userSessionContext, null);
        if(container != null) {
            return container.getResponseStanza();
        } else {
            return null;
View Full Code Here


    }
   
    private Stanza exitRoom(Entity occupantJid, Entity roomJid, String status) throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createPresenceStanza(occupantJid, roomJid, null, PresenceStanzaType.UNAVAILABLE, null, status);

        Stanza presenceStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(presenceStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        if(container != null) {
            return container.getResponseStanza();
        } else {
            return null;
View Full Code Here

public class MUCPresenceHandlerChangeStatusTestCase extends AbstractMUCHandlerTestCase {

    private Stanza changeStatus(Entity occupantJid, Entity roomWithNickJid, String show, String status) throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createPresenceStanza(occupantJid, roomWithNickJid, null, null, show, status);
       
        Stanza presenceStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(presenceStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        if(container != null) {
            return container.getResponseStanza();
        } else {
            return null;
View Full Code Here

       
        public Stanza getStanza(Entity client, Entity pubsub, String id) {
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
            stanzaBuilder.startInnerElement("query", getNamespace());

            return stanzaBuilder.build();
        }
       
        @Override
        public Stanza getStanza(Entity client, Entity pubsub, String id, String node) {
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
View Full Code Here

            stanzaBuilder.startInnerElement("query", getNamespace());
            stanzaBuilder.addAttribute("node", node);

            stanzaBuilder.endInnerElement();

            return stanzaBuilder.build();
        }
    }
}
View Full Code Here

            return handleCannotRetrieveRoster(stanza, sessionContext);
        }

        // from becomes to
        StanzaBuilder stanzaBuilder = RosterStanzaUtils.createRosterItemsIQ(from, stanza.getID(), IQStanzaType.RESULT, roster);
        return stanzaBuilder.build();
    }

    @SpecCompliance( compliant = {
        @SpecCompliant(spec="rfc3921bis-08", section = "2.1.3", status = FINISHED, coverage = COMPLETE),
        @SpecCompliant(spec="rfc3921bis-08", section = "2.1.5", status = FINISHED, coverage = PARTIAL),
View Full Code Here

        List<SubscriptionItem> subscriptions = collectSubscriptions(root, sender, nodeName);

        buildSuccessStanza(sb, nodeName, subscriptions);

        sb.endInnerElement(); // pubsub
        return new IQStanza(sb.build());
    }

    /**
     * Traverses through all nodes or a single node to collect all subscriptions of the user.
     * @return the list of subscriptions or an empty list.
View Full Code Here

        }

        LeafNode node = new LeafNode(serviceConfiguration, nodeName, sender);
        root.add(node);

        return new IQStanza(sb.build());
    }
}
View Full Code Here

            strID = idGenerator.create();
            // wrap a new item element with the id attribute
            StanzaBuilder itemBuilder = new StanzaBuilder("item");
            itemBuilder.addAttribute("id", strID);
            itemBuilder.addPreparedElement(item.getFirstInnerElement());
            item = itemBuilder.build();
        }

        StanzaRelay relay = serverRuntimeContext.getStanzaRelay();
        node.publish(sender, relay, strID, item);
View Full Code Here

        }
       
        sendDeleteNotifications(serverRuntimeContext, sender, nodeName, node);
        root.deleteNode(nodeName);

        return new IQStanza(sb.build());
    }

    /**
     * Creates and sends a notification for all subscribers that the node is going to be deleted.
     *
 
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.