public final class AuthenticationContext extends Object implements org.wildfly.common.context.Contextual<AuthenticationContext>
Modifier and Type | Method and Description |
---|---|
static AuthenticationContext |
captureCurrent()
Get the current thread's captured authentication context.
|
static AuthenticationContext |
empty()
Get a new, empty authentication context.
|
static org.wildfly.common.context.ContextManager<AuthenticationContext> |
getContextManager()
Get the context manager for authentication contexts.
|
org.wildfly.common.context.ContextManager<AuthenticationContext> |
getInstanceContextManager() |
AuthenticationContext |
replacing(int idx,
MatchRule rule,
AuthenticationConfiguration configuration)
Get a new authentication context which is the same as this one, but which replaces the rule and configuration at the given
index with the given rule and configuration.
|
AuthenticationContext |
replacingSslContext(int idx,
MatchRule rule,
SecurityFactory<SSLContext> sslContext)
Get a new authentication context which is the same as this one, but which replaces the rule and SSL context at the given
index with the given rule and SSL context.
|
<T,P> T |
run(P parameter,
ParametricPrivilegedAction<T,P> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T,P> T |
run(P parameter,
ParametricPrivilegedExceptionAction<T,P> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T> T |
run(PrivilegedAction<T> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T> T |
run(PrivilegedExceptionAction<T> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T> void |
runAsObjIntConsumer(ObjIntConsumer<T> action,
T parameter1,
int parameter2)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T,E extends Exception> |
runAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action,
T parameter1,
int parameter2)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T> T |
runAsSupplier(Supplier<T> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
<T,E extends Exception> |
runAsSupplierEx(org.wildfly.common.function.ExceptionSupplier<T,E> action)
Run a privileged action with this authentication context associated for the duration of the task.
|
AuthenticationContext |
with(AuthenticationContext other)
Get a new authentication context which is the same as this one, but which includes the rules, configurations
and SSL contexts of the given context at the end of its list.
|
AuthenticationContext |
with(int idx,
MatchRule rule,
AuthenticationConfiguration configuration)
Get a new authentication context which is the same as this one, but which includes the given rule and configuration
inserted at the position of its list indicated by the
idx parameter. |
AuthenticationContext |
with(MatchRule rule,
AuthenticationConfiguration configuration)
Get a new authentication context which is the same as this one, but which includes the given rule and configuration at
the end of its list.
|
AuthenticationContext |
without(int idx)
Get a new authentication context which is the same as this one, but without the rule and configuration at the index
indicated by the
idx parameter. |
AuthenticationContext |
withoutSsl(int idx)
Get a new authentication context which is the same as this one, but without the rule and configuration at the index
indicated by the
idx parameter. |
AuthenticationContext |
withSsl(int idx,
MatchRule rule,
SecurityFactory<SSLContext> sslContext)
Get a new authentication context which is the same as this one, but which includes the given rule and SSL context
inserted at the position of its list indicated by the
idx parameter. |
AuthenticationContext |
withSsl(MatchRule rule,
SecurityFactory<SSLContext> sslContext)
Get a new authentication context which is the same as this one, but which includes the given rule and SSL context at
the end of its SSL context list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run, runAction, runBiConsumer, runBiFunction, runBiPredicate, runCallable, runConsumer, runExBiConsumer, runExBiFunction, runExBiPredicate, runExceptionAction, runExConsumer, runExFunction, runExIntFunction, runExLongFunction, runExPredicate, runFunction, runIntFunction, runLongFunction, runPredicate
public static AuthenticationContext empty()
public static AuthenticationContext captureCurrent()
public AuthenticationContext with(MatchRule rule, AuthenticationConfiguration configuration)
rule
- the rule to matchconfiguration
- the configuration to select when the rule matchespublic AuthenticationContext withSsl(MatchRule rule, SecurityFactory<SSLContext> sslContext)
rule
- the rule to matchsslContext
- the SSL context to select when the rule matchespublic AuthenticationContext with(AuthenticationContext other)
other
- the other authentication contextpublic AuthenticationContext with(int idx, MatchRule rule, AuthenticationConfiguration configuration) throws IndexOutOfBoundsException
idx
parameter.idx
- the index at which insertion should be donerule
- the rule to matchconfiguration
- the configuration to select when the rule matchesIndexOutOfBoundsException
- if the index is out of boundspublic AuthenticationContext withSsl(int idx, MatchRule rule, SecurityFactory<SSLContext> sslContext) throws IndexOutOfBoundsException
idx
parameter.idx
- the index at which insertion should be donerule
- the rule to matchsslContext
- the SSL context to select when the rule matchesIndexOutOfBoundsException
- if the index is out of boundspublic AuthenticationContext replacing(int idx, MatchRule rule, AuthenticationConfiguration configuration) throws IndexOutOfBoundsException
idx
- the index at which insertion should be donerule
- the rule to matchconfiguration
- the configuration to select when the rule matchesIndexOutOfBoundsException
- if the index is out of boundspublic AuthenticationContext replacingSslContext(int idx, MatchRule rule, SecurityFactory<SSLContext> sslContext) throws IndexOutOfBoundsException
idx
- the index at which insertion should be donerule
- the rule to matchsslContext
- the SSL context to select when the rule matchesIndexOutOfBoundsException
- if the index is out of boundspublic AuthenticationContext without(int idx) throws IndexOutOfBoundsException
idx
parameter.idx
- the index at which removal should be doneIndexOutOfBoundsException
- if the index is out of boundspublic AuthenticationContext withoutSsl(int idx) throws IndexOutOfBoundsException
idx
parameter.idx
- the index at which removal should be doneIndexOutOfBoundsException
- if the index is out of boundspublic <T> T run(PrivilegedAction<T> action)
T
- the action return typeaction
- the action to run under associationpublic <T> T run(PrivilegedExceptionAction<T> action) throws PrivilegedActionException
T
- the action return typeaction
- the action to run under associationPrivilegedActionException
- if the action throws an exceptionpublic <T,P> T run(P parameter, ParametricPrivilegedAction<T,P> action)
T
- the action return typeP
- the action parameter typeparameter
- the parameter to pass to the actionaction
- the action to run under associationpublic <T,P> T run(P parameter, ParametricPrivilegedExceptionAction<T,P> action) throws PrivilegedActionException
T
- the action return typeP
- the action parameter typeparameter
- the parameter to pass to the actionaction
- the action to run under associationPrivilegedActionException
- if the action throws an exceptionpublic <T> void runAsObjIntConsumer(ObjIntConsumer<T> action, T parameter1, int parameter2)
T
- the action first parameter typeparameter1
- the first parameter to pass to the actionparameter2
- the second parameter to pass to the actionaction
- the action to runpublic <T> T runAsSupplier(Supplier<T> action)
T
- the action return typeaction
- the action to runnull
)public <T,E extends Exception> void runAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action, T parameter1, int parameter2) throws E extends Exception
T
- the action first parameter typeE
- the action exception typeparameter1
- the first parameter to pass to the actionparameter2
- the second parameter to pass to the actionaction
- the action to runE
- if the action throws this exceptionE extends Exception
public <T,E extends Exception> T runAsSupplierEx(org.wildfly.common.function.ExceptionSupplier<T,E> action) throws E extends Exception
T
- the action return typeE
- the action exception typeaction
- the action to runnull
)E
- if the action throws this exceptionE extends Exception
public org.wildfly.common.context.ContextManager<AuthenticationContext> getInstanceContextManager()
getInstanceContextManager
in interface org.wildfly.common.context.Contextual<AuthenticationContext>
public static org.wildfly.common.context.ContextManager<AuthenticationContext> getContextManager()
null
)Copyright © 2021 JBoss by Red Hat. All rights reserved.