Package se.fortnox.reactivewizard.jaxrs
Class JaxRsRequestHandler
java.lang.Object
se.fortnox.reactivewizard.jaxrs.JaxRsRequestHandler
- All Implemented Interfaces:
BiFunction<reactor.netty.http.server.HttpServerRequest,,reactor.netty.http.server.HttpServerResponse, org.reactivestreams.Publisher<Void>> RequestHandler
Handles incoming requests. If the request matches a resource an Observable which completes the request is returned.
-
Constructor Summary
ConstructorsConstructorDescriptionJaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, Boolean classReloading) JaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, Boolean classReloading, JaxRsResourceInterceptors requestInterceptors) JaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector, Boolean classReloading, JaxRsResourceInterceptors requestInterceptors) JaxRsRequestHandler(JaxRsResourcesProvider services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector) JaxRsRequestHandler(JaxRsResourcesProvider services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector, JaxRsResourceInterceptors requestInterceptors) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<Void>apply(reactor.netty.http.server.HttpServerRequest request, reactor.netty.http.server.HttpServerResponse response) Handles incoming request if a matching resource is found.protected voidpreHandle(reactor.netty.http.server.HttpServerRequest request, JaxRsResource<?> resource) Pre handling hook for classes extending this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
JaxRsRequestHandler
@Inject public JaxRsRequestHandler(JaxRsResourcesProvider services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector, JaxRsResourceInterceptors requestInterceptors) -
JaxRsRequestHandler
public JaxRsRequestHandler(JaxRsResourcesProvider services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector) -
JaxRsRequestHandler
public JaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, Boolean classReloading) -
JaxRsRequestHandler
public JaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, Boolean classReloading, JaxRsResourceInterceptors requestInterceptors) -
JaxRsRequestHandler
public JaxRsRequestHandler(Object[] services, JaxRsResourceFactory jaxRsResourceFactory, ExceptionHandler exceptionHandler, ByteBufCollector collector, Boolean classReloading, JaxRsResourceInterceptors requestInterceptors)
-
-
Method Details
-
apply
public org.reactivestreams.Publisher<Void> apply(reactor.netty.http.server.HttpServerRequest request, reactor.netty.http.server.HttpServerResponse response) Handles incoming request if a matching resource is found.- Specified by:
applyin interfaceBiFunction<reactor.netty.http.server.HttpServerRequest,reactor.netty.http.server.HttpServerResponse, org.reactivestreams.Publisher<Void>> - Parameters:
request- The incoming requestresponse- The response that will be sent- Returns:
- an Observable which will complete the request when subsribed, or null if no resource matches the request.
-
preHandle
protected void preHandle(reactor.netty.http.server.HttpServerRequest request, JaxRsResource<?> resource) Pre handling hook for classes extending this class.- Parameters:
request- the current requestresource- the resource that will we handling the request
-