Class MessagePolicy

java.lang.Object
com.sun.xml.wss.impl.policy.mls.MessagePolicy
All Implemented Interfaces:
SecurityPolicy

public class MessagePolicy extends Object implements SecurityPolicy
Represents an ordered collection of Security Policies
  • Field Details

    • log

      protected static final Logger log
  • Constructor Details

    • MessagePolicy

      public MessagePolicy()
      Construct an Empty MessagePolicy
  • Method Details

    • getOptimizedType

      public int getOptimizedType() throws com.sun.xml.wss.XWSSecurityException
      Throws:
      com.sun.xml.wss.XWSSecurityException
    • append

      public void append(SecurityPolicy item) throws PolicyGenerationException
      Append a SecurityPolicy
      Parameters:
      item - SecurityPolicy instance to be appended
      Throws:
      PolicyGenerationException - if the policy being appended is not an instance of WSSPolicy
    • prepend

      public void prepend(SecurityPolicy item) throws PolicyGenerationException
      Prepend a SecurityPolicy
      Parameters:
      item - SecurityPolicy instance to be prepended
      Throws:
      PolicyGenerationException - if the policy being prepended is not an instance of WSSPolicy
    • appendAll

      public void appendAll(Collection items) throws PolicyGenerationException
      Append a policy collection
      Parameters:
      items - Collection of SecurityPolicy instances to be appended
      Throws:
      PolicyGenerationException
    • removeAll

      public void removeAll()
      clear this policy collection
    • size

      public int size()
      Returns:
      size of policy collection
    • get

      public SecurityPolicy get(int index) throws Exception
      Get the Security policy at the specified index
      Parameters:
      index - index to the policy collection
      Returns:
      SecurityPolicy instance at the specified index
      Throws:
      Exception - if a policy could not be retrieved
    • iterator

      public Iterator iterator()
      Returns:
      Iterator iterator on policy collection
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if collection is empty
    • remove

      public void remove(SecurityPolicy item)
      remove the specified SecurityPolicy
      Parameters:
      item - the SecurityPolicy instance to be removed
    • insertBefore

      public void insertBefore(SecurityPolicy existing, SecurityPolicy additional) throws PolicyGenerationException
      Insert the additional policy before the existing policy
      Parameters:
      existing - SecurityPolicy instance before which the additional policy needs to be inserted
      additional - SecurityPolicy instance to be inserted
      Throws:
      PolicyGenerationException - if the policy to be inserted is not an instance of WSSPolicy, or there is an error in inserting the policy
    • dumpMessages

      public void dumpMessages(boolean dump)
      Parameters:
      dump - set it to true if messages should be Logged
    • dumpMessages

      public boolean dumpMessages()
      Returns:
      true if logging of messages is enabled
    • enableDynamicPolicy

      public void enableDynamicPolicy(boolean flag)
    • enableDynamicPolicy

      public boolean enableDynamicPolicy()
    • setWSSAssertion

      public void setWSSAssertion(WSSAssertion wssAssertion) throws PolicyGenerationException
      Throws:
      PolicyGenerationException
    • getWSSAssertion

      public WSSAssertion getWSSAssertion()
    • enableSignatureConfirmation

      public void enableSignatureConfirmation(boolean flag) throws PolicyGenerationException
      Throws:
      PolicyGenerationException
    • enableSignatureConfirmation

      public boolean enableSignatureConfirmation()
    • enableWSS11Policy

      public void enableWSS11Policy(boolean flag)
    • enableWSS11Policy

      public boolean enableWSS11Policy()
    • isBSP

      public void isBSP(boolean flag)
    • isBSP

      public boolean isBSP()
    • removeOptionalTargets

      public void removeOptionalTargets()
    • addOptionalTargets

      public void addOptionalTargets(ArrayList optionls) throws com.sun.xml.wss.XWSSecurityException
      Throws:
      com.sun.xml.wss.XWSSecurityException
    • addOptionalTarget

      public void addOptionalTarget(Target target)
    • equals

      public boolean equals(MessagePolicy policy)
      Equals operator
      Parameters:
      policy - MessagePolicy to be compared for equality
      Returns:
      true if the policy is equal to this policy
    • getPrimaryPolicies

      public ArrayList getPrimaryPolicies()
    • getSecondaryPolicies

      public ArrayList getSecondaryPolicies()
    • getType

      public String getType()
      Description copied from interface: SecurityPolicy
      Get the type of the policy.

      Implementation Note: Useful to avoid instanceof checks and String.equals checks

      Specified by:
      getType in interface SecurityPolicy
      Returns:
      the type of the policy
    • setAlgorithmSuite

      public void setAlgorithmSuite(AlgorithmSuite algSuite)
    • getAlgorithmSuite

      public AlgorithmSuite getAlgorithmSuite()
    • getLayout

      public MessageLayout getLayout()
    • setLayout

      public void setLayout(MessageLayout layout)
    • setSSL

      public void setSSL(boolean value)
    • isSSL

      public boolean isSSL()
    • getPolicyAlternativeId

      public String getPolicyAlternativeId()
    • setPolicyAlternativeId

      public void setPolicyAlternativeId(String polId)