Package org.lionsoul.ip2region.service
Class Ip2Region
java.lang.Object
org.lionsoul.ip2region.service.Ip2Region
ip2region searcher manager service to provider:
1. Unified query interface for IPv4 and IPv6 address.
2. Concurrency search support.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Ip2Region
protected Ip2Region(File v4XdbFile, File v6XdbFile) throws IOException, XdbException, InvalidConfigException init the ip2reigon with two xdb file path and default cachePolicy vIndex. set it to null to disabled the search for specified version- Parameters:
v4XdbFile-v6XdbFile-- Throws:
XdbExceptionIOExceptionInvalidConfigException
-
Ip2Region
init the ip2region with specified config. set it to null for disabled the search for specified version- Parameters:
v4Config-v6Config-- Throws:
IOException
-
-
Method Details
-
create
- Throws:
IOException
-
create
public static final Ip2Region create(String v4XdbPath, String v6XdbPath) throws IOException, XdbException, InvalidConfigException -
create
public static final Ip2Region create(File v4XdbFile, File v6XdbFile) throws IOException, XdbException, InvalidConfigException -
init
- Throws:
IOException
-
search
public String search(String ipString) throws InetAddressException, IOException, InterruptedException -
search
-
v4Search
protected String v4Search(byte[] ipBytes) throws IOException, InetAddressException, InterruptedException -
v6Search
protected String v6Search(byte[] ipBytes) throws IOException, InetAddressException, InterruptedException -
close
- Throws:
InterruptedException
-
close
- Throws:
InterruptedException
-