private void executeLoginCommand(TCPSession session, String username, int udpPort) {
        Matcher matcher;

        UDPClient client = new UDPClient(session.getRemoteAddress(), udpPort);
        UserFactory userFactory = new NetworkUserFactory(client, this.warehouse, this.readWriteLock);
        try {
            AuctionUser user = this.authenticator.login(username, userFactory);
            boolean loggedIn = true;
            session.writeString("Successfully logged in");

            while (loggedIn) {
                String userCommandText = session.readString().trim();
                //!list
                if (userCommandText.equals("!list")) {
                    executeListCommand(session);
                }
                //!create <duration> <description>
                else if ((matcher = Pattern.compile("^\\!create\\s+(\\d+)\\s+(\\S.*)$").matcher(userCommandText)).matches()) {
                    int durationInSeconds = Integer.parseInt(matcher.group(1));
                    String description = matcher.group(2);

                    executeCreateAuctionCommand(session, user, durationInSeconds, description);
                }
                //!bid <auction-id> <amount>
                else if ((matcher = Pattern.compile("^\\!bid\\s+(\\d+)\\s+(\\d+|\\d+\\.\\d+)$").matcher(userCommandText)).matches()) {
                    int auctionId = Integer.parseInt(matcher.group(1));
                    double amount = Double.parseDouble(matcher.group(2));
                    executeBidCommand(session, user, auctionId, amount);
                }
                //!logout
                else if (userCommandText.equals("!logout")) {
                    executeLogoutCommand(session, user);
                    loggedIn = false;
                }
                //!login <username> <udpPort>
                else if ((matcher = Pattern.compile("^\\!login\\s+(\\w+)\\s+(\\d+)$").matcher(userCommandText)).matches()) {
                    session.writeString("You are already logged in");
                } //!logout
                else if (userCommandText.equals("!end")) {
                    session.writeString("You have to logout first");
                }
                else {
                    session.writeString("Unknown Command '" + userCommandText + "'");
                }
            }

        } catch (AuthenticationException e) {
            session.writeString(e.getMessage());
        }
    }