Package io.micronaut.http.filter
Class OncePerRequestHttpServerFilter
java.lang.Object
io.micronaut.http.filter.OncePerRequestHttpServerFilter
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,HttpFilter,HttpServerFilter
@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
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.reactivestreams.Publisher<MutableHttpResponse<?>>doFilter(HttpRequest<?> request, ServerFilterChain chain) Deprecated.Variation of theHttpServerFilter.doFilter(HttpRequest, FilterChain)method that accepts aServerFilterChainwhich allows to mutate the outgoing HTTP response.protected abstract org.reactivestreams.Publisher<MutableHttpResponse<?>>doFilterOnce(HttpRequest<?> request, ServerFilterChain chain) Deprecated.static StringgetKey(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, waitMethods inherited from interface io.micronaut.http.filter.HttpServerFilter
doFilterMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
OncePerRequestHttpServerFilter
public OncePerRequestHttpServerFilter()Deprecated.
-
-
Method Details
-
doFilter
public final org.reactivestreams.Publisher<MutableHttpResponse<?>> doFilter(HttpRequest<?> request, ServerFilterChain chain) Deprecated.Description copied from interface:HttpServerFilterVariation of theHttpServerFilter.doFilter(HttpRequest, FilterChain)method that accepts aServerFilterChainwhich allows to mutate the outgoing HTTP response.- Specified by:
doFilterin interfaceHttpServerFilter- Parameters:
request- The requestchain- The chain- Returns:
- A
Publisherthat 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 org.reactivestreams.Publisher<MutableHttpResponse<?>> doFilterOnce(HttpRequest<?> request, ServerFilterChain chain) Deprecated.- Parameters:
request- TheHttpRequestinstancechain- TheServerFilterChaininstance- Returns:
- A
Publisherfor the Http response
-
HttpServerFilterinstead of extending this class and replace any usages of `micronaut.once` attributes with a custom attribute name.