Class HttpJerseyRouterBuilder
- java.lang.Object
-
- io.servicetalk.http.router.jersey.HttpJerseyRouterBuilder
-
public final class HttpJerseyRouterBuilder extends java.lang.Object
Builds anStreamingHttpService
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 Constructor Description HttpJerseyRouterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpJerseyRouterBuilder
baseUriFunction(java.util.function.BiFunction<ConnectionContext,HttpRequestMetaData,java.lang.String> baseUriFunction)
Set the function used to compute the base URI for the incoming HTTP request.HttpService
build(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theHttpService
for the specified JAX-RSApplication
class.HttpService
build(javax.ws.rs.core.Application application)
Build theHttpService
for the specified JAX-RSApplication
.BlockingHttpService
buildBlocking(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theBlockingHttpService
for the specified JAX-RSApplication
class.BlockingHttpService
buildBlocking(javax.ws.rs.core.Application application)
Build theBlockingHttpService
for the specified JAX-RSApplication
.BlockingStreamingHttpService
buildBlockingStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
class.BlockingStreamingHttpService
buildBlockingStreaming(javax.ws.rs.core.Application application)
Build theBlockingStreamingHttpService
for the specified JAX-RSApplication
.StreamingHttpService
buildStreaming(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theStreamingHttpService
for the specified JAX-RSApplication
class.StreamingHttpService
buildStreaming(javax.ws.rs.core.Application application)
Build theStreamingHttpService
for the specified JAX-RSApplication
.HttpJerseyRouterBuilder
publisherInputStreamQueueCapacity(int publisherInputStreamQueueCapacity)
Set the hint for the capacity of the intermediary queue that stores items when adaptingPublisher
s intoInputStream
s.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.
-
-
-
Method Detail
-
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(java.util.function.BiFunction<ConnectionContext,HttpRequestMetaData,java.lang.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:
- URI Syntax Components
-
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:
RouteExecutionStrategy
-
build
public HttpService build(javax.ws.rs.core.Application application)
Build theHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
HttpService
.
-
build
public HttpService build(java.lang.Class<? extends javax.ws.rs.core.Application> applicationClass)
Build theHttpService
for the specified JAX-RSApplication
class.- Parameters:
applicationClass
- theApplication
class to instantiate and route requests to.- Returns:
- the
HttpService
.
-
buildStreaming
public StreamingHttpService buildStreaming(javax.ws.rs.core.Application application)
Build theStreamingHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
StreamingHttpService
.
-
buildStreaming
public StreamingHttpService buildStreaming(java.lang.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
public BlockingHttpService buildBlocking(javax.ws.rs.core.Application application)
Build theBlockingHttpService
for the specified JAX-RSApplication
.- Parameters:
application
- theApplication
to route requests to.- Returns:
- the
BlockingHttpService
.
-
buildBlocking
public BlockingHttpService buildBlocking(java.lang.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(java.lang.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
.
-
-