Class HttpJerseyRouterBuilder
java.lang.Object
io.servicetalk.http.router.jersey.HttpJerseyRouterBuilder
Builds an
StreamingHttpService
which routes requests to JAX-RS annotated classes,
using Jersey as the routing engine, eg.
final StreamingHttpService router = new HttpJerseyRouterBuilder()
.buildStreaming(application);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseUriFunction
(BiFunction<ConnectionContext, HttpRequestMetaData, String> baseUriFunction) Set the function used to compute the base URI for the incoming HTTP request.Build theHttpService
for the specified JAX-RSApplication
class.build
(javax.ws.rs.core.Application application) Build theHttpService
for the specified JAX-RSApplication
.buildBlocking
(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theBlockingHttpService
for the specified JAX-RSApplication
class.buildBlocking
(javax.ws.rs.core.Application application) Build theBlockingHttpService
for the specified JAX-RSApplication
.buildBlockingStreaming
(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
class.buildBlockingStreaming
(javax.ws.rs.core.Application application) Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
.buildStreaming
(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theStreamingHttpService
for the specified JAX-RSApplication
class.buildStreaming
(javax.ws.rs.core.Application application) Build theStreamingHttpService
for the specified JAX-RSApplication
.publisherInputStreamQueueCapacity
(int publisherInputStreamQueueCapacity) Set the hint for the capacity of the intermediary queue that stores items when adaptingPublisher
s intoInputStream
s.routeExecutionStrategyFactory
(RouteExecutionStrategyFactory<HttpExecutionStrategy> strategyFactory) Set aRouteExecutionStrategyFactory<HttpExecutionStrategy>
for creatingHttpExecutionStrategy
instances that can be used for offloading the handling of request to resource methods, as specified viaRouteExecutionStrategy
annotations.
-
Constructor Details
-
HttpJerseyRouterBuilder
public HttpJerseyRouterBuilder()
-
-
Method Details
-
publisherInputStreamQueueCapacity
public HttpJerseyRouterBuilder publisherInputStreamQueueCapacity(int publisherInputStreamQueueCapacity) Set the hint for the capacity of the intermediary queue that stores items when adaptingPublisher
s intoInputStream
s.- Parameters:
publisherInputStreamQueueCapacity
- the capacity hint.- Returns:
- this
-
baseUriFunction
public HttpJerseyRouterBuilder baseUriFunction(BiFunction<ConnectionContext, HttpRequestMetaData, String> baseUriFunction) Set the function used to compute the base URI for the incoming HTTP request. The computed base URI must have/
as path, and no query nor fragment.- Parameters:
baseUriFunction
- aBiFunction
that computes a base URIString
for the providedConnectionContext
andHttpRequestMetaData
.- Returns:
- this
- See Also:
-
routeExecutionStrategyFactory
public HttpJerseyRouterBuilder routeExecutionStrategyFactory(RouteExecutionStrategyFactory<HttpExecutionStrategy> strategyFactory) Set aRouteExecutionStrategyFactory<HttpExecutionStrategy>
for creatingHttpExecutionStrategy
instances that can be used for offloading the handling of request to resource methods, as specified viaRouteExecutionStrategy
annotations.- Parameters:
strategyFactory
- aRouteExecutionStrategyFactory<HttpExecutionStrategy>
- Returns:
- this
- See Also:
-
build
Build theHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
HttpService
.
-
build
Build theHttpService
for the specified JAX-RSApplication
class.- Parameters:
applicationClass
- theApplication
class to instantiate and route requests to.- Returns:
- the
HttpService
.
-
buildStreaming
Build theStreamingHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
StreamingHttpService
.
-
buildStreaming
public StreamingHttpService buildStreaming(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theStreamingHttpService
for the specified JAX-RSApplication
class.- Parameters:
applicationClass
- theApplication
class to instantiate and route requests to.- Returns:
- the
StreamingHttpService
.
-
buildBlocking
Build theBlockingHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
BlockingHttpService
.
-
buildBlocking
public BlockingHttpService buildBlocking(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theBlockingHttpService
for the specified JAX-RSApplication
class.- Parameters:
applicationClass
- theApplication
class to instantiate and route requests to.- Returns:
- the
BlockingHttpService
.
-
buildBlockingStreaming
public BlockingStreamingHttpService buildBlockingStreaming(javax.ws.rs.core.Application application) Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
BlockingStreamingHttpService
.
-
buildBlockingStreaming
public BlockingStreamingHttpService buildBlockingStreaming(Class<? extends javax.ws.rs.core.Application> applicationClass) Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
class.- Parameters:
applicationClass
- theApplication
class to instantiate and route requests to.- Returns:
- the
BlockingStreamingHttpService
.
-