Package org.dspace.statistics.util
Class IPTable
- java.lang.Object
-
- org.dspace.statistics.util.IPTable
-
public class IPTable extends Object
A Spare v4 IPTable implementation that uses nested HashMaps to optimize IP address matching over ranges of IP addresses.- Author:
- mdiggory at atmire.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIPTable.IPFormatExceptionException Class to deal with IPFormat errors.
-
Constructor Summary
Constructors Constructor Description IPTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String ip)Can be full v4 IP, subnet or range stringbooleancontains(String ip)Check whether a given address is contained in this netblock.Set<String>toSet()Convert to a Set.
-
-
-
Method Detail
-
add
public void add(String ip) throws IPTable.IPFormatException
Can be full v4 IP, subnet or range string- Parameters:
ip- IP address(es)- Throws:
IPTable.IPFormatException- Exception Class to deal with IPFormat errors.
-
contains
public boolean contains(String ip) throws IPTable.IPFormatException
Check whether a given address is contained in this netblock.- Parameters:
ip- the address to be tested- Returns:
- true if
ipis within this table's limits - Throws:
IPTable.IPFormatException- Exception Class to deal with IPFormat errors.
-
-