private Cmds getCommand(String message) {
        int begin = message.indexOf(' ') + 1;
        int end = message.indexOf(' ', begin);
        if(end == NOT_FOUND)
            end = message.length();

        String cmd = message.substring(begin, end).toUpperCase();
        try {
            return Cmds.valueOf(cmd);
        } catch (IllegalArgumentException iae) {
            return Cmds.INVALID;
        }
    }