Package org.apache.vysper.xmpp.modules.roster

Examples of org.apache.vysper.xmpp.modules.roster.RosterItem


    private XMPPCoreStanza handleInboundPresenceProbe(PresenceStanza stanza, ServerRuntimeContext serverRuntimeContext,
            SessionContext sessionContext, ResourceRegistry registry, RosterManager rosterManager) {
        Entity contact = stanza.getFrom();
        Entity user = stanza.getTo();

        RosterItem contactItem;
        try {
            contactItem = rosterManager.getContact(user, contact.getBareJID());
        } catch (RosterException e) {
            contactItem = null;
        }
        if (contactItem == null || !contactItem.hasFrom()) {
            // not a contact, or not a _subscribed_ contact!
            relayStanza(contact, buildPresenceStanza(user, contact, UNSUBSCRIBED, null), sessionContext);
            return null;
        }
View Full Code Here


    public static TestUser createContact(TestSessionContext parentSession, MemoryRosterManager rosterManager,
            String entity, SubscriptionType subscriptionType) throws BindException, EntityFormatException,
            RosterException {
        TestUser testUser = createQueueReceiver(parentSession, EntityImpl.parse(entity));
        rosterManager.addContact(parentSession.getInitiatingEntity(), new RosterItem(testUser.getEntity(),
                subscriptionType));
        return testUser;
    }
View Full Code Here

        Entity user = stanza.getTo();

        Entity userBareJid = user.getBareJID();
        Entity contactBareJid = contact.getBareJID();

        RosterItem rosterItem;
        try {
            rosterItem = rosterManager.getContact(userBareJid, contactBareJid);
        } catch (RosterException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
View Full Code Here

        Entity userBareJid = user.getBareJID();
        Entity contactBareJid = contact.getBareJID();

        relayStanza(contact, stanza, sessionContext);

        RosterItem rosterItem = null;
        try {
            rosterItem = rosterManager.getContact(userBareJid, contactBareJid);
        } catch (RosterException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
View Full Code Here

        Entity user = stanza.getTo();

        Entity userBareJid = user.getBareJID();
        Entity contactBareJid = contact.getBareJID();

        RosterItem rosterItem;
        try {
            rosterItem = rosterManager.getContact(userBareJid, contactBareJid);
        } catch (RosterException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
View Full Code Here

    Entity contact = stanza.getTo();

        Entity userBareJid = user.getBareJID();
        Entity contactBareJid = contact.getBareJID();

        RosterItem rosterItem = null;
        try {
            rosterItem = rosterManager.getContact(userBareJid, contactBareJid);
        } catch (RosterException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
View Full Code Here

    Entity contact = stanza.getTo();

        Entity userBareJid = user.getBareJID();
        Entity contactBareJid = contact.getBareJID();

        RosterItem rosterItem = null;
        try {
            rosterItem = getExistingOrNewRosterItem(rosterManager, userBareJid, contactBareJid);

            RosterSubscriptionMutator.Result result = RosterSubscriptionMutator.getInstance().add(rosterItem, FROM);
            if (result != OK) {
View Full Code Here

            relayStanza(contact, sendoutPresence, sessionContext);
    }
  }

    private RosterItem getExistingOrNewRosterItem(RosterManager rosterManager, Entity userJid, Entity contactJid) throws RosterException {
        RosterItem rosterItem = rosterManager.getContact(userJid, contactJid);
        if (rosterItem == null) {
            rosterItem = new RosterItem(contactJid, NONE);
        }
        return rosterItem;
    }
View Full Code Here

        Entity contact = stanza.getFrom();
        Entity user = stanza.getTo();

        Entity userBareJid = user.getBareJID();

        RosterItem rosterItem;
        RosterSubscriptionMutator.Result result;
        try {
            rosterItem = getExistingOrNewRosterItem(rosterManager, userBareJid, contact);

            result = RosterSubscriptionMutator.getInstance().add(rosterItem, TO);
View Full Code Here

    Entity contact = stanza.getFrom();
    Entity user = stanza.getTo();

        Entity userBareJid = user.getBareJID();

        RosterItem rosterItem;
        RosterSubscriptionMutator.Result result;
        try {
            rosterItem = getExistingOrNewRosterItem(rosterManager, userBareJid, contact);

            result = RosterSubscriptionMutator.getInstance().add(rosterItem, ASK_SUBSCRIBED);
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.roster.RosterItem

Copyright © 2018 www.massapicom. 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.