boolean connectionOpened(ServerConnection connection) { if (this.connection != connection) { connection.close(); return false; } // Login to the server AdminContent auth = new AdminContent(AdminContent.AUTH); auth.setAttribute("name", userName); auth.setAttribute("password", userPassword); auth.setAttribute("client.version", CLIENT_VERSION); Message msg = new Message(userName, Agent.ADMIN, auth); return connection.sendMessage(msg); }