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 package org.apache.hc.client5.testing.extension.async;
29
30 import java.util.Collection;
31
32 import org.apache.hc.client5.http.AuthenticationStrategy;
33 import org.apache.hc.client5.http.HttpRequestRetryStrategy;
34 import org.apache.hc.client5.http.UserTokenHandler;
35 import org.apache.hc.client5.http.auth.AuthSchemeFactory;
36 import org.apache.hc.client5.http.config.TlsConfig;
37 import org.apache.hc.core5.http.Header;
38 import org.apache.hc.core5.http.HttpRequestInterceptor;
39 import org.apache.hc.core5.http.HttpResponseInterceptor;
40 import org.apache.hc.core5.http.config.Http1Config;
41 import org.apache.hc.core5.http.config.Lookup;
42 import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
43 import org.apache.hc.core5.http2.config.H2Config;
44 import org.apache.hc.core5.util.Timeout;
45
46 public interface TestAsyncClientBuilder {
47
48 ClientProtocolLevel getProtocolLevel();
49
50 TestAsyncClientBuilder setTimeout(Timeout soTimeout);
51
52 default TestAsyncClientBuilder addResponseInterceptorFirst(final HttpResponseInterceptor interceptor) {
53 return this;
54 }
55
56 default TestAsyncClientBuilder addResponseInterceptorLast(HttpResponseInterceptor interceptor) {
57 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
58 }
59
60 default TestAsyncClientBuilder addRequestInterceptorFirst(HttpRequestInterceptor interceptor) {
61 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
62 }
63
64 default TestAsyncClientBuilder addRequestInterceptorLast(HttpRequestInterceptor interceptor) {
65 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
66 }
67
68 default TestAsyncClientBuilder setTlsStrategy(TlsStrategy tlsStrategy) {
69 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
70 }
71
72 default TestAsyncClientBuilder setDefaultTlsConfig(TlsConfig tlsConfig) {
73 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
74 }
75
76 default TestAsyncClientBuilder setHttp1Config(Http1Config http1Config) {
77 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
78 }
79
80 default TestAsyncClientBuilder setH2Config(H2Config http1Config) {
81 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
82 }
83
84 default TestAsyncClientBuilder setUserTokenHandler(UserTokenHandler userTokenHandler) {
85 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
86 }
87
88 default TestAsyncClientBuilder setDefaultHeaders(Collection<? extends Header> defaultHeaders) {
89 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
90 }
91
92 default TestAsyncClientBuilder setRetryStrategy(HttpRequestRetryStrategy retryStrategy) {
93 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
94 }
95
96 default TestAsyncClientBuilder setTargetAuthenticationStrategy(AuthenticationStrategy targetAuthStrategy) {
97 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
98 }
99
100 default TestAsyncClientBuilder setDefaultAuthSchemeRegistry(Lookup<AuthSchemeFactory> authSchemeRegistry) {
101 throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
102 }
103
104 TestAsyncClient build() throws Exception;
105
106 }