Package com.google.appengine.api.xmpp

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


        Message reply = new MessageBuilder()
            .withRecipientJids(message.getFromJid())
            .withBody(answer)
            .build();
        SendResponse success = xmpp.sendMessage(reply);
        if (success.getStatusMap().get(message.getFromJid())
            != SendResponse.Status.SUCCESS) {
            log.warning("Could not send XMPP reply to " + message.getFromJid());
        }
    }
View Full Code Here


        .withRecipientJids(fromJID)
        .withBody(strMessage)
        .build();
    if(xmpp.getPresence(fromJID).isAvailable())
    {
      SendResponse success = xmpp.sendMessage(MsgSend);
      if(success.getStatusMap().get(fromJID) != SendResponse.Status.SUCCESS//发送失败,重试一次
      {
        success = xmpp.sendMessage(MsgSend);
      }
    }
View Full Code Here

    if(xmpp.getPresence(fromJID).isAvailable())
    {
      SendResponse success = xmpp.sendMessage(MsgSend);
      if(success.getStatusMap().get(fromJID) != SendResponse.Status.SUCCESS//发送失败,重试一次
      {
        success = xmpp.sendMessage(MsgSend);
      }
    }
  }
 
 
View Full Code Here

         
          // reply to message
          Message msg = new MessageBuilder().withRecipientJids(from)
              .withFromJid(to).withBody(response.toString())
              .build();
          xmpp.sendMessage(msg);
        } else {
          throw new Exception(
              "Request does not contain a valid JSON-RPC request or response");
        }
      } catch (Exception err) {
View Full Code Here

        JSONResponse response = new JSONResponse(jsonError);
       
        // send exception as response
        Message msg = new MessageBuilder().withRecipientJids(from)
            .withFromJid(to).withBody(response.toString()).build();
        xmpp.sendMessage(msg);
      }
    }
  }
 
  /**
 
View Full Code Here

    } else {
      msg = new MessageBuilder().withRecipientJids(fromJid)
          .withBody("I can't understand you.").build();
    }
    // SendResponse status =
    xmpp.sendMessage(msg);
    // messageSent = (status.getStatusMap().get(copy2jid) ==
  }
}
View Full Code Here

              Message msg = new MessageBuilder()
                .withRecipientJids(from)
                .withFromJid(to)
                .withBody(response.toString())
                .build();
              xmpp.sendMessage(msg)
        }
        else {
          throw new Exception("Request does not contain a valid JSON-RPC request or response");
        }
      }
View Full Code Here

            Message msg = new MessageBuilder()
              .withRecipientJids(from)
              .withFromJid(to)
              .withBody(response.toString())
              .build();
            xmpp.sendMessage(msg);
      }
    }
    }

  /**
 
View Full Code Here

              Message msg = new MessageBuilder()
                .withRecipientJids(from)
                .withFromJid(to)
                .withBody(response.toString())
                .build();
              xmpp.sendMessage(msg)
        }
        else {
          throw new Exception("Request does not contain a valid JSON-RPC request or response");
        }
      }
View Full Code Here

            Message msg = new MessageBuilder()
              .withRecipientJids(from)
              .withFromJid(to)
              .withBody(response.toString())
              .build();
            xmpp.sendMessage(msg);
      }
    }
    }

  /**
 
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.