Examples of LoginCommand


Examples of com.alexnevsky.hotel.commands.general.LoginCommand

  /**
   * Construct command's catalogues.
   */
  private RequestHelper() {
    // general commands
    this.commandCatalog.put(AttributesManager.COMMAND_LOGIN, new LoginCommand());
    this.commandCatalog.put(AttributesManager.COMMAND_LOGOUT, new LogoutCommand());
    this.commandCatalog.put(AttributesManager.COMMAND_LANG, new LangCommand());

    // customer commands
    this.commandCatalog.put(AttributesManager.COMMAND_BOOKING_ROOM, new BookingRoomCommand());
View Full Code Here

Examples of com.alexnevsky.hotel.commands.general.LoginCommand

        logger.info("Not auth user change language: '" + command + "'" + ". RemoteAddr: "
            + request.getRemoteAddr());

      } else { // not lang command. login command: default command for not auth user
        command = new LoginCommand();

        logger.warn("Action '" + action + "' from not auth user. Create and send command to controller: '"
            + command + "'" + ". RemoteAddr: " + request.getRemoteAddr());
      } // end if lang action
    } // end isAuthUser()
View Full Code Here

Examples of flex.messaging.security.LoginCommand

    private void createAuthorizationManager(MessageBroker broker)
    {
        LoginManager loginManager = new LoginManager();

        // Create a Login Command for the LoginManager.
        LoginCommand loginCommand = null;

        Map loginCommands = securitySettings.getLoginCommands();

        // If default Login Command is enabled, use it.
        LoginCommandSettings loginCommandSettings = (LoginCommandSettings)loginCommands.get(LoginCommandSettings.SERVER_MATCH_OVERRIDE);
View Full Code Here

Examples of flex.messaging.security.LoginCommand

    {
        String loginClass = loginCommandSettings.getClassName();
        Class c = ClassUtil.createClass(loginClass,
                FlexContext.getMessageBroker() == null ? null :
                FlexContext.getMessageBroker().getClassLoader());
        LoginCommand loginCommand = (LoginCommand)ClassUtil.createDefaultInstance(c, LoginCommand.class);

        return loginCommand;
    }
View Full Code Here

Examples of flex.messaging.security.LoginCommand

    private void createAuthorizationManager(MessageBroker broker)
    {              
        LoginManager loginManager = new LoginManager();
           
        // Create a LoginCommand for the LoginManager.
        LoginCommand loginCommand = null;
       
        Map loginCommands = securitySettings.getLoginCommands();
       
        // If default Login Command is enabled, use it.
        LoginCommandSettings loginCommandSettings = (LoginCommandSettings)loginCommands.get(LoginCommandSettings.SERVER_MATCH_OVERRIDE);
View Full Code Here

Examples of flex.messaging.security.LoginCommand

    {             
        String loginClass = loginCommandSettings.getClassName();
        Class c = ClassUtil.createClass(loginClass,
                FlexContext.getMessageBroker() == null ? null :
                FlexContext.getMessageBroker().getClassLoader());
        LoginCommand loginCommand = (LoginCommand)ClassUtil.createDefaultInstance(c, LoginCommand.class);
               
        return loginCommand;
    }
View Full Code Here

Examples of marauroa.server.game.dbcommand.LoginCommand

      if (!isValidEvent(msg, entry, ClientState.CONNECTION_ACCEPTED)) {
        return;
      }

      SecuredLoginInfo info = fillLoginInfo(msg, entry);
      DBCommand command = new LoginCommand(info,
          this, entry.clientid,
          msg.getSocketChannel(), msg.getProtocolVersion());
      DBCommandQueue.get().enqueue(command);
  }
View Full Code Here

Examples of marauroa.server.game.dbcommand.LoginCommand



  public void handleDelayedEvent(RPServerManager rpMan, Object data) {
    try {
      LoginCommand command = (LoginCommand) data;
      SecuredLoginInfo info = command.getInfo();

      /*
       * We check that player didn't failed too many time the login, if it
       * did, we reject the login request until the block pass.
       */
      if (command.getFailReason() == MessageS2CLoginNACK.Reasons.TOO_MANY_TRIES) {
        logger.debug("Blocked account for player " + info.username + " and/or address " + info.address);

        /* Send player the Login NACK message */
        MessageS2CLoginNACK msgLoginNACK = new MessageS2CLoginNACK(command.getChannel(),
                MessageS2CLoginNACK.Reasons.TOO_MANY_TRIES);

        msgLoginNACK.setProtocolVersion(command.getProtocolVersion());
        netMan.sendMessage(msgLoginNACK);
       
        /*
         * Disconnect player of server.
         */
        netMan.disconnectClient(command.getChannel());

        return;
      }
     
      /*
       * We verify the username and the password to make sure player is
       * who he/she says he/she is.
       */
      if (command.getFailReason() != null) {
        /*
         * If the verification fails we send player a NACK and record
         * the event
         */
        logger.debug("Incorrect username/password for player " + info.username);
        stats.add("Players invalid login", 1);

        /* Send player the Login NACK message */
        if (info.reason == null) {
          info.reason = MessageS2CLoginNACK.Reasons.USERNAME_WRONG;
        }
        MessageS2CLoginNACK msgLoginNACK = new MessageS2CLoginNACK(command.getChannel(),
            info.reason);

        msgLoginNACK.setProtocolVersion(command.getProtocolVersion());
        netMan.sendMessage(msgLoginNACK);
        playerContainer.remove(command.getClientid());
        return;
      }

      /*
       * We check now the account is not banned or inactive.
       */
      if (command.getFailMessage() != null) {
        logger.info("Banned/Inactive account for player " + info.username + ": " + command.getFailMessage());

        /* Send player the Login NACK message */
        MessageS2CLoginMessageNACK msgLoginMessageNACK = new MessageS2CLoginMessageNACK(command.getChannel(), command.getFailMessage());
        msgLoginMessageNACK.setProtocolVersion(command.getProtocolVersion());
        netMan.sendMessage(msgLoginMessageNACK);

        /*
         * Disconnect player of server.
         */
        netMan.disconnectClient(command.getChannel());

        return;
      }

      /* Now we count the number of connections from this ip-address */
      int count = info.countConnectionsFromSameIPAddress(playerContainer);
      Configuration conf = Configuration.getConfiguration();
      int limit = conf.getInt("parallel_connection_limit", TimeoutConf.PARALLEL_CONNECTION_LIMIT);
      if (count > limit) {
        String whiteList = "," + conf.get("ip_whitelist", "127.0.0.1") + ",";
        if (whiteList.indexOf("," + info.address + ",") < 0) {
          logger.info("to many parallel connections from " + info.address + " rejecting login of " + info.username);

          /* Send player the Login NACK message */
          MessageS2CLoginMessageNACK msgLoginMessageNACK = new MessageS2CLoginMessageNACK(command.getChannel(),
            "There are too many connections from your ip-address.\nPlease contact /support, if you are at a conference or something similar.");
          msgLoginMessageNACK.setProtocolVersion(command.getProtocolVersion());
          netMan.sendMessage(msgLoginMessageNACK);

          // Disconnect player of server.
          netMan.disconnectClient(command.getChannel());
          return;
        }
      }

      /* Obtain previous logins attemps */
      List<String> previousLogins = command.getPreviousLogins();

      completeLogin(command.getChannel(), command.getClientid(), command.getProtocolVersion(), info, previousLogins);
    } catch (IOException e) {
      logger.error("error while processing SecuredLoginEvent: " + data, e);
    } catch (RuntimeException e) {
      logger.error("error while processing SecuredLoginEvent: " + data, e);
    }
View Full Code Here

Examples of org.exoplatform.frameworks.jcr.cli.LoginCommand

    */

   public void testCtxLogin() throws Exception
   {
      params.clear();
      LoginCommand loginCommand = (LoginCommand)cservice.getCatalog("CLI").getCommand("login");
      params.add("ws");
      ctx.put(PARAMETERS_KEY, params);
      loginCommand.execute(ctx);
      System.out.println("[out]:" + ctx.getOutput());
      assertEquals(ctx.getCurrentItem(), ctx.getSession().getRootNode());
      assertEquals("ws", ctx.getSession().getWorkspace().getName());
   }
View Full Code Here

Examples of org.exoplatform.frameworks.jcr.cli.LoginCommand

    */

   public void testCtxLogin() throws Exception
   {
      params.clear();
      LoginCommand loginCommand = (LoginCommand)cservice.getCatalog("CLI").getCommand("login");
      params.add("ws");
      ctx.put(PARAMETERS_KEY, params);
      loginCommand.execute(ctx);

      assertEquals(ctx.getCurrentItem(), ctx.getSession().getRootNode());
      assertEquals("ws", ctx.getSession().getWorkspace().getName());
   }
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.