Package org.apache.vysper.xmpp.stanza

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


        //
        // S: <iq from='capulet.lit' to='juliet@capulet.lit/balcony' id='c2s1' type='result'/>

       
        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(boundClient, server, IQStanzaType.GET, IQ_ID);
        stanzaBuilder.startInnerElement("ping", NamespaceURIs.URN_XMPP_PING).endInnerElement();

        Stanza requestStanza = stanzaBuilder.build();
        ResponseStanzaContainer resp = handler.execute(requestStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, null);

        // we should always get a response
View Full Code Here


    public void testGet() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        stanzaBuilder.startInnerElement("getRequest").endInnerElement();

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext.getServerRuntimeContext(), true, sessionContext, null);
        IQStanza incomingStanza = iqHandler.getIncomingStanza();
View Full Code Here

        AsyncIQGetHandler asyncIQGetHandler = new AsyncIQGetHandler();
       
        assertNull("future is create on execute", asyncIQGetHandler.getWaitingRunnableFuture());

        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(new EntityImpl("test", "vysper.org", null), null, IQStanzaType.GET, "id1");
        stanzaBuilder.startInnerElement("query").endInnerElement();
        Stanza iqStanza = stanzaBuilder.build();

        ResponseStanzaContainer container = asyncIQGetHandler.execute(iqStanza, sessionContext.getServerRuntimeContext(), true, sessionContext, sessionStateHolder);
        assertTrue(container == null || container.hasNoResponse());
View Full Code Here

        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        if(to != null) {
            stanzaBuilder.addAttribute("to", to);
        }
        stanzaBuilder.startInnerElement(name, namespaceURI).endInnerElement();
        Stanza stanza = stanzaBuilder.build();
        return stanza;
    }
}
View Full Code Here

     * @param node the name of the node
     * @return the generated stanza
     */
    public Stanza getStanza(Entity client, Entity pubsub, String id, String node) {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
        stanzaBuilder.startInnerElement("pubsub", getNamespace());

        buildInnerElement(client, pubsub, stanzaBuilder, node);

        stanzaBuilder.endInnerElement();

View Full Code Here

            return IQStanzaType.GET;
        }

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

            stanzaBuilder.endInnerElement();

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

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

            stanzaBuilder.endInnerElement();

            return stanzaBuilder.build();
View Full Code Here

    private void assertNotTwoSubs(String type) {
        StanzaBuilder stanzaTwoSubs = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaTwoSubs.addAttribute("id", "1");
        stanzaTwoSubs.addAttribute("type", type);
        stanzaTwoSubs.startInnerElement("firstSub", NamespaceURIs.JABBER_CLIENT).endInnerElement();
        stanzaTwoSubs.startInnerElement("secondSub", NamespaceURIs.JABBER_CLIENT).endInnerElement();
        assertIQError(stanzaTwoSubs.build());
    }

    private void assertAnySub(String type) {
View Full Code Here

    private void assertNotTwoSubs(String type) {
        StanzaBuilder stanzaTwoSubs = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaTwoSubs.addAttribute("id", "1");
        stanzaTwoSubs.addAttribute("type", type);
        stanzaTwoSubs.startInnerElement("firstSub", NamespaceURIs.JABBER_CLIENT).endInnerElement();
        stanzaTwoSubs.startInnerElement("secondSub", NamespaceURIs.JABBER_CLIENT).endInnerElement();
        assertIQError(stanzaTwoSubs.build());
    }

    private void assertAnySub(String type) {
        StanzaBuilder stanzaNoSub = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
View Full Code Here

    public void testGet() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("iq", NamespaceURIs.JABBER_CLIENT);
        stanzaBuilder.addAttribute("id", "1");
        stanzaBuilder.addAttribute("type", "get");
        stanzaBuilder.startInnerElement("getRequest", NamespaceURIs.JABBER_CLIENT).endInnerElement();

        TestIQHandler iqHandler = new TestIQHandler();
        ResponseStanzaContainer responseStanzaContainer = iqHandler.execute(stanzaBuilder.build(), sessionContext
                .getServerRuntimeContext(), true, sessionContext, null);
        IQStanza incomingStanza = iqHandler.getIncomingStanza();
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.