File tree Expand file tree Collapse file tree 5 files changed +31
-39
lines changed
http-client/src/main/java/io/avaje/http/client
http-client-gson-adapter/src/main/java/io/avaje/http/client/gson Expand file tree Collapse file tree 5 files changed +31
-39
lines changed Original file line number Diff line number Diff line change 21
21
*
22
22
* <pre>{@code
23
23
*
24
- * HttpClientContext .builder()
24
+ * HttpClient .builder()
25
25
* .baseUrl(baseUrl)
26
26
* .requestListener(new RequestLogger())
27
27
* //.bodyAdapter(new JacksonBodyAdapter(new ObjectMapper()))
Original file line number Diff line number Diff line change @@ -224,14 +224,6 @@ public interface HttpAsyncResponse {
224
224
*/
225
225
<E > CompletableFuture <HttpResponse <E >> handler (HttpResponse .BodyHandler <E > bodyHandler );
226
226
227
- /**
228
- * Deprecated - migrate to handler().
229
- */
230
- @ Deprecated
231
- default <E > CompletableFuture <HttpResponse <E >> withHandler (HttpResponse .BodyHandler <E > bodyHandler ) {
232
- return handler (bodyHandler );
233
- }
234
-
235
227
/**
236
228
* Process converting the response body to the given type.
237
229
* <p>
Original file line number Diff line number Diff line change @@ -118,14 +118,6 @@ public interface HttpCallResponse {
118
118
*/
119
119
<E > HttpCall <HttpResponse <E >> handler (HttpResponse .BodyHandler <E > bodyHandler );
120
120
121
- /**
122
- * Deprecated - migrate to handler().
123
- */
124
- @ Deprecated
125
- default <E > HttpCall <HttpResponse <E >> withHandler (HttpResponse .BodyHandler <E > bodyHandler ) {
126
- return handler (bodyHandler );
127
- }
128
-
129
121
/**
130
122
* A bean response to execute async or sync.
131
123
* <p>
Original file line number Diff line number Diff line change @@ -72,19 +72,6 @@ static Builder builder() {
72
72
*/
73
73
UrlBuilder url ();
74
74
75
- /**
76
- * Deprecated - migrate to {@link #bodyAdapter()}.
77
- * <p>
78
- * Return the body adapter used by the client context.
79
- * <p>
80
- * This is the body adapter used to convert request and response
81
- * bodies to java types. For example using Jackson with JSON payloads.
82
- */
83
- @ Deprecated
84
- default BodyAdapter converters () {
85
- return bodyAdapter ();
86
- }
87
-
88
75
/**
89
76
* Return the BodyAdapter that this client is using.
90
77
*/
@@ -355,8 +342,37 @@ interface State {
355
342
/**
356
343
* Statistic metrics collected to provide an overview of activity of this client.
357
344
*/
358
- interface Metrics extends HttpClientContext .Metrics {
345
+ interface Metrics {
346
+
347
+ /**
348
+ * Return the total number of responses.
349
+ */
350
+ long totalCount ();
351
+
352
+ /**
353
+ * Return the total number of error responses (status code >= 300).
354
+ */
355
+ long errorCount ();
359
356
357
+ /**
358
+ * Return the total response bytes (excludes streaming responses).
359
+ */
360
+ long responseBytes ();
361
+
362
+ /**
363
+ * Return the total response time in microseconds.
364
+ */
365
+ long totalMicros ();
366
+
367
+ /**
368
+ * Return the max response time in microseconds (since the last reset).
369
+ */
370
+ long maxMicros ();
371
+
372
+ /**
373
+ * Return the average response time in microseconds.
374
+ */
375
+ long avgMicros ();
360
376
}
361
377
362
378
/** Components register Generated Client interface Providers */
Original file line number Diff line number Diff line change @@ -307,12 +307,4 @@ public interface HttpClientResponse {
307
307
*/
308
308
<T > HttpResponse <T > handler (HttpResponse .BodyHandler <T > responseHandler );
309
309
310
- /**
311
- * Deprecated - migrate to handler().
312
- */
313
- @ Deprecated
314
- default <T > HttpResponse <T > withHandler (HttpResponse .BodyHandler <T > responseHandler ) {
315
- return handler (responseHandler );
316
- }
317
-
318
310
}
You can’t perform that action at this time.
0 commit comments