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
Represents an ordered collection of Security Policies
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOptionalTarget(Target target) voidaddOptionalTargets(ArrayList optionls) voidappend(SecurityPolicy item) Append a SecurityPolicyvoidappendAll(Collection items) Append a policy collectionbooleanvoiddumpMessages(boolean dump) booleanvoidenableDynamicPolicy(boolean flag) booleanvoidenableSignatureConfirmation(boolean flag) booleanvoidenableWSS11Policy(boolean flag) booleanequals(MessagePolicy policy) Equals operatorget(int index) Get the Security policy at the specified indexintgetType()Get the type of the policy.voidinsertBefore(SecurityPolicy existing, SecurityPolicy additional) Insert the additional policy before the existing policybooleanisBSP()voidisBSP(boolean flag) booleanisEmpty()booleanisSSL()iterator()voidprepend(SecurityPolicy item) Prepend a SecurityPolicyvoidremove(SecurityPolicy item) remove the specified SecurityPolicyvoidclear this policy collectionvoidvoidsetAlgorithmSuite(AlgorithmSuite algSuite) voidsetLayout(MessageLayout layout) voidsetPolicyAlternativeId(String polId) voidsetSSL(boolean value) voidsetWSSAssertion(WSSAssertion wssAssertion) intsize()
-
Field Details
-
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
Append a SecurityPolicy- Parameters:
item- SecurityPolicy instance to be appended- Throws:
PolicyGenerationException- if the policy being appended is not an instance ofWSSPolicy
-
prepend
Prepend a SecurityPolicy- Parameters:
item- SecurityPolicy instance to be prepended- Throws:
PolicyGenerationException- if the policy being prepended is not an instance ofWSSPolicy
-
appendAll
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
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
- Returns:
Iteratoriterator on policy collection
-
isEmpty
public boolean isEmpty()- Returns:
- true if collection is empty
-
remove
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
- Throws:
PolicyGenerationException
-
getWSSAssertion
-
enableSignatureConfirmation
- 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
- Throws:
com.sun.xml.wss.XWSSecurityException
-
addOptionalTarget
-
equals
Equals operator- Parameters:
policy-MessagePolicyto be compared for equality- Returns:
- true if the policy is equal to this policy
-
getPrimaryPolicies
-
getSecondaryPolicies
-
getType
Description copied from interface:SecurityPolicyGet the type of the policy.Implementation Note: Useful to avoid instanceof checks and String.equals checks
- Specified by:
getTypein interfaceSecurityPolicy- Returns:
- the type of the policy
-
setAlgorithmSuite
-
getAlgorithmSuite
-
getLayout
-
setLayout
-
setSSL
public void setSSL(boolean value) -
isSSL
public boolean isSSL() -
getPolicyAlternativeId
-
setPolicyAlternativeId
-