Package org.apache.vysper.xmpp.stanza

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


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


   
    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

            throw new IllegalStateException("unsupported state for responding with stream opener");
        }

        StanzaBuilder stanzaBuilder = getStreamOpener(forClient, from, sessionContext.getXMLLang(), version, sessionContext.getSessionId(), innerFeatureStanza);

        return stanzaBuilder.build();
    }

    public StanzaBuilder getStreamOpener(boolean forClient, Entity from, String xmlLang, XMPPVersion version, Stanza innerStanza) {
        return getStreamOpener(forClient, from, xmlLang, version, null, innerStanza);
    }
View Full Code Here

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

        return stanzaBuilder.build();
    }

    public Stanza getFeaturesForAuthentication(List<SASLMechanism> authenticationMethods) {

        StanzaBuilder stanzaBuilder = startFeatureStanza();
View Full Code Here

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

        return stanzaBuilder.build();
    }

    private Stanza getFeaturesForSession() {
        StanzaBuilder stanzaBuilder = startFeatureStanza();
View Full Code Here

        // 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();
    }

    protected StanzaBuilder startFeatureStanza() {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("features", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS, "stream");
       
View Full Code Here

    }

    public Stanza getTLSProceed() {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("proceed", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
        return stanzaBuilder.build();
    }

    public Stanza getAuthAborted() {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("aborted", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
View Full Code Here

    }

    public Stanza getAuthAborted() {

        StanzaBuilder stanzaBuilder = new StanzaBuilder("aborted", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS);
        return stanzaBuilder.build();
    }

}
View Full Code Here

       
        builder.startInnerElement("error").addAttribute("type", type);
        builder.startInnerElement(errorName, NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).endInnerElement();
        builder.endInnerElement();
       
        return builder.build();
    }
   
    public static Stanza createInviteMessageStanza(Stanza original, String password) throws EntityFormatException {
        X orginalX = X.fromStanza(original);
       
View Full Code Here

            inner.add(new Password(password));
        }
       
        X newX = new X(NamespaceURIs.XEP0045_MUC_USER, inner);
        builder.addPreparedElement(newX);
        return builder.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.