Examples of IQStanza


Examples of org.apache.vysper.xmpp.stanza.IQStanza

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

        buildSuccessStanza(sb, nodeName, subscriptions);

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

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        }

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

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

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        Stanza stanza = sg.getStanza(client2, pubsubService, "id123", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.ERROR.value(),response.getType());

        assertEquals("id123", response.getAttributeValue("id")); // IDs must match

        XMLElement error = response.getInnerElementsNamed("error").get(0); //jump directly to the error part
        assertEquals("error", error.getName());
        assertEquals("auth", error.getAttributeValue("type"));

        List<XMLElement> errorContent = error.getInnerElements();
        assertEquals(1, errorContent.size());
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        AbstractStanzaGenerator sg = new DefaultModifyAffiliationsStanzaGenerator("test", client, PubSubAffiliation.MEMBER);
        Stanza stanza = sg.getStanza(client, pubsubService, "id123", testNode);
        ResponseStanzaContainer result = sendStanza(stanza, true);
        assertTrue(result.hasResponse());
        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.ERROR.value(),response.getType());

        assertEquals("id123", response.getAttributeValue("id")); // IDs must match

        XMLElement error = response.getInnerElementsNamed("error").get(0); //jump directly to the error part
        assertEquals("error", error.getName());
        assertEquals("cancel", error.getAttributeValue("type"));

        List<XMLElement> errorContent = error.getInnerElements();
        assertEquals(1, errorContent.size());
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        node.publish(sender, relay, strID, item);

        buildSuccessStanza(sb, nodeName, strID);

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

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.RESULT.value(),response.getType());
        assertEquals("4711", response.getAttributeValue("id")); // IDs must match

        assertEquals(PubSubAffiliation.OWNER, n1.getAffiliation(client));
        assertEquals(PubSubAffiliation.MEMBER, n1.getAffiliation(client2));
        assertEquals(PubSubAffiliation.PUBLISHER, n1.getAffiliation(client3));
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.RESULT.value(),response.getType());
        assertEquals("4711", response.getAttributeValue("id")); // IDs must match

        assertEquals(PubSubAffiliation.OWNER, n1.getAffiliation(client));
        assertEquals(PubSubAffiliation.NONE, n1.getAffiliation(client2));
        assertEquals(PubSubAffiliation.NONE, n1.getAffiliation(client3));
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.IQStanza

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

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

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.ERROR.value(),response.getType());

        assertEquals("4711", response.getAttributeValue("id")); // IDs must match

        XMLElement error = response.getInnerElementsNamed("error").get(0); //jump directly to the error part
        assertEquals("error", error.getName());
        assertEquals("modify", error.getAttributeValue("type"));
        assertEquals("not-acceptable", error.getFirstInnerElement().getName());

        assertEquals(PubSubAffiliation.OWNER, n1.getAffiliation(client));
View Full Code Here

Examples of org.apache.vysper.xmpp.stanza.IQStanza

        List<AffiliationItem> subscriptions = collectAffiliations(root, sender);

        buildSuccessStanza(sb, subscriptions);

        sb.endInnerElement(); // pubsub
        return new IQStanza(sb.build());
    }
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.