java.lang.Object
com.maxmind.geoip.DatabaseInfo
Encapsulates metadata about the GeoIP database. The database has a date, is a premium or standard version, and is one of the following types:
- Country edition -- this is the most common version of the database. It includes the name of the country and it's ISO country code given an IP address.
- Region edition -- includes the country information as well as what U.S. state or Canadian province the IP address is from if the IP address is from the U.S. or Canada.
- City edition -- includes country, region, city, postal code, latitude, and longitude information.
- Org edition -- includes netblock owner.
- ISP edition -- ISP information.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAS number editionstatic final intAS number edition IPv6static final intCity edition revision 0static final intCity edition revision 0 IPv6static final intCity edition revision 1static final intCity edition revision 1 IPv6static final intCountry editionstatic final intCountry edition IPv6static final intDomain editionstatic final intDomain edition IPv6static final intISP editionstatic final intISP edition IPv6static final intNet speed editionstatic final intNet speed edition revision 1static final intNet speed edition revision 1 IPv6static final intOrganization editionstatic final intOrganization edition IPv6static final intProxy editionstatic final intRegion edition revision 0static final intRegion edition revision 1Constructor Summary
ConstructorsConstructorDescriptionDatabaseInfo(String info) Creates a new DatabaseInfo object given the database info String.Method Summary
All MethodsModifier and TypeMethodDescriptiongetDate()Returns the date of the database.intgetType()Returns the edition code for the loaded database, one of the COUNTRY_EDITION, REGION_EDITION_* or CITY_EDITION_* constants declared in this class.booleanReturns true if the database is the premium version.toString()
Field Details
COUNTRY_EDITION
REGION_EDITION_REV0
REGION_EDITION_REV1
CITY_EDITION_REV0
CITY_EDITION_REV1
ORG_EDITION
ISP_EDITION
PROXY_EDITION
ASNUM_EDITION
NETSPEED_EDITION
DOMAIN_EDITION
COUNTRY_EDITION_V6
ASNUM_EDITION_V6
ISP_EDITION_V6
ORG_EDITION_V6
DOMAIN_EDITION_V6
CITY_EDITION_REV1_V6
public static final int CITY_EDITION_REV1_V6City edition revision 1 IPv6- See Also:
CITY_EDITION_REV0_V6
public static final int CITY_EDITION_REV0_V6City edition revision 0 IPv6- See Also:
NETSPEED_EDITION_REV1
public static final int NETSPEED_EDITION_REV1Net speed edition revision 1- See Also:
NETSPEED_EDITION_REV1_V6
public static final int NETSPEED_EDITION_REV1_V6Net speed edition revision 1 IPv6- See Also:
Constructor Details
DatabaseInfo
Creates a new DatabaseInfo object given the database info String.- Parameters:
info- raw database info string, holding the type code, build date and FREE marker
Method Details
getType
public int getType()Returns the edition code for the loaded database, one of the COUNTRY_EDITION, REGION_EDITION_* or CITY_EDITION_* constants declared in this class. An empty or missing info string reads as COUNTRY_EDITION.- Returns:
- the database type code
isPremium
public boolean isPremium()Returns true if the database is the premium version.- Returns:
- true if the premium version of the database.
getDate
toString