Package com.google.appengine.api.channel

Examples of com.google.appengine.api.channel.ChannelService.sendMessage()


            channelService.sendMessage(new ChannelMessage(rId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(rId, gson.toJson(gm.getRTurn())))
        }else{
            channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_JOINING_FAILED+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(tk)))
        }
        break;
    }
    resp.getWriter().print(r);
  }
View Full Code Here


     
      while(keys.hasMoreElements()){
        key = keys.nextElement();
        if( key.equals("123321")) continue;
        try{
          channelService.sendMessage(new ChannelMessage(key, message));
          channelService.sendMessage(new ChannelMessage(key, gsu));
        }catch(Exception e){
          e.printStackTrace();
        }
      }
View Full Code Here

      while(keys.hasMoreElements()){
        key = keys.nextElement();
        if( key.equals("123321")) continue;
        try{
          channelService.sendMessage(new ChannelMessage(key, message));
          channelService.sendMessage(new ChannelMessage(key, gsu));
        }catch(Exception e){
          e.printStackTrace();
        }
      }
      Checkers.inSignIn.remove(userId);
View Full Code Here

      String rId = msg.getrId();
     
      if( userId.equals(msg.getsId()) && Checkers.userMap.get(userId) != null && Checkers.userMap.get(rId) != null ){
        //---------ICI Tester la valider du message-------------
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.MESSAGE+"\"}"));
          channelService.sendMessage(new ChannelMessage(rId, gson.toJson(msg)));
      }else if(userId.equals(msg.getsId()) ){
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.ERROR+"\"}"));
          channelService.sendMessage(new ChannelMessage(userId, gson.toJson(new String("Code : "+Constant.ERR_CODEOO1+" Message has not been sent to : "+rId))));       
View Full Code Here

     
      if( userId.equals(msg.getsId()) && Checkers.userMap.get(userId) != null && Checkers.userMap.get(rId) != null ){
        //---------ICI Tester la valider du message-------------
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.MESSAGE+"\"}"));
          channelService.sendMessage(new ChannelMessage(rId, gson.toJson(msg)));
      }else if(userId.equals(msg.getsId()) ){
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.ERROR+"\"}"));
          channelService.sendMessage(new ChannelMessage(userId, gson.toJson(new String("Code : "+Constant.ERR_CODEOO1+" Message has not been sent to : "+rId))));       
      }
View Full Code Here

        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.MESSAGE+"\"}"));
          channelService.sendMessage(new ChannelMessage(rId, gson.toJson(msg)));
      }else if(userId.equals(msg.getsId()) ){
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.ERROR+"\"}"));
          channelService.sendMessage(new ChannelMessage(userId, gson.toJson(new String("Code : "+Constant.ERR_CODEOO1+" Message has not been sent to : "+rId))));       
      }
     
    }
   
View Full Code Here

          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.MESSAGE+"\"}"));
          channelService.sendMessage(new ChannelMessage(rId, gson.toJson(msg)));
      }else if(userId.equals(msg.getsId()) ){
        ChannelService channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.ERROR+"\"}"));
          channelService.sendMessage(new ChannelMessage(userId, gson.toJson(new String("Code : "+Constant.ERR_CODEOO1+" Message has not been sent to : "+rId))));       
      }
     
    }
   
  }
View Full Code Here

    List<String> pathlist = Arrays.asList( path.split("/") ) ;
    Datastore datastore = new Datastore();
    Datastore.EntityWrap e = datastore.updateEntity(pathlist, input, meta);
   
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage( new ChannelMessage("/" + path, "M" ) );
    channelService.sendMessage( new ChannelMessage(e.getParentPath()+"/", "M" ) );
       
   
    resp.setContentType("application/json");
    String msg = Utils.makeGson().toJson(entityToMap(e.entity,e.getParentPath()), Map.class );
View Full Code Here

    Datastore datastore = new Datastore();
    Datastore.EntityWrap e = datastore.updateEntity(pathlist, input, meta);
   
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage( new ChannelMessage("/" + path, "M" ) );
    channelService.sendMessage( new ChannelMessage(e.getParentPath()+"/", "M" ) );
       
   
    resp.setContentType("application/json");
    String msg = Utils.makeGson().toJson(entityToMap(e.entity,e.getParentPath()), Map.class );
    resp.getWriter().println(msg);
View Full Code Here

      while ((line = reader.readLine()) != null)
        jb.append(line);
    } catch (Exception e) { /*report an error*/ }

    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage( new ChannelMessage(path, jb.toString() ) );
    resp.setContentType("text/plain");
    resp.getWriter().write("sent\n");

 
}
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.