public class GeoIPService
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
lastupdate
The date of the last update check.
|
protected com.maxmind.geoip.LookupService |
ls
The lookup service (if any).
|
protected static GeoIPService |
singleton
The singleton db object.
|
| Constructor and Description |
|---|
GeoIPService() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCountryCode(java.lang.String ip)
Fetch country code for an IP address or null, if not found.
|
static GeoIPService |
getGeoIPService()
Get the db instance.
|
java.lang.String |
getLocation(java.lang.String ip)
Fetch location name for an IP address.
|
java.lang.String |
getPosition(java.lang.String ip)
Get the position as latitude,longitude.
|
static void |
main(java.lang.String[] args) |
void |
updateDB()
Download / check for updates of the GeoIP database.
|
protected static final GeoIPService singleton
protected com.maxmind.geoip.LookupService ls
protected long lastupdate
public static GeoIPService getGeoIPService()
public java.lang.String getLocation(java.lang.String ip)
public java.lang.String getCountryCode(java.lang.String ip)
public java.lang.String getPosition(java.lang.String ip)
public void updateDB()
public static void main(java.lang.String[] args)
throws java.net.MalformedURLException
java.net.MalformedURLException