@@ -33,14 +33,14 @@ To do this, add the dependency to your pom.xml:
3333 <dependency >
3434 <groupId >com.maxmind.geoip2</groupId >
3535 <artifactId >geoip2</artifactId >
36- <version >0.2 .0</version >
36+ <version >0.3 .0</version >
3737 </dependency >
3838```
3939
4040## Usage ##
4141
42- To use this API, you must create a new `` com.maxmind.geoip2.webservice.Client ` `
43- object with your `` userId `` and `` licenseKey ` ` , then you call the method
42+ To use this API, you must create a new ` com.maxmind.geoip2.WebServiceClient `
43+ object with your ` userId ` and ` licenseKey ` , then you call the method
4444corresponding to a specific end point, passing it the IP address you want to
4545look up.
4646
@@ -54,14 +54,14 @@ See the API documentation for more details.
5454
5555``` java
5656
57- Client client = new Client .Builder (42 , " abcfe12345" ). build();
57+ WebServiceClient client = new WebServiceClient .Builder (42 , " abcfe12345" ). build();
5858
59- OmniLookup omni = client. omni(InetAddress . getByName(" 24.24.24.24" ));
59+ Omni omni = client. omni(InetAddress . getByName(" 24.24.24.24" ));
6060
61- City city = omni. getCity();
61+ CityRecord city = omni. getCity();
6262System . out. println(city. getName());
6363
64- Postal postal = omni. getPostal();
64+ PostalRecord postal = omni. getPostal();
6565System . out. println(postal. getCode());
6666
6767```
@@ -71,18 +71,19 @@ System.out.println(postal.getCode());
7171For details on the possible errors returned by the web service itself, [ see
7272the GeoIP2 web service documentation] ( http://dev.maxmind.com/geoip2/geoip/web-services ) .
7373
74- If the web service returns an explicit error document, this is thrown as a
75- ``` WebServiceException ``` . If some other sort of transport error occurs,
76- this is thrown as a ``` HttpException ``` . The difference is that the web
77- service error includes an error message and error code delivered by the
78- web service. The latter is thrown when some sort of unanticipated error
79- occurs, such as the web service returning a 500 or an invalid error document.
74+ If the web service returns an explicit error document, this is thrown as an
75+ ` AddressNotFoundException ` , an ` AuthenticationException ` , an
76+ ` InvalidRequestException ` , or an `OutOfQueriesException.
8077
81- If the web service returns any status code besides 200, 4xx, or 5xx, this also
82- becomes a ``` HttpException ``` .
78+ If some sort of transport error occurs, an ` HttpException ` is thrown. This
79+ is thrown when some sort of unanticipated error occurs, such as the web
80+ service returning a 500 or an invalid error document. If the web service
81+ request returns any status code besides 200, 4xx, or 5xx, this also becomes
82+ an ` HttpException ` .
8383
8484Finally, if the web service returns a 200 but the body is invalid, the client
85- throws a ``` GeoIP2Exception ``` .
85+ throws a ` GeoIp2Exception ` . This exception also is the parent exception to
86+ the above exceptions.
8687
8788## What data is returned? ##
8889
@@ -109,10 +110,10 @@ check to see if the attribute is set.
109110[ GeoNames] ( http://www.geonames.org/ ) offers web services and downloadable
110111databases with data on geographical features around the world, including
111112populated places. They offer both free and paid premium data. Each
112- feature is uniquely identified by a ``` geonameId `` ` , which is an integer.
113+ feature is uniquely identified by a ` geonameId ` , which is an integer.
113114
114115Many of the records returned by the GeoIP2 web services and databases
115- include a ``` getGeonameId() `` ` method. This is the ID of a geographical
116+ include a ` getGeonameId() ` method. This is the ID of a geographical
116117feature (city, region, country, etc.) in the GeoNames database.
117118
118119Some of the data that MaxMind provides is also sourced from GeoNames. We
0 commit comments