|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
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 . |
Domain |
getDomain()
Returns the current domain 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. |
java.lang.Object |
runWithDomain(java.security.PrivilegedExceptionAction action)
Run the given action using the security domain in this 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 |
setDomain(Domain domain)
Replaces the domain stored in this Context with the given domain. |
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 com.ibm.websphere.security.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.
com.ibm.websphere.security.WSSecurityException
- if any errors are encountered.void restoreContext() throws com.ibm.websphere.security.WSSecurityException
setContext()
operation is restored
and set on the current thread of execution.
"restoreSecurityContext" permission is required in order to perform this operation.
com.ibm.websphere.security.WSSecurityException
- if any errors are encountered.java.lang.Object runWith(java.security.PrivilegedExceptionAction action) throws com.ibm.websphere.security.WSSecurityException
action
using this security context. The security
domain and the subjects will be pushed on the thread before running the action.
The thread state will be restored, i.e the domain and subjects will be
popped after the action runs.
action
- the action to be performed using this security context
action
's run operation.
com.ibm.websphere.security.WSSecurityException
- if any errors are encountered.java.lang.Object runWithDomain(java.security.PrivilegedExceptionAction action) throws com.ibm.websphere.security.WSSecurityException
action
using the security domain in this context. The domain
will be pushed on the thread, but the subjects will not, before running the action.
The thread state will be restored, i.e the domain will be popped, after the action runs.
action
- the action to be performed using this security context
action
's run operation.
com.ibm.websphere.security.WSSecurityException
- if any errors are encountered.void setCallerSubject(javax.security.auth.Subject caller) throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursjavax.security.auth.Subject getCallerSubject() throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursvoid setRunAsSubject(javax.security.auth.Subject runAs) throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursjavax.security.auth.Subject getRunAsSubject() throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursjava.util.Map getPropagationTokens() throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursvoid setPropagationTokens(java.util.Map tokens) throws com.ibm.websphere.security.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
.
com.ibm.websphere.security.WSSecurityException
- if an error occursDomain getDomain() throws com.ibm.websphere.security.WSSecurityException
Context
.
The domain is not retrieved from thread local storage (TLS), it
is initially obtained from TLS at the time this Context
is created and may have subsequently been modified with the setDomain()
operation.
Context
.
com.ibm.websphere.security.WSSecurityException
- if an error occursvoid setDomain(Domain domain) throws com.ibm.websphere.security.WSSecurityException
Context
with the given domain.
This operation does not modify the domain in thread local storage (TLS).
The given domain becomes the current domain stored in this Context
and the
previous domain is lost and discarded.
domain
- the Domain to replace the current Domain in this Context
.
com.ibm.websphere.security.WSSecurityException
- if an error occurs
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |