Package com.sun.xml.ws.policy
Class PolicyAssertion
- java.lang.Object
-
- com.sun.xml.ws.policy.PolicyAssertion
-
- Direct Known Subclasses:
Address,AlgorithmSuite,AsymmetricBinding,BootstrapPolicy,CallbackHandler,CallbackHandlerConfiguration,CertStoreConfig,Claims,ComplexAssertion,EncryptedElements,EncryptedParts,EndpointReference,Header,HttpsToken,IssuedToken,Issuer,IssuerName,JMACAuthModuleConfiguration,KerberosConfig,KerberosToken,KeyStore,KeyValueToken,Layout,Lifetime,RelToken,RequestSecurityTokenTemplate,RequiredElements,RsaToken,SamlToken,SCTokenWrapper,SecureConversationToken,SecurityContextToken,SessionManagerStore,SignedElements,SignedParts,SimpleAssertion,SpnegoContextToken,SupportingTokens,SymmetricBinding,Token,TransportBinding,Trust10,Trust13,UseKey,UsernameToken,Validator,ValidatorConfiguration,Wss10,Wss11,X509Token
public abstract class PolicyAssertion extends Object
Base class for any policy assertion implementations. It defines the common interface and provides some default implentation for common policy assertion functionality.
NOTE: Assertion implementers should not extend this class directly.SimpleAssertionorComplexAssertionshould be used as a base class instead.- Author:
- Marek Potociar (marek.potociar at sun.com), Fabian Ritzmann
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPolicyAssertion()protectedPolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters)Creates generic assertionand stores the data specified in input parametersprotectedPolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters, AssertionSet nestedAlternative)Deprecated.Non-abstract assertion types should derive fromSimpleAssertionorComplexAssertioninstead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)AnObject.equals(Object obj)method override.Map<QName,String>getAttributes()Returns the disconnected map of attributes attached to the assertion.Set<Map.Entry<QName,String>>getAttributesSet()Returns the disconnected set of attributes attached to the assertion.StringgetAttributeValue(QName name)Returns the value of an attribute.<T extends PolicyAssertion>
TgetImplementation(Class<T> type)Casts the assertion to the implementation type.QNamegetName()Returns the fully qualified name of the assertion.Iterator<PolicyAssertion>getNestedAssertionsIterator()Deprecated.Use getNestedParametersIterator() insteadNestedPolicygetNestedPolicy()Returns the nested policy if any.Iterator<PolicyAssertion>getParametersIterator()Returns the assertion's parameter collection iterator.StringgetValue()Returns the value of the assertion - the character data content contained in the assertion element representation.inthashCode()AnObject.hashCode()method override.booleanhasNestedAssertions()Deprecated.Use hasParameters() insteadbooleanhasNestedPolicy()Returns the boolean information whether this assertion contains nested policy.booleanhasParameters()Returns the boolean information whether this assertion contains any parameters.booleanisIgnorable()Method specifies whether the assertion is ignorable or not.booleanisOptional()Method specifies whether the assertion is otpional or not.booleanisPrivate()Method specifies whether the assertion is private or not.StringtoString()AnObject.toString()method override.protected StringBuffertoString(int indentLevel, StringBuffer buffer)A helper method that appends indented string representation of this instance to the input string buffer.
-
-
-
Constructor Detail
-
PolicyAssertion
protected PolicyAssertion()
-
PolicyAssertion
@Deprecated protected PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters, AssertionSet nestedAlternative)
Deprecated.Non-abstract assertion types should derive fromSimpleAssertionorComplexAssertioninstead.Policyclass will not provide support for nested policy alternatives in the future. This responsibility is delegated toComplexAssertionclass instead.Creates generic assertionand stores the data specified in input parameters- Parameters:
assertionData- assertion creation data specifying the details of newly created assertion. May benull.assertionParameters- collection of assertions parameters of this policy assertion. May benull.nestedAlternative- assertion set specifying nested policy alternative. May benull.
-
PolicyAssertion
protected PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters)
Creates generic assertionand stores the data specified in input parameters- Parameters:
assertionData- assertion creation data specifying the details of newly created assertionassertionParameters- collection of assertions parameters of this policy assertion. May benull.
-
-
Method Detail
-
getName
public final QName getName()
Returns the fully qualified name of the assertion.- Returns:
- assertion's fully qualified name.
-
getValue
public final String getValue()
Returns the value of the assertion - the character data content contained in the assertion element representation.- Returns:
- assertion's value. May return
nullif there is no value set for the assertion.
-
isOptional
public boolean isOptional()
Method specifies whether the assertion is otpional or not.
This is a default implementation that may be overriden. The method returnstrueif thewsp:optionalattribute is present on the assertion and its value is'true'. Otherwise the method returnsfalse.- Returns:
'true'if the assertion is optional. Returnsfalseotherwise.
-
isIgnorable
public boolean isIgnorable()
Method specifies whether the assertion is ignorable or not.
This is a default implementation that may be overriden. The method returnstrueif thewsp:Ignorableattribute is present on the assertion and its value is'true'. Otherwise the method returnsfalse.- Returns:
'true'if the assertion is ignorable. Returnsfalseotherwise.
-
isPrivate
public final boolean isPrivate()
Method specifies whether the assertion is private or not. This is specified by our proprietary visibility element.- Returns:
'true'if the assertion is marked as private (i.e. should not be marshalled int generated WSDL documents). Returnsfalseotherwise.
-
getAttributesSet
public final Set<Map.Entry<QName,String>> getAttributesSet()
Returns the disconnected set of attributes attached to the assertion. Each attribute is represented as a singleMap.Entry<attributeName, attributeValue>element.
'Disconnected' means, that the result of this method will not be synchronized with any consequent assertion's attribute modification. It is also important to notice that a manipulation with returned set of attributes will not have any effect on the actual assertion's attributes.- Returns:
- disconected set of attributes attached to the assertion.
-
getAttributes
public final Map<QName,String> getAttributes()
Returns the disconnected map of attributes attached to the assertion.
'Disconnected' means, that the result of this method will not be synchronized with any consequent assertion's attribute modification. It is also important to notice that a manipulation with returned set of attributes will not have any effect on the actual assertion's attributes.- Returns:
- disconnected map of attributes attached to the assertion.
-
getAttributeValue
public final String getAttributeValue(QName name)
Returns the value of an attribute. Returns null if an attribute with the given name does not exist.- Parameters:
name- The fully qualified name of the attribute- Returns:
- The value of the attribute. Returns
nullif there is no such attribute or if it's value is null.
-
hasNestedAssertions
@Deprecated public final boolean hasNestedAssertions()
Deprecated.Use hasParameters() insteadReturns the boolean information whether this assertion contains any parameters.- Returns:
trueif the assertion contains parameters. Returnsfalseotherwise.
-
hasParameters
public final boolean hasParameters()
Returns the boolean information whether this assertion contains any parameters.- Returns:
trueif the assertion contains parameters. Returnsfalseotherwise.
-
getNestedAssertionsIterator
@Deprecated public final Iterator<PolicyAssertion> getNestedAssertionsIterator()
Deprecated.Use getNestedParametersIterator() insteadReturns the assertion's parameter collection iterator.- Returns:
- the assertion's parameter collection iterator.
-
getParametersIterator
public final Iterator<PolicyAssertion> getParametersIterator()
Returns the assertion's parameter collection iterator.- Returns:
- the assertion's parameter collection iterator.
-
hasNestedPolicy
public boolean hasNestedPolicy()
Returns the boolean information whether this assertion contains nested policy.- Returns:
trueif the assertion contains child (nested) policy. Returnsfalseotherwise.
-
getNestedPolicy
public NestedPolicy getNestedPolicy()
Returns the nested policy if any.- Returns:
- the nested policy if the assertion contains a nested policy. Returns
nullotherwise.
-
getImplementation
public <T extends PolicyAssertion> T getImplementation(Class<T> type)
Casts the assertion to the implementation type. Returns null if that is not possible.- Type Parameters:
T- The implementation type of the assertion.- Parameters:
type- The implementation type of the assertion. May not be null.- Returns:
- The instance of the implementation type. Null otherwise.
-
toString
public String toString()
AnObject.toString()method override.
-
toString
protected StringBuffer toString(int indentLevel, StringBuffer buffer)
A helper method that appends indented string representation of this instance to the input string buffer.- Parameters:
indentLevel- indentation level to be used.buffer- buffer to be used for appending string representation of this instance- Returns:
- modified buffer containing new string representation of the instance
-
equals
public boolean equals(Object obj)
AnObject.equals(Object obj)method override.
-
-