|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Context
An abstraction of the security context obtained from the thread of execution.
The security context consists of the "RunAs" and "Caller" Subjects, including any credentials, authentication, authorization, and propagastion tokens.
The security context is retrieved from the running thread when instances of this interface are
newly created by the factory method com.ibm.wsspi.security.context.ContextManager.getContext().
Instances of this interface may be saved to persistent storage and later restored for use by an application.
ContextManager.getContext()
Method Summary | |
---|---|
javax.security.auth.Subject |
getCallerSubject()
Returns the current Caller Subject stored in this Context . |
java.util.Map |
getPropagationTokens()
Returns the current Map of PropagationTokens stored in this Context . |
javax.security.auth.Subject |
getRunAsSubject()
Returns the current RunAs Subject stored in this Context . |
void |
restoreContext()
The security context saved by the setContext() operation is restored
and set on the current thread of execution. |
java.lang.Object |
runWith(java.security.PrivilegedExceptionAction action)
Run the given action using this security context. |
void |
setCallerSubject(javax.security.auth.Subject caller)
Replaces the Caller Subject stored in this Context with the given Subject. |
void |
setContext()
Set this security context on the current thread of execution. |
void |
setPropagationTokens(java.util.Map tokens)
Replaces the Map of PropagationTokens stored in this Context with the given Map. |
void |
setRunAsSubject(javax.security.auth.Subject runAs)
Replaces the RunAs Subject stored in this Context with the given Subject. |
Method Detail |
---|
void setContext() throws WSSecurityException
Prior to setting this context on the thread of execution, the current security context on the thread is
saved and is restored on the thread by the restoreContext()
operation.
"setSecurityContext" permission is required in order to perform this operation.
WSSecurityException
- if any errors are encountered.void restoreContext() throws WSSecurityException
setContext()
operation is restored
and set on the current thread of execution.
"restoreSecurityContext" permission is required in order to perform this operation.
WSSecurityException
- if any errors are encountered.java.lang.Object runWith(java.security.PrivilegedExceptionAction action) throws WSSecurityException
action
using this security context.
action
- the action to be performed using this security context
action
's run operation.
WSSecurityException
- if any errors are encountered.void setCallerSubject(javax.security.auth.Subject caller) throws WSSecurityException
Context
with the given Subject.
This operation does not modify the Caller Subject in thread local storage (TLS).
The given Subject becomes the current Caller Subject stored in this Context
and the
previous value of the Caller Subject is lost and discarded.
caller
- the Caller Subject to replace the current Caller Subject in this Context
.
WSSecurityException
- if an error occursjavax.security.auth.Subject getCallerSubject() throws WSSecurityException
Context
.
The Caller Subject returned is not retrieved from thread local storage (TLS).
The initial value of the Caller Subject is obtained from TLS at the time this Context
is created and may have subsequently been modified with the setCallerSubject()
operation.
Context
.
WSSecurityException
- if an error occursvoid setRunAsSubject(javax.security.auth.Subject runAs) throws WSSecurityException
Context
with the given Subject.
This operation does not modify the RunAs Subject (aka Invocation Subject) in thread local storage (TLS).
The given Subject becomes the current RunAs Subject stored in this Context
and the
previous value of the RunAs Subject is lost and discarded.
runAs
- the RunAs Subject to replace the current RunAs Subject in this Context
.
WSSecurityException
- if an error occursjavax.security.auth.Subject getRunAsSubject() throws WSSecurityException
Context
.
The RunAs Subject returned is not retrieved from thread local storage (TLS).
The initial value of the RunAs Subject is obtained from TLS at the time this Context
is created and may have subsequently been modified with the setRunAsSubject()
operation.
Context
.
WSSecurityException
- if an error occursjava.util.Map getPropagationTokens() throws WSSecurityException
Context
.
The PropagationTokens in the Map are not retrieved from thread local storage (TLS).
The Map of PropagationTokens is initially obtained from TLS at the time this Context
is created and may have subsequently been modified with the setPropagationTokens()
operation.
Context
.
WSSecurityException
- if an error occursvoid setPropagationTokens(java.util.Map tokens) throws WSSecurityException
Context
with the given Map.
This operation does not modify the Map of PropagationTokens in thread local storage (TLS).
The given Map becomes the current Map of PropagationTokens stored in this Context
and the
previous Map is lost and discarded.
tokens
- the Map of PropagationTokens to replace the current Map in this Context
.
WSSecurityException
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |