private boolean isAdditionValid(HttpServletRequest request, IpRestrictionForm form) throws Exception {
IpRestriction[] ipRestrictions = findIpRestrictions(form.getRestriction().getAddress(), form.getType().equals(IpRestrictionForm.ALLOW_TYPE));
SystemDatabase database = SystemDatabaseFactory.getInstance();
String remoteAddr = request.getRemoteAddr();
return database.verifyIPAddress(remoteAddr, ipRestrictions);
}
private IpRestriction[] findIpRestrictions(String restriction, boolean isAllow) throws Exception {
SystemDatabase database = SystemDatabaseFactory.getInstance();
IpRestriction[] restrictions = database.getIpRestrictions();