Package com.google.appengine.api.channel

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


      log.info("gen rand");
      String newClientId = new BigInteger(130, rand).toString(32);
      ChannelService channelService = ChannelServiceFactory.getChannelService();
      // Open new channel
      log.info("duration minutes: " + CHANNEL_TOKEN_TIMEOUT_MINUTES);
      String newChannelToken = channelService.createChannel(newClientId, CHANNEL_TOKEN_TIMEOUT_MINUTES);
      // Save new entity
      long expires = new Date().getTime() + CHANNEL_TOKEN_TIMEOUT_MILIS;
      new ChannelConnection()
        .setClientId(newClientId)
        .setChannelToken(newChannelToken)
View Full Code Here


         userId = userService.getCurrentUser().getUserId();
      }
     
      //asi vytvoreni kanalu a prirazeni tokenu
      if (channelService != null){
         token = channelService.createChannel(userId);
      }
     
      String login = userService.getCurrentUser().getNickname();
      String email = userService.getCurrentUser().getEmail();
     
View Full Code Here

    final ChannelService channelService = ChannelServiceFactory.getChannelService();
    //vytvoreni ID pro uzivatele
    String userId = userService.getCurrentUser().getUserId();
   
    //asi vytvoreni kanalu a prirazeni tokenu
    String token = channelService.createChannel(userId);
   
    //ted musime predat token do stranky uzivatele (asi :-) )
    //v googlu vemou obsah indexu a tam si daji nejaky tag ktery pak nahradi tim tokenem
    //viz index=index.replaceAll("\\{\\{ token \\}\\}",token);
    //pak nasleduje odeslani predelane stranky s tokenemn
View Full Code Here

   
    //vytvoreni tokenu
    //asi vytvoreni kanalu a prirazeni tokenu
    final ChannelService channelService = ChannelServiceFactory.getChannelService();
    if (channelService != null){
       token = channelService.createChannel(userId);
       zakladatel.setChannel(token);
       model.addAttribute("usrKey", Zpravy.upravText(token));
   
   
View Full Code Here

         SeznamHracu sh = SpravceHer.getInstance().getHra(hraId).getHraci();
         System.out.println(sh.vratPocetHracu());
         //vytvoreni tokenu
         //asi vytvoreni kanalu a prirazeni tokenu
         if (channelService != null){
           token = channelService.createChannel(userId);
           pripojeny.setChannel(token);
          
           model.addAttribute("usrKey", Zpravy.upravText(token));
           model.addAttribute("hraId", Zpravy.upravText(hraId));
           model.addAttribute("user", Zpravy.upravText(userId));
View Full Code Here

  public CreateTokenResult execute(CreateToken action, ExecutionContext context)
      throws ActionException {
    UserService userService = UserServiceFactory.getUserService();
      String userId = userService.getCurrentUser().getEmail();
      ChannelService channelService = ChannelServiceFactory.getChannelService();
      String token = channelService.createChannel(userId, MINUTES);
    return new CreateTokenResult(token);
  }

  @Override
  public void undo(CreateToken action, CreateTokenResult result,
View Full Code Here

    Random generator = new Random(Calendar.getInstance().getTimeInMillis());
    String userId = "clientId-" + generator.nextInt();
    // The 'Game' object exposes a method which creates a unique string based on the game's key
      // and the user's id.
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    String token = channelService.createChannel(userId);
    this.connectedClients.add(userId);
    return token;
  }
 
  //@ModelAttribute("total")
View Full Code Here

            return null;
        }
        String clientId = UUID.randomUUID().toString();
        ChannelService channelService =
            ChannelServiceFactory.getChannelService();
        String token = channelService.createChannel(clientId);
        MinutesChannel minutesChannel = new MinutesChannel();
        minutesChannel.setKey(Datastore.createKey(
            MinutesChannel.class,
            clientId));
        minutesChannel.setCreatedAt(new Date());
View Full Code Here

    ChannelService channelService = ChannelServiceFactory.getChannelService();
   
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    this.token = channelService.createChannel(stormChannel.getChannelKey(user.getUserId()));  
     
    //this.token = channelService.createChannel( gameKey );  
    //token = channelService.createChannel( KeyFactory.keyToString(stormChannel.getKey()) ); 
   
   
View Full Code Here

        userName = req.getParameter(Constant.USER_NAME).toString();
        User user = new User(userId, userName);
        inSignIn.put(userId, user);
        //XXXXXXXXXXXTest if user exist xxxxxxxxxxxxxxxxxxxxxxx
          channelService = ChannelServiceFactory.getChannelService();
          String token = channelService.createChannel(userId);
          r = token;
          break;
      case Constant.CONNECTED_USER_LIST:
        userId = req.getParameter(Constant.USER_ID).toString();
        if( userMap.get(userId) != null){
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.