java.lang.Object
com.maxmind.geoip2.WebServiceClient.Builder
- Enclosing class:
- WebServiceClient
Builder
creates instances of WebServiceClient
from values set by the methods.
This example shows how to create a WebServiceClient
object
with the Builder
:
WebServiceClient client = new WebServiceClient.Builder(12,"licensekey")
.host("geoip.maxmind.com").build();
Only the values set in the Builder
constructor are required.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
connectTimeout
(int val) Deprecated.Use connectTimeout(Duration) insteadconnectTimeout
(Duration val) Disables HTTPS to connect to a test server or proxy.port
(int val) Deprecated.Use proxy(ProxySelector)proxy
(ProxySelector val) readTimeout
(int val) Deprecated.Use requestTimeout(Duration) insteadrequestTimeout
(Duration val)
-
Constructor Details
-
Builder
- Parameters:
accountId
- Your MaxMind account ID.licenseKey
- Your MaxMind license key.
-
-
Method Details
-
connectTimeout
Deprecated.Use connectTimeout(Duration) instead- Parameters:
val
- Timeout in milliseconds to establish a connection to the web service. The default is 3000 (3 seconds).- Returns:
- Builder object
-
connectTimeout
- Parameters:
val
- Timeout duration to establish a connection to the web service. The default is 3 seconds.- Returns:
- Builder object
-
disableHttps
Disables HTTPS to connect to a test server or proxy. The minFraud ScoreResponse and InsightsResponse web services require HTTPS.- Returns:
- Builder object
-
host
- Parameters:
val
- The host to use. Set this togeolite.info
to use the GeoLite2 web services instead of the GeoIP2 web services. Set this tosandbox.maxmind.com
to use the Sandbox GeoIP2 web services instead of the production GeoIP2 web services. The sandbox allows you to experiment with the API without affecting your production data.- Returns:
- Builder object
-
port
- Parameters:
val
- The port to use.- Returns:
- Builder object
-
locales
- Parameters:
val
- List of locale codes to use in name property from most preferred to least preferred.- Returns:
- Builder object
-
readTimeout
Deprecated.Use requestTimeout(Duration) instead- Parameters:
val
- readTimeout in milliseconds to read data from an established connection to the web service. The default is 20000 (20 seconds).- Returns:
- Builder object
-
requestTimeout
- Parameters:
val
- Request timeout duration. The default is 20 seconds.- Returns:
- Builder object
-
proxy
Deprecated.Use proxy(ProxySelector)- Parameters:
val
- the proxy to use when making this request.- Returns:
- Builder object
-
proxy
- Parameters:
val
- the proxy to use when making this request.- Returns:
- Builder object
-
build
- Returns:
- an instance of
WebServiceClient
created from the fields set on this builder.
-