Package org.apache.vysper.xmpp.stanza

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


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

        buildSuccessStanza(sb, subscriptions);

        sb.endInnerElement(); // pubsub
        return new IQStanza(sb.build());
    }

    /**
     * Traverses through all nodes to collect all affiliations of the user.
     * @return the list of subscriptions or an empty list.
View Full Code Here


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

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

    /**
     * This method takes care of handling the "affiliations" use-case including all (relevant) error conditions.
     *
 
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());
    }

    /**
     * Creates the stanza to be sent for successful requests.
     */
 
View Full Code Here

            startInnerElement("bind", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND).
                    startInnerElement("jid", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_BIND).
                    addText(entity.getFullQualifiedName()).endInnerElement().
            endInnerElement();

        return stanzaBuilder.build();
    }

    private Stanza bindError(IQStanza stanza, SessionContext sessionContext) {
        StanzaBuilder stanzaBuilder =
            StanzaBuilder.createIQStanza(null, null, IQStanzaType.ERROR, stanza.getID()).
View Full Code Here

            startInnerElement("error").
                    addAttribute("type", "cancel").
                    startInnerElement("not-allowed", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).
            endInnerElement();

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

                infoElement.insertElement(stanzaBuilder);
            }

        stanzaBuilder.endInnerElement();

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

            }
            stanzaBuilder.endInnerElement();
        } else {
            stanzaBuilder.addText(privateDataXML);
        }
        return stanzaBuilder.build();
    }

    /**
     * Create a property name that is unique for this query. eg this XMLElement:
     * <storage xmlns="storage:bookmarks"> is converted into this string:
View Full Code Here

            for (Item item : items) {
                item.insertElement(stanzaBuilder);
            }
        stanzaBuilder.endInnerElement();

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

                    startInnerElement("error").addAttribute("type", "cancel").
                        startInnerElement("item-not-found", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).
                        endInnerElement().
                    endInnerElement();
            }
            return stanzaBuilder.build();
        }

        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(), IQStanzaType.RESULT, stanza.getID());
        stanzaBuilder.addText(vcardXml);
        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.