Package com.google.appengine.api.xmpp

Examples of com.google.appengine.api.xmpp.Subscription


        log.info("SubscriptionServlet: ..." + req.getPathInfo());

        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();

        Subscription sub = xmpp.parseSubscription(req);
        JID userJID = sub.getFromJid();
        Entity userEntity = MainPageServlet.getUserEntity(userJID);

        if (sub.getSubscriptionType() == SubscriptionType.SUBSCRIBED) {
            userEntity.setProperty("accepted_invitation", true);
        } else if (sub.getSubscriptionType() == SubscriptionType.UNSUBSCRIBED) {
            userEntity.setProperty("accepted_invitation", false);
        } else if (sub.getSubscriptionType() == SubscriptionType.SUBSCRIBE) {
            userEntity.setProperty("is_subscribed", true);
        } else if (sub.getSubscriptionType() == SubscriptionType.UNSUBSCRIBE) {
            userEntity.setProperty("is_subscribed", false);
        }
        datastore.put(userEntity);
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.xmpp.Subscription

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.