/
GeoIp2Provider.java
68 lines (61 loc) · 2.24 KB
/
GeoIp2Provider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.maxmind.geoip2;
import java.io.IOException;
import java.net.InetAddress;
import com.maxmind.geoip2.exception.GeoIp2Exception;
import com.maxmind.geoip2.model.CityIspOrgResponse;
import com.maxmind.geoip2.model.CityResponse;
import com.maxmind.geoip2.model.CountryResponse;
import com.maxmind.geoip2.model.OmniResponse;
@SuppressWarnings("deprecation")
public interface GeoIp2Provider {
/**
* @param ipAddress
* IPv4 or IPv6 address to lookup.
* @return A Country 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
*/
public CountryResponse country(InetAddress ipAddress) throws IOException,
GeoIp2Exception;
/**
* @param ipAddress
* IPv4 or IPv6 address to lookup.
* @return A City 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
*/
public CityResponse city(InetAddress ipAddress) throws IOException,
GeoIp2Exception;
/**
* @param ipAddress
* IPv4 or IPv6 address to lookup.
* @return A CityIspOrg 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
*
* @deprecated As of 0.8.0, this has been replaced by {@link #city(InetAddress)}.
*/
@Deprecated
public CityIspOrgResponse cityIspOrg(InetAddress ipAddress)
throws IOException, GeoIp2Exception;
/**
* @param ipAddress
* IPv4 or IPv6 address to lookup.
* @return An Omni 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
*
* @deprecated As of 0.8.0, use {@link WebServiceClient#insights(InetAddress)} instead.
*/
@Deprecated
public OmniResponse omni(InetAddress ipAddress) throws IOException,
GeoIp2Exception;
}