Package io.micronaut.session.http
Class HttpSessionFilter
java.lang.Object
io.micronaut.session.http.HttpSessionFilter
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,io.micronaut.http.filter.HttpFilter,io.micronaut.http.filter.HttpServerFilter
@Requires(property="micronaut.session.filter.enabled",
notEquals="false",
defaultValue="true")
@Filter(patternStyle=REGEX,
value="${micronaut.session.filter.regex-pattern:^.*$}")
public class HttpSessionFilter
extends Object
implements io.micronaut.http.filter.HttpServerFilter
A
HttpServerFilter that resolves the current user Session if present and encodes the Session ID in
the response.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntegerThe order of the filter.static final CharSequenceConstant for Micronaut SESSION attribute.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionHttpSessionFilter(SessionStore<Session> sessionStore, HttpSessionIdResolver[] resolvers, HttpSessionIdEncoder[] encoders) Constructor. -
Method Summary
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
doFilter
-
Field Details
-
ORDER
The order of the filter. -
SESSION_ATTRIBUTE
Constant for Micronaut SESSION attribute.
-
-
Constructor Details
-
HttpSessionFilter
public HttpSessionFilter(SessionStore<Session> sessionStore, HttpSessionIdResolver[] resolvers, HttpSessionIdEncoder[] encoders) Constructor.- Parameters:
sessionStore- The session storeresolvers- The HTTP session id resolversencoders- The HTTP session id encoders
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
doFilter
public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain) - Specified by:
doFilterin interfaceio.micronaut.http.filter.HttpServerFilter
-