public class GeoIP extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static String |
COUNTRY_FILE_DEFAULT |
static String |
GEOIP_DIR_DEFAULT |
(package private) static String |
GEOIP_FILE_DEFAULT |
static String |
PROP_DEBIAN_GEOIP |
static String |
PROP_DEBIAN_GEOIPV6 |
static String |
PROP_GEOIP_DIR |
(package private) static String |
PROP_GEOIP_ENABLED |
static String |
PROP_IP_COUNTRY |
Constructor and Description |
---|
GeoIP(I2PAppContext context) |
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] ip)
Add to the list needing lookup
|
void |
add(String ip)
Add to the list needing lookup
|
void |
blockingLookup()
Blocking lookup of all pending IPs.
|
String |
fullName(String code)
Get the country for a country code
|
String |
get(byte[] ip)
Get the country for an IP from the cache.
|
String |
get(String ip)
Get the country for an IP from the cache.
|
void |
shutdown() |
static final String PROP_GEOIP_ENABLED
public static final String PROP_GEOIP_DIR
public static final String GEOIP_DIR_DEFAULT
static final String GEOIP_FILE_DEFAULT
static final String COUNTRY_FILE_DEFAULT
public static final String PROP_IP_COUNTRY
public static final String PROP_DEBIAN_GEOIP
public static final String PROP_DEBIAN_GEOIPV6
public GeoIP(I2PAppContext context)
context
- RouterContext in production, I2PAppContext for testing onlypublic void shutdown()
public void blockingLookup()
public void add(String ip)
ip
- IPv4 or IPv6public void add(byte[] ip)
ip
- IPv4 or IPv6public String get(String ip)
ip
- IPv4 or IPv6public String get(byte[] ip)
ip
- IPv4 or IPv6