Package org.wildfly.security.auth.server
Class FlexibleIdentityAssociation
- java.lang.Object
- 
- org.wildfly.security.auth.server.FlexibleIdentityAssociation
 
- 
- All Implemented Interfaces:
- Supplier<SecurityIdentity>,- Scoped
 
 public final class FlexibleIdentityAssociation extends Object implements Scoped, Supplier<SecurityIdentity> A flexible identity association which can have its current identity modified. Modifying the identity association will affect the current identity of any thread which is currently executing within the scope of this association.- Author:
- David M. Lloyd
- See Also:
- SecurityIdentity.createFlexibleAssociation()
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityIdentityget()Get the current associated identity.<T,U>
 booleanrunAsBiPredicate(BiPredicate<T,U> action, T param1, U param2)Run an action under this identity.<T,U>
 voidrunAsConsumer(BiConsumer<T,U> action, T parameter1, U parameter2)Run an action under this identity.<T,U,E extends Exception>
 voidrunAsConsumerEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> action, T parameter1, U parameter2)Run an action under this identity.<T,U,E extends Exception>
 booleanrunAsExBiPredicate(org.wildfly.common.function.ExceptionBiPredicate<T,U,E> action, T param1, U param2)Run an action under this identity.<T,U,R>
 RrunAsFunction(BiFunction<T,U,R> action, T parameter1, U parameter2)Run an action under this identity.<T,U,R,E extends Exception>
 RrunAsFunctionEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> action, T parameter1, U parameter2)Run an action under this identity.<T> voidrunAsObjIntConsumer(ObjIntConsumer<T> action, T parameter1, int parameter2)Run an action under this identity.<T,E extends Exception>
 voidrunAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action, T parameter1, int parameter2)Run an action under this identity.voidsetIdentity(SecurityIdentity securityIdentity)Set the current associated identity.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.wildfly.security.auth.server.ScopedrunAs, runAs, runAsAction, runAsConsumer, runAsConsumerEx, runAsExceptionAction, runAsExIntFunction, runAsExLongFunction, runAsExPredicate, runAsFunction, runAsFunctionEx, runAsIntFunction, runAsLongFunction, runAsPredicate, runAsSupplier, runAsSupplierEx
 
- 
 
- 
- 
- 
Method Detail- 
setIdentitypublic void setIdentity(SecurityIdentity securityIdentity) Set the current associated identity.- Parameters:
- securityIdentity- the current associated identity (must not be- null)
 
 - 
getpublic SecurityIdentity get() Get the current associated identity.- Specified by:
- getin interface- Supplier<SecurityIdentity>
- Returns:
- the current associated identity (not null)
 
 - 
runAsFunctionpublic <T,U,R> R runAsFunction(BiFunction<T,U,R> action, T parameter1, U parameter2) Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsFunctionin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- U- the action second parameter type
- R- the action return type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
- Returns:
- the action result (may be null)
 
 - 
runAsConsumerpublic <T,U> void runAsConsumer(BiConsumer<T,U> action, T parameter1, U parameter2) Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsConsumerin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- U- the action second parameter type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
 
 - 
runAsObjIntConsumerpublic <T> void runAsObjIntConsumer(ObjIntConsumer<T> action, T parameter1, int parameter2) Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsObjIntConsumerin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
 
 - 
runAsFunctionExpublic <T,U,R,E extends Exception> R runAsFunctionEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> action, T parameter1, U parameter2) throws E extends Exception Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsFunctionExin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- U- the action second parameter type
- R- the action return type
- E- the action exception type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
- Returns:
- the action result (may be null)
- Throws:
- E- if the action throws this exception
- E extends Exception
 
 - 
runAsConsumerExpublic <T,U,E extends Exception> void runAsConsumerEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> action, T parameter1, U parameter2) throws E extends Exception Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsConsumerExin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- U- the action second parameter type
- E- the action exception type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
- Throws:
- E- if the action throws this exception
- E extends Exception
 
 - 
runAsObjIntConsumerExpublic <T,E extends Exception> void runAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action, T parameter1, int parameter2) throws E extends Exception Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsObjIntConsumerExin interface- Scoped
- Type Parameters:
- T- the action first parameter type
- E- the action exception type
- Parameters:
- action- the action to run
- parameter1- the first parameter to pass to the action
- parameter2- the second parameter to pass to the action
- Throws:
- E- if the action throws this exception
- E extends Exception
 
 - 
runAsBiPredicatepublic <T,U> boolean runAsBiPredicate(BiPredicate<T,U> action, T param1, U param2) Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsBiPredicatein interface- Scoped
- Type Parameters:
- T- the first parameter type
- U- the second parameter type
- Parameters:
- action- the task to run (must not be- null)
- param1- the first parameter to pass to the task
- param2- the second parameter to pass to the task
- Returns:
- the action return value
 
 - 
runAsExBiPredicatepublic <T,U,E extends Exception> boolean runAsExBiPredicate(org.wildfly.common.function.ExceptionBiPredicate<T,U,E> action, T param1, U param2) throws E extends Exception Description copied from interface:ScopedRun an action under this identity.- Specified by:
- runAsExBiPredicatein interface- Scoped
- Type Parameters:
- T- the first parameter type
- U- the second parameter type
- E- the exception type
- Parameters:
- action- the task to run (must not be- null)
- param1- the first parameter to pass to the task
- param2- the second parameter to pass to the task
- Returns:
- the action return value
- Throws:
- E- if an exception occurs in the task
- E extends Exception
 
 
- 
 
-