_user = getServer().getOGUser(request.getUserName());
}
}
if (getUserPrincipal() == null) {
ConnectionResponseMessage response = new ConnectionResponseMessage();
response.setResult(ConnectionResult.NOT_AUTHORIZED);
sendMessage(ConnectionResponseBuilder.buildMessageStatic(new FudgeSerializer(fudgeContext), response));
// On failure tear down the connection when http://jira.opengamma.com/browse/PLAT-2458 is done.
getServer().removeClient(this);
} else {
ConnectionResponseMessage response = new ConnectionResponseMessage();
response.setResult(ConnectionResult.NEW_CONNECTION_SUCCESS);
response.setAvailableServers(getServer().getAvailableServers());
response.applyCapabilities(getServer().getCapabilities());
sendMessage(ConnectionResponseBuilder.buildMessageStatic(new FudgeSerializer(fudgeContext), response));
}
}