Package com.sun.xml.wss.impl.policy.mls
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
-
-
Constructor Summary
Constructors Constructor Description MessagePolicy()
Construct an Empty MessagePolicy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOptionalTarget(Target target)
void
addOptionalTargets(ArrayList optionls)
void
append(SecurityPolicy item)
Append a SecurityPolicyvoid
appendAll(Collection items)
Append a policy collectionboolean
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 operatorSecurityPolicy
get(int index)
Get the Security policy at the specified indexAlgorithmSuite
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 policyboolean
isBSP()
void
isBSP(boolean flag)
boolean
isEmpty()
boolean
isSSL()
Iterator
iterator()
void
prepend(SecurityPolicy item)
Prepend a SecurityPolicyvoid
remove(SecurityPolicy item)
remove the specified SecurityPolicyvoid
removeAll()
clear this policy collectionvoid
removeOptionalTargets()
void
setAlgorithmSuite(AlgorithmSuite algSuite)
void
setLayout(MessageLayout layout)
void
setPolicyAlternativeId(String polId)
void
setSSL(boolean value)
void
setWSSAssertion(WSSAssertion wssAssertion)
int
size()
-
-
-
Field Detail
-
log
protected static final Logger log
-
-
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 ofWSSPolicy
-
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 ofWSSPolicy
-
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 insertedadditional
- SecurityPolicy instance to be inserted- Throws:
PolicyGenerationException
- if the policy to be inserted is not an instance ofWSSPolicy
, 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 interfaceSecurityPolicy
- 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)
-
-