public class BasicAuthenticationThreadContextListener extends Object implements ThreadContextListener
ThreadContextListener
implementation reading the Basic Authentication Header from the incoming request and
storing it in the current ThreadContext
.ThreadContextListener.DefaultPriorities
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_BASIC_AUTH_HEADER
The key of the stored BasicCredentials in the current
ThreadContext . |
Constructor and Description |
---|
BasicAuthenticationThreadContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked after the current
ThreadContext is initialized and set. |
void |
beforeDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is destroyed and reset. |
int |
getPriority()
Returns the priority that defines the order in which listeners are invoked.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterDestroy, beforeInitialize, compareTo
public static final String PROPERTY_BASIC_AUTH_HEADER
ThreadContext
.public BasicAuthenticationThreadContextListener()
public int getPriority()
getPriority
in interface ThreadContextListener
public void afterInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is initialized and set.afterInitialize
in interface ThreadContextListener
threadContext
- The ThreadContext
that was initialized is now set.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.public void beforeDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContext
is destroyed and reset.beforeDestroy
in interface ThreadContextListener
threadContext
- The ThreadContext
that is destroyed and will be removed.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.Copyright © 2021 SAP SE. All rights reserved.