Package com.google.appengine.api.xmpp

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


    int minuteNextUpdate = user.getInterval();
    if (minuteNextUpdate < 10)
      minuteNextUpdate = 10;

    // test user presence
    JID jid = new JID(user.getId());
   
    boolean isAvailable = UserPresence.isUserAvailable(jid.getId());
   
    if (isAvailable) {
      //user is present : do update !

      // select subscriptions
View Full Code Here


  /**
   *
   */
  public static final void sendMessage(String id, String msg){
   
    sendMessage(new JID(id), msg);
   
  }
View Full Code Here

   */
  public static final void sendMessage(JID jid, String msg){
   
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
   
    Presence presence = xmpp.getPresence(jid , new JID("talkfeed@appspot.com"));

   
    Logger log = Logger.getLogger(TalkService.class.getName());
    log.info(" send message to : " + jid.getId()
        + ". Presence : " + presence.isAvailable()
        + ". presence show : " + presence.getPresenceShow()
        + ". presence type : "+ presence.getPresenceType());
   
    //
    boolean isAvailable = UserPresence.isUserAvailable(jid.getId());
    if (isAvailable){
     
      MessageBuilder mb = new MessageBuilder();
      Message reply = mb.withRecipientJids(jid)
        .withMessageType(MessageType.CHAT)
        .withBody(msg)
        .withFromJid(new JID("talkfeed@appspot.com"))
        .build();
     
     
     
      xmpp.sendMessage(reply);
View Full Code Here

   * @param jid
   */
  public static final void invite(JID jid){
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
   
    xmpp.sendInvitation(jid, new JID("talkfeed@appspot.com"));
  }
View Full Code Here

  }
 
  public static final Presence getXmppPresence(JID jid) {
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
   
    return xmpp.getPresence(jid, new JID("talkfeed@appspot.com"));
  }
View Full Code Here

  private boolean sendMsg(String msgBody) {
    if (msgBody == "") {
      return false;
    }

    JID jid = new JID(Const.EMAIL);

    Message msg = new MessageBuilder().withRecipientJids(jid)
        .withBody(msgBody).build();

    boolean messageSent = false;
View Full Code Here

      method = "jabber";
    }

    if (email != null) {

      JID jid = new JID(email);
      TalkService.invite(jid);

      resp.addCookie(new Cookie("invited", method));

      return "page/invited";
View Full Code Here

  @Override
  public void execute(Map<String, String> args) {

    String id = args.get("id");
    JID jid = new JID(id);
   
    DataManager dm = DataManagerFactory.getInstance();
   
    PersistenceManager pm = dm.newPersistenceManager();
   
View Full Code Here

        }

        break;
      }
      case GTalk: {
        JID jid = new JID(getCurrentUser().getEmail());
        com.google.appengine.api.xmpp.Message xmppMessage = new MessageBuilder()
            .withRecipientJids(jid).withBody(report).build();

        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        SendResponse status = xmpp.sendMessage(xmppMessage);
View Full Code Here

  }

  public void envoyer(String message) {

    JID jid = new JID("julien.plagnes@gmail.com");

    Message msg = new MessageBuilder().withRecipientJids(jid)
        .withBody(message).build();

    boolean messageSent = false;
View Full Code Here

TOP

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

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.