Package org.apache.vysper.xmpp.stanza

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


        node.publish(sender, relay, strID, eventItemBuilder.build());

        buildSuccessStanza(sb, nodeName, strID);

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


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

        buildSuccessStanza(sb, subscriptions);

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

                return errorStanzaGenerator.generateSubIDNotValidErrorStanza(sender, serverJID, stanza);
            }
        }

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

        }

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

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

        node.subscribe(id, subJID);

        buildSuccessStanza(sb, nodeName, strSubJID, id);

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

        List<AffiliationItem> affiliations = collectAllAffiliations(node);
        buildSuccessStanza(sb, node, affiliations);

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

        } catch (Throwable t) { // possible null-pointer
            return errorStanzaGenerator.generateBadRequestErrorStanza(serverJID, sender, stanza); // TODO not defined in the standard(?)
        }

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

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

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

        LeafNode n = root.find(testNode);
        assertEquals(testNode, n.getName());
    }
View Full Code Here

        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();
        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.getInnerElements().get(1); // jump over the original request
        XMLElement conflict = error.getFirstInnerElement();

        assertEquals("error", error.getName());
        assertEquals("cancel", error.getAttributeValue("type"));
View Full Code Here

        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();

        node.subscribe("id", client);
        ResponseStanzaContainer result = sendStanza(sg.getStanza(client, pubsubService, "id123", "news"), true);
        assertTrue(result.hasResponse());
        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.RESULT.value(), response.getType());

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

        // get the subscription Element
        XMLElement pub = response.getFirstInnerElement().getFirstInnerElement();
        XMLElement item = pub.getFirstInnerElement();

        assertEquals("publish", pub.getName());
        assertEquals("news", pub.getAttributeValue("node"));
        assertNotNull(item); // should be present
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.stanza.IQStanza

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.