Package com.google.appengine.api.channel

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


      zprava.put("typ", "connect");
      zprava.put("login", s.getNick());
     
      JSONObject json=JSONObject.fromObject(zprava);

      chanel.sendMessage(new ChannelMessage(userId, json.toString()));
     
      System.out.println("odelslano" + userId);
    }
  }
 
View Full Code Here


    HashMap<String, String> jsonMap=new HashMap<String, String>();
    jsonMap.put("typ", "chatInfo");
    jsonMap.put("text",zprava);
    JSONObject json=JSONObject.fromObject(jsonMap);
   
    chanel.sendMessage(new ChannelMessage(hrac.getUserId(), toUTF8(json.toString())));     
  }
 
  /**
   * Odesle vsem hracum informaci o tom ktery hrac je na tahu
   * @param hrac
View Full Code Here

    UserBeanOAM oam = provider.get();
    oam.updateOnline(isOnline(), email);
    GetUserInfoResult result = oam.getGetUserInfoResult(email);
    for(String online : result.getOnline()){
      log.info(email+" is online = "+isOnline()+". Sending message to "+online);
      channelService.sendMessage(new ChannelMessage(online, getJson(email, online)));
    }
  }
 
  protected abstract boolean isOnline();
 
View Full Code Here

      ExecutionContext context) throws ActionException {
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    String json = toJson.getJson(action.getMessage(), user.getEmail(), MessageType.message);
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage(new ChannelMessage(action.getEmail(), json));
    MessageOAM oam = provider.get();
    oam.addMessage(action, user.getEmail());
    return new SendMessageResult();
  }
View Full Code Here

    // Pending contacts exists only in one user, but contacts in two
    if(!action.isPending()){
      oam.removeContact(action.getEmail(), user.getEmail(), false);
      String json = toJson.getJson(null, user.getEmail(), MessageType.removeContact);
      ChannelService channelService = ChannelServiceFactory.getChannelService();
      channelService.sendMessage(new ChannelMessage(action.getEmail(), json));
    }
    return new RemoveContactResult();
  }

  @Override
View Full Code Here

    // And the other has the same friend
    oam.addFriend(action.getEmail(), user.getEmail());
   
    String json = toJson.getJson(null, user.getEmail(), MessageType.addContact);
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    channelService.sendMessage(new ChannelMessage(action.getEmail(), json));
    return new AddFriendResult(result);
  }

  @Override
  public void undo(AddFriend action, AddFriendResult result,
View Full Code Here

    } else {
      // send msg
      ChannelService channelService = ChannelServiceFactory.getChannelService();
      logger.info("sending msg : client id = " + clientId);
      logger.info("sending msg size = " + msg.length());
      channelService.sendMessage(new ChannelMessage(clientId, msg))
    }
  }
 
  /**
   * @param allInOneSize
View Full Code Here

                .asKeyList();
        ChannelService channelService =
            ChannelServiceFactory.getChannelService();
        String memoJson = MemoMeta.get().modelToJson(memo);
        for (Key channel : channels) {
            channelService.sendMessage(new ChannelMessage(
                channel.getName(),
                memoJson));
        }
    }
}
View Full Code Here

    String message = req.getParameter("message");
   
    //Send a message based on the 'channelKey' any channel with this key will receive the message
    ChannelService channelService = ChannelServiceFactory.getChannelService();
   
  channelService.sendMessage(new ChannelMessage(channelKey, message));
  }
}
View Full Code Here

    str += "]";
   
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    for(int n = 0; n < this.arrNetNodesIds.size(); n++) {
      String channelKey = getChannelKey(this.arrNetNodesIds.get(n));
      channelService.sendMessage(new ChannelMessage(channelKey, str));
    }
   
  }
  public void getNetNodes(String userID) {
    ChannelService channelService = ChannelServiceFactory.getChannelService();
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.