Class SecurityContextHolder
java.lang.Object
org.gridgain.internal.security.context.SecurityContextHolder
Security context holder that stores security context in thread local state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static @Nullable org.gridgain.internal.security.context.SecurityContextGet security context from thread local state or return null if it is not set.static org.gridgain.internal.security.context.SecurityContextGet security context from thread local state or throw exception if it is not set.static voidset(@Nullable org.gridgain.internal.security.context.SecurityContext ctx) Set security context to thread local state.
-
Constructor Details
-
SecurityContextHolder
public SecurityContextHolder()
-
-
Method Details
-
getOrThrow
public static org.gridgain.internal.security.context.SecurityContext getOrThrow()Get security context from thread local state or throw exception if it is not set.- Returns:
- Security context.
- Throws:
SecurityContextIsNotSetException- If security context is not set.
-
getOrNull
@Nullable public static @Nullable org.gridgain.internal.security.context.SecurityContext getOrNull()Get security context from thread local state or return null if it is not set.- Returns:
- Security context or null.
-
set
public static void set(@Nullable @Nullable org.gridgain.internal.security.context.SecurityContext ctx) Set security context to thread local state.- Parameters:
ctx- Security context.
-
clear
public static void clear()
-