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

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


                continue;
            }

            String name = readAttribute(node, "name");
            String typeString = readAttribute(node, "type");
            SubscriptionType subscriptionType = null;
            try {
                subscriptionType = SubscriptionType.valueOf(typeString == null ? "NONE" : typeString.toUpperCase());
            } catch (IllegalArgumentException e) {
                logger.warn("when loading roster for user " + bareJid + ", contact " + contactJid + " misses a subscription type", bareJid, contactJid);
            }
View Full Code Here


                throw new IllegalArgumentException("unhandled SubscriptionType " + addAskSubscriptionType.value());
        }
    }

    protected Result addAskSubscribe(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        AskSubscriptionType typeAsk = item.getAskSubscriptionType();
        if (type.includesTo()) return ALREADY_SET;
        if (typeAsk == ASK_SUBSCRIBE) return OK;
        // IGNORE this, overwrite! if (typeAsk == ASK_SUBSCRIBED) return ALREADY_SET;
        item.setAskSubscriptionType(ASK_SUBSCRIBE);
        return OK;
    }
View Full Code Here

        item.setAskSubscriptionType(ASK_SUBSCRIBE);
        return OK;
    }

    protected Result addAskSubscribed(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        AskSubscriptionType typeAsk = item.getAskSubscriptionType();
        if (type.includesFrom()) return ALREADY_SET;
        if (typeAsk == ASK_SUBSCRIBE) return FAILED; // TODO think about return value
        if (typeAsk == ASK_SUBSCRIBED) return OK;
        item.setAskSubscriptionType(ASK_SUBSCRIBED);
        return OK;
    }
View Full Code Here

        item.setAskSubscriptionType(ASK_SUBSCRIBED);
        return OK;
    }

    protected Result addTo(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (type.includesTo()) return ALREADY_SET;
        if (type == NONE) {
            type = TO;
        } else if (type == FROM) {
            type = BOTH;
        }
View Full Code Here

        if (item.getAskSubscriptionType() == ASK_SUBSCRIBE) item.setAskSubscriptionType(NOT_SET);
        return OK;
    }

    protected Result addFrom(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (type.includesFrom()) return ALREADY_SET;
        if (type == NONE) {
            type = FROM;
        } else if (type == TO) {
            type = BOTH;
        }
View Full Code Here

                throw new IllegalArgumentException("unhandled SubscriptionType " + removeSubscriptionType.value());
        }
    }

    protected Result removeTo(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (!type.includesTo()) {
            // if sub was asked, remove that.
            AskSubscriptionType askType = item.getAskSubscriptionType();
            if (askType != ASK_SUBSCRIBE) return ALREADY_SET;
            item.setAskSubscriptionType(NOT_SET);
            return OK;
View Full Code Here

        item.setSubscriptionType(type);
        return OK;
    }

    protected Result removeFrom(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (!type.includesFrom()) {
            // if sub was asked, remove that.
            AskSubscriptionType askType = item.getAskSubscriptionType();
            if (askType != ASK_SUBSCRIBED) return ALREADY_SET;
            item.setAskSubscriptionType(NOT_SET);
            return OK;
View Full Code Here

                continue;
            }

            String name = readAttribute(node, "name");
            String typeString = readAttribute(node, "type");
            SubscriptionType subscriptionType = null;
            try {
                subscriptionType = SubscriptionType.valueOf(typeString == null ? "NONE" : typeString.toUpperCase());
            } catch (IllegalArgumentException e) {
                logger.warn("when loading roster for user " + bareJid + ", contact " + contactJid
                        + " misses a subscription type", bareJid, contactJid);
View Full Code Here

TOP

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

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.