com.sun.xml.wss.impl.policy.mls
Class MessagePolicy

java.lang.Object
  extended by 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 Summary
protected static Logger log
           
 
Constructor Summary
MessagePolicy()
          Construct an Empty MessagePolicy
 
Method Summary
 void addOptionalTarget(Target target)
           
 void addOptionalTargets(ArrayList optionls)
           
 void append(SecurityPolicy item)
          Append a SecurityPolicy
 void appendAll(Collection items)
          Append a policy collection
 boolean dumpMessages()
           
 void dumpMessages(boolean dump)
           
 boolean enableDynamicPolicy()
           
 void enableDynamicPolicy(boolean flag)
           
 boolean enableSignatureConfirmation()
           
 void enableSignatureConfirmation(boolean flag)
           
 boolean enableWSS11Policy()
           
 void enableWSS11Policy(boolean flag)
           
 boolean equals(MessagePolicy policy)
          Equals operator
 SecurityPolicy get(int index)
          Get the Security policy at the specified index
 AlgorithmSuite getAlgorithmSuite()
           
 MessageLayout getLayout()
           
 int getOptimizedType()
           
 String getPolicyAlternativeId()
           
 ArrayList getPrimaryPolicies()
           
 ArrayList getSecondaryPolicies()
           
 String getType()
          Get the type of the policy.
 WSSAssertion getWSSAssertion()
           
 void insertBefore(SecurityPolicy existing, SecurityPolicy additional)
          Insert the additional policy before the existing policy
 boolean isBSP()
           
 void isBSP(boolean flag)
           
 boolean isEmpty()
           
 boolean isSSL()
           
 Iterator iterator()
           
 void prepend(SecurityPolicy item)
          Prepend a SecurityPolicy
 void remove(SecurityPolicy item)
          remove the specified SecurityPolicy
 void removeAll()
          clear this policy collection
 void removeOptionalTargets()
           
 void setAlgorithmSuite(AlgorithmSuite algSuite)
           
 void setLayout(MessageLayout layout)
           
 void setPolicyAlternativeId(String polId)
           
 void setSSL(boolean value)
           
 void setWSSAssertion(WSSAssertion wssAssertion)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final Logger log
Constructor Detail

MessagePolicy

public MessagePolicy()
Construct an Empty MessagePolicy

Method Detail

getOptimizedType

public int getOptimizedType()
                     throws XWSSecurityException
Throws:
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 XWSSecurityException
Throws:
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)


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.