Package com.google.appengine.api.xmpp

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


   * @param jid
   * @param msg
   */
  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


  /**
   * Invte User
   * @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

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

   
    return xmpp.getPresence(jid, new JID("talkfeed@appspot.com"));
  }
 
  public static final Message parseMessage(HttpServletRequest req) throws IOException{
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    return xmpp.parseMessage(req);
  }
View Full Code Here

   * @return
   * @throws IOException
   */
  public static final Presence getPresence(HttpServletRequest req) throws IOException{

    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    Presence presence = xmpp.parsePresence(req);
   
    Logger.getLogger("TalkService").info(
        " getPresenceFrom : " + presence.getFromJid().getId()  + "("
        + presence.isAvailable() + ")");
    /*
 
View Full Code Here

      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);
        boolean messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS);

        if (!messageSent) {
          /*
           * TODO Retry later?
View Full Code Here

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

    boolean messageSent = false;
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    if (xmpp.getPresence(jid).isAvailable()) {
      SendResponse status = xmpp.sendMessage(msg);
      messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS);
      this.mettreAJourAffichage(message);
    }

  }
View Full Code Here

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

    boolean messageSent = false;
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    if (xmpp.getPresence(jid).isAvailable()) {
      SendResponse status = xmpp.sendMessage(msg);
      messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS);
    }

    if (!messageSent) {
      resp.getWriter().println("<p>Le message n'a pas �t� envoy�.</p>");
View Full Code Here

            .withRecipientJids(jid)
            .withBody(message)
            .build();
               
        boolean messageSent = false;
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        if (xmpp.getPresence(jid).isAvailable()) {
            SendResponse status = xmpp.sendMessage(msg);
            messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS);
           this.mettreAJourAffichage(message);
        }
       
      
View Full Code Here

            .withRecipientJids(jid)
            .withBody(message)
            .build();
               
        boolean messageSent = false;
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        if (xmpp.getPresence(jid).isAvailable()) {
            SendResponse status = xmpp.sendMessage(msg);
            messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS);
        }

        if (!messageSent) {
          resp.getWriter().println("<p>Le message n'a pas �t� envoy�.</p>");
View Full Code Here

TOP

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

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.