Session session = request.getSession(true);
if (!hasValidIdentity(session)) {
Identity identity = new Identity();
String remoteAddress = request.getRemoteAddr();
Machine machine = new Machine(remoteAddress);
IPRange[] ranges = accreditableManager.getIPRangeManager().getIPRanges();
for (int i = 0; i < ranges.length; i++) {
if (ranges[i].contains(machine)) {
machine.addIPRange(ranges[i]);
}
}
identity.addIdentifiable(machine);
session.setAttribute(Identity.class.getName(), identity);