Class IPFilter
- java.lang.Object
-
- org.objectweb.joram.tools.rest.admin.IPFilter
-
public final class IPFilter extends Object
Class allowing to check if an IP address is in a filter list (white or black list). Be careful the current implementation is IPv4 dependent and any IPv6 address is refused.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classIPFilter.Authorized
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate ArrayList<IPFilter.Authorized>ipAllowedsstatic Loggerlogger
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckIpAllowed(String addr)Check if the addr is authorized (all local address is authorized).
-
-
-
Field Detail
-
logger
public static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
ipAlloweds
private ArrayList<IPFilter.Authorized> ipAlloweds
-
-
Constructor Detail
-
IPFilter
public IPFilter(String IPAllowedList)
Creates list of IP allowed list from declaration.
-
-
Method Detail
-
checkIpAllowed
public boolean checkIpAllowed(String addr)
Check if the addr is authorized (all local address is authorized).- Parameters:
addr- The ip address to check- Returns:
- true if authorized
- Throws:
UnknownHostExceptionSocketException
-
-