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.SimpleAssertion
orComplexAssertion
should be used as a base class instead.- Author:
- Marek Potociar (marek.potociar at sun.com), Fabian Ritzmann
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PolicyAssertion()
protected
PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters)
Creates generic assertionand stores the data specified in input parametersprotected
PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters, AssertionSet nestedAlternative)
Deprecated.Non-abstract assertion types should derive fromSimpleAssertion
orComplexAssertion
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(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.String
getAttributeValue(QName name)
Returns the value of an attribute.<T extends PolicyAssertion>
TgetImplementation(Class<T> type)
Casts the assertion to the implementation type.QName
getName()
Returns the fully qualified name of the assertion.Iterator<PolicyAssertion>
getNestedAssertionsIterator()
Deprecated.Use getNestedParametersIterator() insteadNestedPolicy
getNestedPolicy()
Returns the nested policy if any.Iterator<PolicyAssertion>
getParametersIterator()
Returns the assertion's parameter collection iterator.String
getValue()
Returns the value of the assertion - the character data content contained in the assertion element representation.int
hashCode()
AnObject.hashCode()
method override.boolean
hasNestedAssertions()
Deprecated.Use hasParameters() insteadboolean
hasNestedPolicy()
Returns the boolean information whether this assertion contains nested policy.boolean
hasParameters()
Returns the boolean information whether this assertion contains any parameters.boolean
isIgnorable()
Method specifies whether the assertion is ignorable or not.boolean
isOptional()
Method specifies whether the assertion is otpional or not.boolean
isPrivate()
Method specifies whether the assertion is private or not.String
toString()
AnObject.toString()
method override.protected StringBuffer
toString(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 fromSimpleAssertion
orComplexAssertion
instead.Policy
class will not provide support for nested policy alternatives in the future. This responsibility is delegated toComplexAssertion
class 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
null
if 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 returnstrue
if thewsp:optional
attribute is present on the assertion and its value is'true'
. Otherwise the method returnsfalse
.- Returns:
'true'
if the assertion is optional. Returnsfalse
otherwise.
-
isIgnorable
public boolean isIgnorable()
Method specifies whether the assertion is ignorable or not.
This is a default implementation that may be overriden. The method returnstrue
if thewsp:Ignorable
attribute is present on the assertion and its value is'true'
. Otherwise the method returnsfalse
.- Returns:
'true'
if the assertion is ignorable. Returnsfalse
otherwise.
-
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). Returnsfalse
otherwise.
-
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
null
if 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:
true
if the assertion contains parameters. Returnsfalse
otherwise.
-
hasParameters
public final boolean hasParameters()
Returns the boolean information whether this assertion contains any parameters.- Returns:
true
if the assertion contains parameters. Returnsfalse
otherwise.
-
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:
true
if the assertion contains child (nested) policy. Returnsfalse
otherwise.
-
getNestedPolicy
public NestedPolicy getNestedPolicy()
Returns the nested policy if any.- Returns:
- the nested policy if the assertion contains a nested policy. Returns
null
otherwise.
-
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.
-
-