Package com.google.appengine.api.xmpp

Examples of com.google.appengine.api.xmpp.XMPPService.sendPresence()


            datastore.put(userEntity);

        } else if (presence.getPresenceType() == PresenceType.PROBE) {
            // Respond to the probe by sending the app's presence.
            Entity statusEntity = MainPageServlet.getStatusEntity();
            xmpp.sendPresence(userJID,
                              ((Boolean)statusEntity.getProperty("presence_available")) ?
                              PresenceType.AVAILABLE : PresenceType.UNAVAILABLE,
                              PresenceShow.valueOf(((String)statusEntity.getProperty("presence_show")).toUpperCase()),
                              (String)statusEntity.getProperty("status_message"));
        }
View Full Code Here


        } else if (jid != null && command.equals("invite")) {
            xmpp.sendInvitation(jid);
            adminMessage = "Chat message sent to JID " + jidStr + ".";

        } else if (jid != null && command.equals("probe")) {
            xmpp.sendPresence(jid, PresenceType.PROBE, null, null);
            adminMessage = "A presence probe has been sent to JID " + jidStr + ".";

        } else if (command.equals("presence")) {
            // Store the app's presence.
            Entity statusEntity = MainPageServlet.getStatusEntity();
View Full Code Here

                                                      true);
            PreparedQuery pq = datastore.prepare(q);
            for (Entity e : pq.asIterable()) {
                String recipJidStr = (String)(e.getProperty("jid"));
                JID recipJid = new JID(recipJidStr);
                xmpp.sendPresence(recipJid,
                                  ((Boolean)statusEntity.getProperty("presence_available")) ?
                                  PresenceType.AVAILABLE : PresenceType.UNAVAILABLE,
                                  PresenceShow.valueOf(((String)statusEntity.getProperty("presence_show")).toUpperCase()),
                                  (String)statusEntity.getProperty("status_message"));
            }
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.