Class ThreadLocalX509TrustEngineContext
java.lang.Object
org.opensaml.security.x509.tls.impl.ThreadLocalX509TrustEngineContext
Class which holds and makes available instances of
TrustEngine<? super X509Credential>
and CriteriaSet via ThreadLocal storage, typically used for server TLS authentication
via ThreadLocalX509TrustManager.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classUnified class representing the data that will be managed by the thread local storage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ThreadLocal<ThreadLocalX509TrustEngineContext.Data>ThreadLocal storage for trust engine. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the current thread-local credential.static CriteriaSetReturn the current thread-local criteria instance.static BooleanReturn the current thread-local trust evaluation data.static TrustEngine<? super X509Credential>Return the current thread-local trust engine instance.static booleanGet whether the current thread-local is populated with non-null data.static BooleanReturn whether failure of server TLS is to be treated as fatal.static voidloadCurrent(TrustEngine<? super X509Credential> trustEngine, CriteriaSet criteria, Boolean fatal) Load the thread-local storage with the current credential.static voidsetTrusted(Boolean trusted) Set the current thread-local trust evaluation data.
-
Field Details
-
current
ThreadLocal storage for trust engine.
-
-
Constructor Details
-
ThreadLocalX509TrustEngineContext
private ThreadLocalX509TrustEngineContext()Constructor.
-
-
Method Details
-
clearCurrent
public static void clearCurrent()Clear the current thread-local credential. -
haveCurrent
public static boolean haveCurrent()Get whether the current thread-local is populated with non-null data.- Returns:
- true if thread-local has non-null data, false otherwise
-
getTrustEngine
Return the current thread-local trust engine instance.- Returns:
- the current trust engine
-
getCriteria
Return the current thread-local criteria instance.- Returns:
- the current criteria
-
isFailureFatal
Return whether failure of server TLS is to be treated as fatal.- Returns:
- true if fatal, false if not
-
getTrusted
Return the current thread-local trust evaluation data.- Returns:
- the current trust evaluation data
-
setTrusted
Set the current thread-local trust evaluation data.- Parameters:
trusted- the current trust evaluation data