Package org.apache.vysper.xmpp.stanza

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


        // second resource is now invalid and cannot be used anymore in a full qualified entity
        stanzaBuilder = StanzaBuilder.createIQStanza(null, null, IQStanzaType.GET, "test");
        stanzaBuilder.addAttribute("from", new EntityImpl("lea", server.getDomain(), secondBoundResource)
                .getFullQualifiedName());
        stanzaBuilder.startInnerElement("query", "testNSURI").endInnerElement();
        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanzaBuilder.build(),
                sessionStateHolder);
        recordedResponse = sessionContext.getNextRecordedResponse();
        assertUnknownSenderError(recordedResponse);
View Full Code Here


        String privateDataXML = persistenceManager.getPrivateData(from, queryKey);

        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(),
                IQStanzaType.RESULT, stanza.getID());
        if (privateDataXML == null) {
            stanzaBuilder.startInnerElement(x.getName(), x.getNamespaceURI());
            for (Attribute a : x.getAttributes()) {
                stanzaBuilder.addAttribute(a);
            }
            stanzaBuilder.endInnerElement();
        } else {
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

        // or an IQ-result containing an empty <vCard/> element.
        if (vcardXml == null) {
            IQStanzaType iqStanzaType = returnEmptyVCardWhenNonExistent ? IQStanzaType.RESULT : IQStanzaType.ERROR;
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(), iqStanzaType,
                    stanza.getID());
            stanzaBuilder.startInnerElement("vCard", NamespaceURIs.VCARD_TEMP).endInnerElement();
            if (returnEmptyVCardWhenNonExistent) {
                // keep it like it is
            } else {
                stanzaBuilder.startInnerElement("error", NamespaceURIs.JABBER_CLIENT).addAttribute("type", "cancel")
                        .startInnerElement("item-not-found", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS)
View Full Code Here

                    stanza.getID());
            stanzaBuilder.startInnerElement("vCard", NamespaceURIs.VCARD_TEMP).endInnerElement();
            if (returnEmptyVCardWhenNonExistent) {
                // keep it like it is
            } else {
                stanzaBuilder.startInnerElement("error", NamespaceURIs.JABBER_CLIENT).addAttribute("type", "cancel")
                        .startInnerElement("item-not-found", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS)
                        .endInnerElement().endInnerElement();
            }
            return stanzaBuilder.build();
        }
View Full Code Here

        if (languageCode == null)
            languageCode = "en_US";
        StanzaBuilder stanzaBuilder = new StanzaBuilder("error");

        stanzaBuilder.startInnerElement(definedErrorCondition.value(),
                NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS).endInnerElement();

        if (descriptiveText != null) {
            stanzaBuilder.startInnerElement("text", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS).addAttribute(
                    NamespaceURIs.XML, "lang", languageCode).addText(descriptiveText).endInnerElement();
View Full Code Here

        stanzaBuilder.startInnerElement(definedErrorCondition.value(),
                NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS).endInnerElement();

        if (descriptiveText != null) {
            stanzaBuilder.startInnerElement("text", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STREAMS).addAttribute(
                    NamespaceURIs.XML, "lang", languageCode).addText(descriptiveText).endInnerElement();
        }

        if (applicationSpecificError != null) {
            stanzaBuilder.addPreparedElement(applicationSpecificError);
View Full Code Here

    }

    public Stanza getSASLFailure(SASLFailureType failureType) {
        StanzaBuilder stanzaBuilder = new StanzaBuilder("failure", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL);
        if (failureType != null) {
            stanzaBuilder.startInnerElement(failureType.toString(), NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_SASL)
                    .endInnerElement();
        }
        return stanzaBuilder.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

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.