Пример #1
0
 public boolean isNickExist(String nick) {
   logger.trace("Test of nickname exist : " + nick);
   for (Connection connection : server.getUsersConnection()) {
     if (nick.equals(connection.getNickname())) {
       return true;
     }
   }
   return false;
 }
Пример #2
0
 public void handle(Connection connection, Request request)
     throws UnkownRequestException, TechnicalException {
   logger.debug("Handle command in Request Handler : " + request);
   Command command = coreCommands.instanceOfCommand(request.getCommand());
   // Check Registration
   if (command.userMustBeRegister() && !connection.isRegistredConnection()) {
     throw new TechnicalException("You must specified NICK and USER before this action");
   }
   // Handle Command
   List<Filter> filters = coreFilters.list();
   executeFilters(filters, request.getCommand(), connection, request, true);
   command.handle(connection, request);
   executeFilters(filters, request.getCommand(), connection, request, false);
   // TODO Replace this by AOP ?
 }