1616import com .maxmind .geoip2 .model .CityResponse ;
1717import com .maxmind .geoip2 .model .CountryResponse ;
1818import com .maxmind .geoip2 .model .InsightsResponse ;
19- import java .io .Closeable ;
2019import java .io .IOException ;
2120import java .io .InputStream ;
2221import java .net .InetAddress ;
2322import java .net .InetSocketAddress ;
24- import java .net .Proxy ;
2523import java .net .ProxySelector ;
2624import java .net .URI ;
2725import java .net .URISyntaxException ;
107105 * throws a {@link GeoIp2Exception}.
108106 * </p>
109107 */
110- public class WebServiceClient implements WebServiceProvider , Closeable {
108+ public class WebServiceClient implements WebServiceProvider {
111109 private final String host ;
112110 private final List <String > locales ;
113111 private final String authHeader ;
@@ -192,17 +190,6 @@ public Builder(int accountId, String licenseKey) {
192190 this .licenseKey = licenseKey ;
193191 }
194192
195- /**
196- * @param val Timeout in milliseconds to establish a connection to the
197- * web service. The default is 3000 (3 seconds).
198- * @return Builder object
199- * @deprecated Use connectTimeout(Duration) instead
200- */
201- @ Deprecated
202- public Builder connectTimeout (int val ) {
203- this .connectTimeout = Duration .ofMillis (val );
204- return this ;
205- }
206193
207194 /**
208195 * @param val Timeout duration to establish a connection to the
@@ -258,18 +245,6 @@ public Builder locales(List<String> val) {
258245 return this ;
259246 }
260247
261- /**
262- * @param val readTimeout in milliseconds to read data from an
263- * established connection to the web service. The default is
264- * 20000 (20 seconds).
265- * @return Builder object
266- * @deprecated Use requestTimeout(Duration) instead
267- */
268- @ Deprecated
269- public Builder readTimeout (int val ) {
270- this .requestTimeout = Duration .ofMillis (val );
271- return this ;
272- }
273248
274249 /**
275250 * @param val Request timeout duration. The default is 20 seconds.
@@ -280,18 +255,6 @@ public Builder requestTimeout(Duration val) {
280255 return this ;
281256 }
282257
283- /**
284- * @param val the proxy to use when making this request.
285- * @return Builder object
286- * @deprecated Use proxy(ProxySelector)
287- */
288- @ Deprecated
289- public Builder proxy (Proxy val ) {
290- if (val != null && val != Proxy .NO_PROXY ) {
291- this .proxy = ProxySelector .of ((InetSocketAddress ) val .address ());
292- }
293- return this ;
294- }
295258
296259 /**
297260 * @param val the proxy to use when making this request.
@@ -538,13 +501,6 @@ private void exhaustBody(HttpResponse<InputStream> response) throws HttpExceptio
538501 }
539502 }
540503
541- /**
542- * @deprecated Closing is no longer necessary with java.net.http.HttpClient.
543- */
544- @ Deprecated
545- @ Override
546- public void close () throws IOException {
547- }
548504
549505 @ Override
550506 public String toString () {
0 commit comments