Package com.google.appengine.api.xmpp

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


    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);
  }
 
  /**
   * Return a user name
   * @param req
View Full Code Here


public class ReceiveChatMessage extends HttpServlet {
  public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {

    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    Message message = xmpp.parseMessage(req);

    JID fromJid = message.getFromJid();
    String body = message.getBody();

    JID jid = new JID("julien.plagnes@gmail.com");
View Full Code Here

    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
     
       
       
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        Message message = xmpp.parseMessage(req);

        JID fromJid = message.getFromJid();
        String body = message.getBody();
       
        JID jid = new JID("coralie.ratier@gmail.com");
View Full Code Here

        log.info("XmppErrorServlet");

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

        Message message = xmpp.parseMessage(req);
        Entity statusEntity = MainPageServlet.getStatusEntity();
        statusEntity.setProperty("last_error", message.getBody());
        statusEntity.setProperty("Last_error_datetime", new Date());
        datastore.put(statusEntity);
    }
View Full Code Here

        log.info("ChatServlet");

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

        Message message = xmpp.parseMessage(req);
        JID userJID = message.getFromJid();
        Entity userEntity = MainPageServlet.getUserEntity(userJID);
        userEntity.setProperty("last_chat_message", message.getBody());
        datastore.put(userEntity);
View Full Code Here

    public void doPost(HttpServletRequest req,
                       HttpServletResponse resp)
        throws IOException {
        XMPPService xmpp = XMPPServiceFactory.getXMPPService();
        Message message = xmpp.parseMessage(req);

        String answer = doArithmetic(message.getBody());
        if (answer == null) {
            answer = "I didn't understand: " + message.getBody();
        }
View Full Code Here

   
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    Message message = null;
    try {
      /* Step 1 : Get the message */
      message = xmpp.parseMessage(req);

      /* Step 2 : Check the message body */
      // The body cannot be empty
      if (StringUtil.isEmpty(message.getBody())) {
        sendResponseToSender(xmpp, message.getFromJid(), "Bad request message format ;(");
View Full Code Here

  {
    req.setCharacterEncoding("UTF-8");
    resp.setCharacterEncoding("UTF-8");
    resp.setContentType("text/html; charset=utf-8");
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    Message message = xmpp.parseMessage(req);
    JID fromJID = message.getFromJid();                    //发送者JID
    String msgbody = message.getBody();                    //接收到的消息
    msgbody = msgbody.trim();
    if(msgbody.isEmpty())
    {
View Full Code Here

  public void doPost(HttpServletRequest req, HttpServletResponse res)
      throws IOException {
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
   
    // receive message
    Message message = xmpp.parseMessage(req);
    JID from = message.getFromJid();
    JID[] recipients = message.getRecipientJids();
    JID to = (recipients.length > 0) ? recipients[0] : null;
   
    String body = message.getBody();
View Full Code Here

  private static final Logger log = Logger.getLogger(PullwishFromGTalk.class.getName());

  public void doPost(HttpServletRequest req, HttpServletResponse res)
      throws IOException {
    XMPPService xmpp = XMPPServiceFactory.getXMPPService();
    Message message = xmpp.parseMessage(req);
    JID fromJid = message.getFromJid();
    String body = message.getBody();
    Message msg;

    try {
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.