com.sun.xml.wss.impl.callback
Class DynamicPolicyCallback

java.lang.Object
  extended by com.sun.xml.wss.impl.callback.XWSSCallback
      extended by com.sun.xml.wss.impl.callback.DynamicPolicyCallback
All Implemented Interfaces:
javax.security.auth.callback.Callback

public class DynamicPolicyCallback
extends XWSSCallback
implements javax.security.auth.callback.Callback

Callback implementation for dynamic policy resolution. A DynamicPolicy Callback is made by the XWS-runtime to allow the application/Handler to decide the incoming/outgoing SecurityPolicy at runtime.

When the SecurityPolicy set on the Callback is a DynamicSecurityPolicy then the CallbackHandler is currently expected to set a com.sun.xml.wss.impl.configuration.MessagePolicy instance as the resolved policy. The MessagePolicy instance can contain policies generated by the PolicyGenerator obtained from the DynamicSecurityPolicy.


Constructor Summary
DynamicPolicyCallback(SecurityPolicy _policy, DynamicPolicyContext _ctx)
          Constructor.
 
Method Summary
 DynamicPolicyContext getDynamicContext()
           
 SecurityPolicy getSecurityPolicy()
          The SecurityPolicy set by the invocation of the CallbackHandler.
 StaticPolicyContext getStaticContext()
           
 boolean isDynamicSecurityPolicy()
           
 void setSecurityPolicy(SecurityPolicy _policy)
          set the resolved SecurityPolicy in response to this callback
 
Methods inherited from class com.sun.xml.wss.impl.callback.XWSSCallback
getRuntimeProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicPolicyCallback

public DynamicPolicyCallback(SecurityPolicy _policy,
                             DynamicPolicyContext _ctx)
                      throws PolicyGenerationException
Constructor.

Associate a DynamicSecurityPolicy or WSSPolicy instance. A DynamicSecurityPolicy can be used to obtain a PolicyGenerator. The DynamicPolicyContext passed can be used by the handler to dynamically decide the policy based on information in the context.

Parameters:
_policy - DynamicSecurityPolicy or WSSPolicy
_ctx - DynamicPolicyContext the context which provides context information to the Handler.
Throws:
PolicyGenerationException
See Also:
SecurityPolicyGenerator
Method Detail

getSecurityPolicy

public SecurityPolicy getSecurityPolicy()
The SecurityPolicy set by the invocation of the CallbackHandler.

Returns:
SecurityPolicy

getDynamicContext

public DynamicPolicyContext getDynamicContext()
Returns:
DynamicPolicyContext passed to the callback

getStaticContext

public StaticPolicyContext getStaticContext()
Returns:
the StaticPolicyContext if any associated with the DynamicPolicyContext

setSecurityPolicy

public void setSecurityPolicy(SecurityPolicy _policy)
set the resolved SecurityPolicy in response to this callback

Parameters:
_policy - a MessagePolicy instance containing SecurityPolicy generated by PolicyGenerator or a mutable WSSPolicy

isDynamicSecurityPolicy

public boolean isDynamicSecurityPolicy()


Copyright ? 2005 Sun Microsystems, Inc. All Rights Reserved.