forked from maxmind/GeoIP2-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebServiceProvider interface. Closes maxmind#359.
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.maxmind.geoip2; | ||
|
||
import com.maxmind.geoip2.exception.GeoIp2Exception; | ||
import com.maxmind.geoip2.model.CityResponse; | ||
import com.maxmind.geoip2.model.CountryResponse; | ||
import com.maxmind.geoip2.model.InsightsResponse; | ||
import java.io.IOException; | ||
import java.net.InetAddress; | ||
|
||
public interface WebServiceProvider extends GeoIp2Provider { | ||
/** | ||
* @return A Country model for the requesting IP address | ||
* @throws GeoIp2Exception if there is an error from the web service | ||
* @throws IOException if an IO error happens during the request | ||
*/ | ||
CountryResponse country() throws IOException, GeoIp2Exception; | ||
|
||
/** | ||
* @return A City model for the requesting IP address | ||
* @throws GeoIp2Exception if there is an error from the web service | ||
* @throws IOException if an IO error happens during the request | ||
*/ | ||
CityResponse city() throws IOException, GeoIp2Exception; | ||
|
||
/** | ||
* @return An Insights model for the requesting IP address | ||
* @throws GeoIp2Exception if there is an error from the web service | ||
* @throws IOException if an IO error happens during the request | ||
*/ | ||
InsightsResponse insights() throws IOException, GeoIp2Exception; | ||
|
||
/** | ||
* @param ipAddress IPv4 or IPv6 address to lookup. | ||
* @return An Insight model for the requested IP address. | ||
* @throws GeoIp2Exception if there is an error looking up the IP | ||
* @throws IOException if there is an IO error | ||
*/ | ||
InsightsResponse insights(InetAddress ipAddress) throws IOException, | ||
GeoIp2Exception; | ||
} |