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 java.lang.Object
implements SecurityPolicy

Represents an ordered collection of Security Policies


Constructor Summary
MessagePolicy()
          Construct an Empty MessagePolicy
 
Method Summary
 void addOptionalTarget(Target target)
           
 void addOptionalTargets(java.util.ArrayList optionls)
           
 void append(SecurityPolicy item)
          Append a SecurityPolicy
 void appendAll(java.util.Collection items)
          Append a policy collection
 boolean dumpMessages()
           
 void dumpMessages(boolean dump)
           
 boolean enableDynamicPolicy()
           
 void enableDynamicPolicy(boolean flag)
           
 boolean equals(MessagePolicy policy)
          Equals operator
 SecurityPolicy get(int index)
          Get the Security policy at the specified index
 int getOptimizedType()
           
 java.util.ArrayList getPrimaryPolicies()
           
 java.util.ArrayList getSecondaryPolicies()
           
 java.lang.String getType()
          Get the type of the policy.
 void insertBefore(SecurityPolicy existing, SecurityPolicy additional)
          Insert the additional policy before the existing policy
 boolean isBSP()
           
 void isBSP(boolean flag)
           
 boolean isEmpty()
           
 java.util.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()
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagePolicy

public MessagePolicy()
Construct an Empty MessagePolicy

Method Detail

getOptimizedType

public int getOptimizedType()

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(java.util.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 java.lang.Exception
Get the Security policy at the specified index

Parameters:
index - index to the policy collection
Returns:
SecurityPolicy instance at the specified index
Throws:
java.lang.Exception - if a policy could not be retrieved

iterator

public java.util.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()

isBSP

public void isBSP(boolean flag)

isBSP

public boolean isBSP()

removeOptionalTargets

public void removeOptionalTargets()

addOptionalTargets

public void addOptionalTargets(java.util.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 java.util.ArrayList getPrimaryPolicies()

getSecondaryPolicies

public java.util.ArrayList getSecondaryPolicies()

getType

public java.lang.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


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