本文整理汇总了Java中com.maxmind.geoip2.model.CountryResponse类的典型用法代码示例。如果您正苦于以下问题:Java CountryResponse类的具体用法?Java CountryResponse怎么用?Java CountryResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CountryResponse类属于com.maxmind.geoip2.model包,在下文中一共展示了CountryResponse类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDocFromCountryService
import com.maxmind.geoip2.model.CountryResponse; //导入依赖的package包/类
@SuppressWarnings("unused")
public static NutchDocument createDocFromCountryService(String serverIp,
NutchDocument doc, WebServiceClient client) throws UnknownHostException,
IOException, GeoIp2Exception {
CountryResponse response = client.country(InetAddress.getByName(serverIp));
return doc;
}
示例2: country
import com.maxmind.geoip2.model.CountryResponse; //导入依赖的package包/类
@Override
public CountryResponse country(InetAddress ipAddress) throws IOException,
GeoIp2Exception {
return this.responseFor("country", ipAddress, CountryResponse.class);
}
示例3: country
import com.maxmind.geoip2.model.CountryResponse; //导入依赖的package包/类
/**
* @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
*/
CountryResponse country(InetAddress ipAddress) throws IOException,
GeoIp2Exception;