class SecurityContextStack
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private SecurityContext |
additional
The effective context (if not
null ). |
private static java.lang.ThreadLocal |
contextPointer
Per-thread reference to the security context.
|
private SecurityContext |
initial
The initial context.
|
private static ContextKey |
SYSTEM_SECURITY_EDITING
Opaque key for the "system-security-editing"
|
Constructor and Description |
---|
SecurityContextStack(SecurityContext initial)
Package private constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addToken(ContextKey key,
java.lang.Object token)
Adds a token to the context map.
|
(package private) SecurityContextStack |
duplicate()
Create a copy of this stack with shared initial and effective contexts.
|
(package private) SecurityCache |
getCache()
Gets the security cache this context stack is bound to.
|
(package private) int[] |
getCheckList()
Gets the current check list for the context.
|
(package private) static SecurityContextStack |
getContext()
Gets the current security context stack.
|
(package private) Decision |
getDecisionCache(int resource)
Get the access decision cache for the context.
|
(package private) SecurityContext |
getEffectiveContext()
Gets the effective security context.
|
(package private) int[] |
getIdList()
Gets the array of original subject IDs of this context.
|
(package private) SecurityContext |
getInitial()
Gets the initial context.
|
(package private) SecurityContext |
getSessionKey()
Gets the context that is the session key object.
|
(package private) java.lang.Object |
getToken(ContextKey key)
Gets the token from the context map.
|
(package private) boolean |
hasToken(ContextKey key)
Checks whether the specified token is in the context map.
|
(package private) boolean |
isEditing()
Gets the batch editing status.
|
(package private) SecurityContext |
pop()
Conditionally pops an additional security context off the stack.
|
(package private) boolean |
push(SecurityContext ctx)
Conditionally pushes an additional security context to the stack.
|
(package private) SecurityContextStack |
related()
Create a copy of this stack with the initial context set from the current effective
context BUT with no shared data and no existing session.
|
(package private) boolean |
removeToken(ContextKey key)
Remove a token from the context map.
|
(package private) static void |
setContext(SecurityContextStack stack)
Sets the current security context stack.
|
(package private) void |
setEditing(boolean isEditing)
Sets the batch editing status.
|
private static final ContextKey SYSTEM_SECURITY_EDITING
private static java.lang.ThreadLocal contextPointer
private SecurityContext initial
private SecurityContext additional
null
).SecurityContextStack(SecurityContext initial)
initial
- The initial security context to use.static SecurityContextStack getContext()
SecurityContextStack
object for the current thread
or null
if not initializedstatic void setContext(SecurityContextStack stack)
stack
- SecurityContextStack
object to be set for
the current threadSecurityContextStack duplicate()
SecurityContextStack related()
SecurityContext getEffectiveContext()
SecurityContext
object for the current threadint[] getCheckList()
int[] getIdList()
Decision getDecisionCache(int resource)
resource
- The unique index that identifies the resource type.boolean push(SecurityContext ctx)
true
if successfulSecurityContext pop()
true
if successfulSecurityContext getSessionKey()
null
SecurityContext getInitial()
null
boolean isEditing()
true
if an editing batch is open for this contextvoid setEditing(boolean isEditing)
isEditing
- new state of the batch editing for this contextboolean addToken(ContextKey key, java.lang.Object token)
key
- token key to be used as a key in the maptoken
- an arbitrary object to be kept in the entrytrue
if the token is added successfullyboolean removeToken(ContextKey key)
key
- token key to be used as a key in the maptrue
if the token was removed successfullyboolean hasToken(ContextKey key)
key
- token key to be used as a key in the maptrue
if the token is foundjava.lang.Object getToken(ContextKey key)
key
- token key to be used as a key in the mapnull
SecurityCache getCache()
SecurityCache