com.ibm.sec.authz.jaccplus

Class ContainerEvaluationContext

  1. java.lang.Object
  2. extended bycom.ibm.sec.authz.jaccplus.ContainerEvaluationContext
All implemented interfaces:
EvaluationContext

  1. public final class ContainerEvaluationContext
  2. extends java.lang.Object

An implementation of EvaluationContext for use when using the authenticated subject from a a supported container such as WebSphere Application Server. If this implementation is used, then the currently authenticated user will automatically be serialized as the subject during a call to ApplicationPolicy.implies(String, EvaluationContext, java.security.Permission).

Once created re-use the instance of EvaluationContext for the life of the application and across threads. Potentially expensive initialization is done when this class is constructed.


Constructor Summary

Constructor and Description
ContainerEvaluationContext()
Constructs a ContainerEvaluationContext instance.

Method Summary

Modifier and Type Method and Description
  1. java.lang.Object
getContext(java.lang.String key)
  1. java.util.Map<java.lang.String,java.lang.Object>
getHandlerData()
  1. java.util.Set<java.lang.String>
getKeys()
  1. void
registerHandler(java.lang.String key,IEvaluationContextHandler handler,boolean replace)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ContainerEvaluationContext

  1. public ContainerEvaluationContext( )
  2. throws PolicyContextException
Constructs a ContainerEvaluationContext instance.
Throws:
PolicyContextException - if an error occurs while initializing the container- specific handler code.

Method Detail

registerHandler

  1. public void registerHandler(java.lang.String key,
  2. IEvaluationContextHandler handler,
  3. boolean replace)
  4. throws PolicyContextException
Description copied from interface: EvaluationContext
This method registers a PolicyContextHandler implementation for a particular key. A single handler implementation can be registered to handle multiple keys.
Specified by:
Parameters:
key - the key.
handler - the policy context handler implementation.
replace - this boolean value defines the behaviour of this method if, when it is called, a policy context handler implementation has already been registered to handle the same key. In that case and if the value of this argument is true, the existing handler is replaced with the argument handler. If the value of this parameter is false, the existing registration is preserved and an exception is thrown.
Throws:
PolicyContextException - if an error occurs.

getKeys

  1. public java.util.Set<java.lang.String> getKeys( )
Description copied from interface: EvaluationContext
Returns the set of keys that this evaluation context can handle.
Specified by:
getKeys in interface EvaluationContext
Returns:
the set of keys.

getContext

  1. public java.lang.Object getContext( java.lang.String key)
  2. throws PolicyContextException
Description copied from interface: EvaluationContext
Given a key, returns the corresponding context object.
Specified by:
Parameters:
key - the key.
Returns:
the attribute.
Throws:
PolicyContextException

getHandlerData

  1. public java.util.Map<java.lang.String,java.lang.Object> getHandlerData( )
Description copied from interface: EvaluationContext
Gets the thread-scoped handler data object.
Specified by:
Returns:
The thread-local handler data map.