Class DynamicPolicyCallback

java.lang.Object
com.sun.xml.wss.impl.callback.XWSSCallback
com.sun.xml.wss.impl.callback.DynamicPolicyCallback
All Implemented Interfaces:
Callback

public class DynamicPolicyCallback extends XWSSCallback implements 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 Details

    • 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:
  • Method Details

    • 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()