Package org.apache.vysper.xmpp.stanza

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


        public Stanza getStanza(Entity client, Entity pubsub, String id, String node) {
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
            stanzaBuilder.startInnerElement("query", getNamespace());
            stanzaBuilder.addAttribute("node", node);

            stanzaBuilder.endInnerElement();

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


       
        List<SubscriptionItem> subscriptions = collectSubscriptions(root, sender, nodeName);

        buildSuccessStanza(sb, nodeName, subscriptions);

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

    /**
     * Traverses through all nodes or a single node to collect all subscriptions of the user.
View Full Code Here

       
        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.
View Full Code Here

                // subID not valid (6.2.3.5)
                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

            return errorStanzaGenerator.generateNotAcceptableErrorStanza(serverJID, sender, stanza);
        } 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

            }
            for (InfoElement infoElement : elements) {
                infoElement.insertElement(stanzaBuilder);
            }

        stanzaBuilder.endInnerElement();

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

        if (privateDataXML == null) {
            stanzaBuilder.startInnerElement(x.getName());
            for (Attribute a : x.getAttributes()) {
                stanzaBuilder.addAttribute(a);
            }
            stanzaBuilder.endInnerElement();
        } else {
            stanzaBuilder.addText(privateDataXML);
        }
        return stanzaBuilder.build();
    }
View Full Code Here

                stanzaBuilder.addAttribute("node", node);
            }
            for (Item item : items) {
                item.insertElement(stanzaBuilder);
            }
        stanzaBuilder.endInnerElement();

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

            for (RosterItem rosterItem : rosterItems) {
                createRosterItem(stanzaBuilder, rosterItem);
            }

        stanzaBuilder.endInnerElement();

        return stanzaBuilder;
    }

    public static Stanza createRosterItemPushIQ(Entity to, String id, RosterItem rosterItem) {
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.