59
59
import org .apache .hc .core5 .http .nio .support .DefaultAsyncResponseExchangeHandlerFactory ;
60
60
import org .apache .hc .core5 .http .nio .support .TerminalAsyncServerFilter ;
61
61
import org .apache .hc .core5 .http .protocol .HttpProcessor ;
62
+ import org .apache .hc .core5 .http .protocol .LookupRegistry ;
62
63
import org .apache .hc .core5 .http .protocol .UriPatternType ;
63
64
import org .apache .hc .core5 .net .InetAddressUtils ;
64
65
import org .apache .hc .core5 .net .URIAuthority ;
@@ -99,13 +100,19 @@ private AsyncServerBootstrap() {
99
100
this .filters = new ArrayList <>();
100
101
}
101
102
103
+ /**
104
+ * Creates a new AsyncServerBootstrap instance.
105
+ *
106
+ * @return a new AsyncServerBootstrap instance.
107
+ */
102
108
public static AsyncServerBootstrap bootstrap () {
103
109
return new AsyncServerBootstrap ();
104
110
}
105
111
106
112
/**
107
113
* Sets canonical name (fully qualified domain name) of the server.
108
114
*
115
+ * @param canonicalHostName canonical name (fully qualified domain name) of the server.
109
116
* @return this instance.
110
117
*/
111
118
public final AsyncServerBootstrap setCanonicalHostName (final String canonicalHostName ) {
@@ -116,6 +123,7 @@ public final AsyncServerBootstrap setCanonicalHostName(final String canonicalHos
116
123
/**
117
124
* Sets I/O reactor configuration.
118
125
*
126
+ * @param ioReactorConfig I/O reactor configuration.
119
127
* @return this instance.
120
128
*/
121
129
public final AsyncServerBootstrap setIOReactorConfig (final IOReactorConfig ioReactorConfig ) {
@@ -126,6 +134,7 @@ public final AsyncServerBootstrap setIOReactorConfig(final IOReactorConfig ioRea
126
134
/**
127
135
* Sets HTTP/1.1 protocol parameters.
128
136
*
137
+ * @param http1Config HTTP/1.1 protocol parameters.
129
138
* @return this instance.
130
139
*/
131
140
public final AsyncServerBootstrap setHttp1Config (final Http1Config http1Config ) {
@@ -134,8 +143,9 @@ public final AsyncServerBootstrap setHttp1Config(final Http1Config http1Config)
134
143
}
135
144
136
145
/**
137
- * Sets connection configuration.
146
+ * Sets char coding configuration.
138
147
*
148
+ * @param charCodingConfig char coding configuration.
139
149
* @return this instance.
140
150
*/
141
151
public final AsyncServerBootstrap setCharCodingConfig (final CharCodingConfig charCodingConfig ) {
@@ -144,8 +154,9 @@ public final AsyncServerBootstrap setCharCodingConfig(final CharCodingConfig cha
144
154
}
145
155
146
156
/**
147
- * Sets {@link org.apache.hc.core5.http.protocol. HttpProcessor} instance.
157
+ * Sets {@link HttpProcessor} instance.
148
158
*
159
+ * @param httpProcessor {@link HttpProcessor} instance.
149
160
* @return this instance.
150
161
*/
151
162
public final AsyncServerBootstrap setHttpProcessor (final HttpProcessor httpProcessor ) {
@@ -154,8 +165,9 @@ public final AsyncServerBootstrap setHttpProcessor(final HttpProcessor httpProce
154
165
}
155
166
156
167
/**
157
- * Sets {@link org.apache.hc.core5.http. ConnectionReuseStrategy} instance.
168
+ * Sets {@link ConnectionReuseStrategy} instance.
158
169
*
170
+ * @param connStrategy {@link ConnectionReuseStrategy} instance.
159
171
* @return this instance.
160
172
*/
161
173
public final AsyncServerBootstrap setConnectionReuseStrategy (final ConnectionReuseStrategy connStrategy ) {
@@ -166,6 +178,7 @@ public final AsyncServerBootstrap setConnectionReuseStrategy(final ConnectionReu
166
178
/**
167
179
* Sets {@link TlsStrategy} instance.
168
180
*
181
+ * @param tlsStrategy {@link TlsStrategy} instance.
169
182
* @return this instance.
170
183
*/
171
184
public final AsyncServerBootstrap setTlsStrategy (final TlsStrategy tlsStrategy ) {
@@ -176,6 +189,7 @@ public final AsyncServerBootstrap setTlsStrategy(final TlsStrategy tlsStrategy)
176
189
/**
177
190
* Sets TLS handshake {@link Timeout}.
178
191
*
192
+ * @param handshakeTimeout TLS handshake {@link Timeout}.
179
193
* @return this instance.
180
194
*/
181
195
public final AsyncServerBootstrap setTlsHandshakeTimeout (final Timeout handshakeTimeout ) {
@@ -186,6 +200,7 @@ public final AsyncServerBootstrap setTlsHandshakeTimeout(final Timeout handshake
186
200
/**
187
201
* Sets {@link IOSession} {@link Decorator} instance.
188
202
*
203
+ * @param ioSessionDecorator {@link IOSession} {@link Decorator} instance.
189
204
* @return this instance.
190
205
*/
191
206
public final AsyncServerBootstrap setIOSessionDecorator (final Decorator <IOSession > ioSessionDecorator ) {
@@ -196,6 +211,7 @@ public final AsyncServerBootstrap setIOSessionDecorator(final Decorator<IOSessio
196
211
/**
197
212
* Sets {@link Exception} {@link Callback} instance.
198
213
*
214
+ * @param exceptionCallback {@link Exception} {@link Callback} instance.
199
215
* @return this instance.
200
216
*/
201
217
public final AsyncServerBootstrap setExceptionCallback (final Callback <Exception > exceptionCallback ) {
@@ -206,6 +222,7 @@ public final AsyncServerBootstrap setExceptionCallback(final Callback<Exception>
206
222
/**
207
223
* Sets {@link IOSessionListener} instance.
208
224
*
225
+ * @param sessionListener {@link IOSessionListener} instance.
209
226
* @return this instance.
210
227
*/
211
228
public final AsyncServerBootstrap setIOSessionListener (final IOSessionListener sessionListener ) {
@@ -214,18 +231,22 @@ public final AsyncServerBootstrap setIOSessionListener(final IOSessionListener s
214
231
}
215
232
216
233
/**
234
+ * Sets a LookupRegistry for Suppliers of AsyncServerExchangeHandler.
235
+ *
236
+ * @param lookupRegistry LookupRegistry for Suppliers of AsyncServerExchangeHandler.
217
237
* @return this instance.
218
238
* @deprecated Use {@link RequestRouter}.
219
239
*/
220
240
@ Deprecated
221
- public final AsyncServerBootstrap setLookupRegistry (final org . apache . hc . core5 . http . protocol . LookupRegistry <Supplier <AsyncServerExchangeHandler >> lookupRegistry ) {
241
+ public final AsyncServerBootstrap setLookupRegistry (final LookupRegistry <Supplier <AsyncServerExchangeHandler >> lookupRegistry ) {
222
242
this .lookupRegistry = lookupRegistry ;
223
243
return this ;
224
244
}
225
245
226
246
/**
227
247
* Sets {@link HttpRequestMapper} instance.
228
248
*
249
+ * @param requestRouter {@link HttpRequestMapper} instance.
229
250
* @return this instance.
230
251
* @see org.apache.hc.core5.http.impl.routing.RequestRouter
231
252
* @since 5.3
@@ -238,6 +259,7 @@ public final AsyncServerBootstrap setRequestRouter(final HttpRequestMapper<Suppl
238
259
/**
239
260
* Sets {@link Http1StreamListener} instance.
240
261
*
262
+ * @param streamListener {@link Http1StreamListener} instance.
241
263
* @return this instance.
242
264
* @since 5.0
243
265
*/
@@ -250,8 +272,8 @@ public final AsyncServerBootstrap setStreamListener(final Http1StreamListener st
250
272
* Registers the given {@link AsyncServerExchangeHandler} {@link Supplier} as a default handler for URIs
251
273
* matching the given pattern.
252
274
*
253
- * @param uriPattern the pattern to register the handler for.
254
- * @param supplier the handler supplier.
275
+ * @param uriPattern the non-null pattern to register the handler for.
276
+ * @param supplier the non-null handler supplier.
255
277
* @return this instance.
256
278
*/
257
279
public final AsyncServerBootstrap register (final String uriPattern , final Supplier <AsyncServerExchangeHandler > supplier ) {
@@ -263,11 +285,11 @@ public final AsyncServerBootstrap register(final String uriPattern, final Suppli
263
285
264
286
/**
265
287
* Registers the given {@link AsyncServerExchangeHandler} {@link Supplier} as a handler for URIs
266
- * matching the given host and the pattern.
288
+ * matching the given host and pattern.
267
289
*
268
- * @param hostname the host name
269
- * @param uriPattern the pattern to register the handler for.
270
- * @param supplier the handler supplier.
290
+ * @param hostname the non-null host name.
291
+ * @param uriPattern the non-null pattern to register the handler for.
292
+ * @param supplier the non-null handler supplier.
271
293
* @return this instance.
272
294
* @since 5.3
273
295
*/
@@ -280,9 +302,14 @@ public final AsyncServerBootstrap register(final String hostname, final String u
280
302
}
281
303
282
304
/**
283
- * @deprecated use {@link #register(String, String, Supplier)}.
305
+ * Registers the given {@link AsyncServerExchangeHandler} {@link Supplier} as a handler for URIs
306
+ * matching the given host and pattern.
284
307
*
308
+ * @param hostname the host name.
309
+ * @param uriPattern the pattern to register the handler for.
310
+ * @param supplier the handler supplier.
285
311
* @return this instance.
312
+ * @deprecated use {@link #register(String, String, Supplier)}.
286
313
*/
287
314
@ Deprecated
288
315
public final AsyncServerBootstrap registerVirtual (final String hostname , final String uriPattern , final Supplier <AsyncServerExchangeHandler > supplier ) {
@@ -307,8 +334,9 @@ public final <T> AsyncServerBootstrap register(
307
334
308
335
/**
309
336
* Registers the given {@link AsyncServerRequestHandler} as a handler for URIs
310
- * matching the given host and the pattern.
337
+ * matching the given host and pattern.
311
338
*
339
+ * @param <T> the request type.
312
340
* @param hostname the host name
313
341
* @param uriPattern the pattern to register the handler for.
314
342
* @param requestHandler the handler.
@@ -321,6 +349,7 @@ public final <T> AsyncServerBootstrap register(final String hostname, final Stri
321
349
}
322
350
323
351
/**
352
+ * @param <T> the request type.
324
353
* @return this instance.
325
354
* @deprecated Use {@link #register(String, String, AsyncServerRequestHandler)}.
326
355
*/
0 commit comments