IpRestriction restriction1 = database.getIpRestriction(id);
String ipAddress = restriction1.getAddress();
String ipPermission = restriction1.getAllowed() ? "Allowed" : "Denied";
try {
List<IpRestriction> restrictions = Arrays.asList(database.getIpRestrictions());
database.swapIpRestrictions(restriction1, restrictions.get(restrictions.indexOf(restriction1) + 1));
fireCoreEvent(request, CoreEventConstants.IP_RESTRICTION_MOVE_DOWN, ipAddress, ipPermission, CoreEvent.STATE_SUCCESSFUL);
} catch (Exception e) {
fireCoreEvent(request, CoreEventConstants.IP_RESTRICTION_MOVE_DOWN, ipAddress, ipPermission, CoreEvent.STATE_UNSUCCESSFUL);
throw e;
}