Package io.micronaut.http.filter
Class OncePerRequestHttpServerFilter
java.lang.Object
io.micronaut.http.filter.OncePerRequestHttpServerFilter
- All Implemented Interfaces:
Ordered
,HttpFilter
,HttpServerFilter
- Direct Known Subclasses:
EndpointsFilter
,HealthResultFilter
@Deprecated
public abstract class OncePerRequestHttpServerFilter
extends Object
implements HttpServerFilter
Deprecated.
A filter that is only executed once per request. A filter may be executed more
than once per request if the original route throws an exception.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Publisher<MutableHttpResponse<?>>
doFilter
(HttpRequest<?> request, ServerFilterChain chain) Deprecated.Variation of theHttpServerFilter.doFilter(HttpRequest, FilterChain)
method that accepts aServerFilterChain
which allows to mutate the outgoing HTTP response.protected abstract Publisher<MutableHttpResponse<?>>
doFilterOnce
(HttpRequest<?> request, ServerFilterChain chain) Deprecated.static String
getKey
(Class<? extends OncePerRequestHttpServerFilter> filterClass) Deprecated.Implement custom keys for request attributes based on the need of the filter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.filter.HttpServerFilter
doFilter
-
Constructor Details
-
OncePerRequestHttpServerFilter
public OncePerRequestHttpServerFilter()Deprecated.
-
-
Method Details
-
doFilter
public final Publisher<MutableHttpResponse<?>> doFilter(HttpRequest<?> request, ServerFilterChain chain) Deprecated.Description copied from interface:HttpServerFilter
Variation of theHttpServerFilter.doFilter(HttpRequest, FilterChain)
method that accepts aServerFilterChain
which allows to mutate the outgoing HTTP response.- Specified by:
doFilter
in interfaceHttpServerFilter
- Parameters:
request
- The requestchain
- The chain- Returns:
- A
Publisher
that emits aMutableHttpResponse
- See Also:
-
getKey
@Deprecated public static String getKey(Class<? extends OncePerRequestHttpServerFilter> filterClass) Deprecated.Implement custom keys for request attributes based on the need of the filter.Obtain the key used to store the attribute within a request.- Parameters:
filterClass
- the filter class- Returns:
- The key
-
doFilterOnce
protected abstract Publisher<MutableHttpResponse<?>> doFilterOnce(HttpRequest<?> request, ServerFilterChain chain) Deprecated.- Parameters:
request
- TheHttpRequest
instancechain
- TheServerFilterChain
instance- Returns:
- A
Publisher
for the Http response
-
HttpServerFilter
instead of extending this class and replace any usages of `micronaut.once` attributes with a custom attribute name.