Package org.apache.vysper.xmpp.stanza

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


    }
   
   
    public void testVerifyWithoutMUCNamespaceInnerElement() {
        StanzaBuilder builder = StanzaBuilder.createPresenceStanza(FROM, TO, null, null, null, null);
        builder.startInnerElement("foo").endInnerElement();
       
        assertTrue(presenceHandler.verify(builder.build()));
    }
}
View Full Code Here


    }

    public Stanza getFeaturesForEncryption(SessionContext sessionContext) {

        StanzaBuilder stanzaBuilder = startFeatureStanza();
        stanzaBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
            if (sessionContext.getServerRuntimeContext().getServerFeatures().isStartTLSRequired()) {
                stanzaBuilder.startInnerElement("required", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
            }
        stanzaBuilder.endInnerElement();
View Full Code Here

    public Stanza getFeaturesForEncryption(SessionContext sessionContext) {

        StanzaBuilder stanzaBuilder = startFeatureStanza();
        stanzaBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
            if (sessionContext.getServerRuntimeContext().getServerFeatures().isStartTLSRequired()) {
                stanzaBuilder.startInnerElement("required", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
            }
        stanzaBuilder.endInnerElement();

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

    }

    public Stanza getFeaturesForAuthentication(List<SASLMechanism> authenticationMethods) {

        StanzaBuilder stanzaBuilder = startFeatureStanza();
        stanzaBuilder.startInnerElement("mechanisms", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL);
            for (SASLMechanism authenticationMethod : authenticationMethods) {
                stanzaBuilder.startInnerElement("mechanism", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL).addText(authenticationMethod.getName()).endInnerElement();
            }
            stanzaBuilder.endInnerElement();
View Full Code Here

    public Stanza getFeaturesForAuthentication(List<SASLMechanism> authenticationMethods) {

        StanzaBuilder stanzaBuilder = startFeatureStanza();
        stanzaBuilder.startInnerElement("mechanisms", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL);
            for (SASLMechanism authenticationMethod : authenticationMethods) {
                stanzaBuilder.startInnerElement("mechanism", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL).addText(authenticationMethod.getName()).endInnerElement();
            }
            stanzaBuilder.endInnerElement();

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

    }

    private Stanza getFeaturesForSession() {
        StanzaBuilder stanzaBuilder = startFeatureStanza();

        stanzaBuilder.startInnerElement("bind", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND)
            .startInnerElement("required", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND).endInnerElement();
        stanzaBuilder.endInnerElement();

        // session establishment is here for RFC3921 compatibility and is planed to be removed in revisions of this RFC.
        stanzaBuilder.startInnerElement("session", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SESSION)
View Full Code Here

        stanzaBuilder.startInnerElement("bind", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND)
            .startInnerElement("required", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND).endInnerElement();
        stanzaBuilder.endInnerElement();

        // session establishment is here for RFC3921 compatibility and is planed to be removed in revisions of this RFC.
        stanzaBuilder.startInnerElement("session", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SESSION)
            .startInnerElement("required", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SESSION).endInnerElement();
        stanzaBuilder.endInnerElement();

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

        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        StanzaBuilder request = StanzaBuilder.createIQStanza(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "Nick 2"), IQStanzaType.GET, "123");
        request.startInnerElement("query", getNamespace()).endInnerElement();

        // send message to room
        sendDisco(request.build());

        assertNull(occupant1Queue.getNext());
View Full Code Here

    private static final Occupant FROM_OCCUPANT = new Occupant(FROM, NICK, Affiliation.None, Role.Visitor);
   
    public void testSubjectMessage() {
        StanzaBuilder builder = StanzaBuilder.createMessageStanza(FROM, ROOM_JID, null, null);
        builder.startInnerElement("subject").addText(SUBJECT).endInnerElement();
       
        DiscussionMessage item = new DiscussionMessage(builder.build(), FROM_OCCUPANT, TIMESTAMP);
        assertEquals(NICK, item.getNick());
        assertEquals(TIMESTAMP, item.getTimestamp());
        assertFalse(item.hasBody());
View Full Code Here

        return null;
    }
   
    private void relayDiscoStanza(Entity receiver, InfoRequest request, String ns) {
        StanzaBuilder builder = StanzaBuilder.createIQStanza(request.getFrom(), receiver, IQStanzaType.GET, request.getID());
        builder.startInnerElement("query", ns);
        if(request.getNode() != null) {
            builder.addAttribute("node", request.getNode());
        }

        try {
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.