| java.lang.Object com.sun.xml.ws.policy.Policy
All known Subclasses: com.sun.xml.ws.policy.NestedPolicy,
Policy | public class Policy implements Iterable<AssertionSet>(Code) | | A policy represents normalized policy as a wrapper of available policy alternatives represented by
child
AssertionSet AssertionSets .
author: Fabian Ritzmann, Marek Potociar |
Method Summary | |
public boolean | contains(String namespaceUri) | public boolean | contains(QName assertionName) Determines if the policy instance contains the assertion with the name specified in its vocabulary.
Parameters: assertionName - the name of the assertion to be tested. | public static Policy | createEmptyPolicy() The factory method creates an immutable policy instance which represents a 'anything allowed'
policy expression. | public static Policy | createEmptyPolicy(String name, String policyId) The factory method creates an immutable policy instance which represents a 'anything allowed'
policy expression.
Parameters: name - global URI of the policy. | public static Policy | createNullPolicy() The factory method creates an immutable policy instance which represents a 'nothing allowed'
policy expression. | public static Policy | createNullPolicy(String name, String policyId) The factory method creates an immutable policy instance which represents a 'nothing allowed'
policy expression.
Parameters: name - global URI of the policy. | public static Policy | createPolicy(Collection<AssertionSet> sets) The factory method creates an immutable policy instance which represents a policy expression with
alternatives specified by
sets input parameter. | public static Policy | createPolicy(String name, String policyId, Collection<AssertionSet> sets) The factory method creates an immutable policy instance which represents a policy expression with
alternatives specified by
sets input parameter. | public boolean | equals(Object obj) An
Object.equals(Object obj) method override. | Collection<AssertionSet> | getContent() | public String | getId() Returns the policy identifier that serves as a local relative policy URI.
policy identifier - a local relative policy URI. | public String | getIdOrName() Returns the policy ID or if that is null the policy name. | public String | getName() Returns the policy name that serves as a global policy URI.
policy name - a global policy URI. | public int | getNumberOfAssertionSets() Method returns how many policy alternatives this policy instance contains. | public Collection<QName> | getVocabulary() Retrieves the vocabulary of this policy expression. | public int | hashCode() An
Object.hashCode() method override. | public boolean | isEmpty() | public boolean | isNull() | public Iterator<AssertionSet> | iterator() A policy usually contains one or more assertion sets. | public String | toString() An
Object.toString() method override. | StringBuffer | toString(int indentLevel, StringBuffer buffer) A helper method that appends indented string representation of this instance to the input string buffer. |
Policy | Policy(String toStringName, Collection<AssertionSet> sets)(Code) | | Constructor that should be overridden by child implementation. The constructor allows for easy toString() output
customization.
Parameters: toStringName - a general name of the object (such as 'policy' or 'nested policy') that will be used in thetoString() method to identify the object. Parameters: sets - represents the collection of policy alternatives of the policy object created. During the creation ofthe new policy object, the content of the alternatives collection is copied into an internal policy object structure,thus any subsequent operations on the collection will have no impact on the newly constructed policy object. Thecollection may be null or empty. In such case a 'NULL' policy object is constructed. |
Policy | Policy(String toStringName, String name, String policyId, Collection<AssertionSet> sets)(Code) | | Constructor that should be overridden by child implementation. The constructor allows for easy toString() output
customization.
Parameters: toStringName - a general name of the object (such as 'policy' or 'nested policy') that will be used in thetoString() method to identify the object. Parameters: name - global URI of the policy. May be null . Parameters: policyId - local URI of the policy. May be null . Parameters: sets - represents the collection of policy alternatives of the policy object created. During the creation ofthe new policy object, the content of the alternatives collection is copied into an internal policy object structure,thus any subsequent operations on the collection will have no impact on the newly constructed policy object. Thecollection may be null or empty. In such case a 'NULL' policy object is constructed. |
contains | public boolean contains(String namespaceUri)(Code) | | Returns true if the policy contains the assertion names with specified namespace in its vocabulary
Parameters: namespaceUri - the assertion namespace URI (identifying assertion domain) true , if an assertion with the given name could be found in the policy vocabulary false otherwise. |
contains | public boolean contains(QName assertionName)(Code) | | Determines if the policy instance contains the assertion with the name specified in its vocabulary.
Parameters: assertionName - the name of the assertion to be tested. true if the assertion with the specified name is part of the policy instance's vocabulary, false otherwise. |
createEmptyPolicy | public static Policy createEmptyPolicy()(Code) | | The factory method creates an immutable policy instance which represents a 'anything allowed'
policy expression.
policy instance which represents a 'anything allowed' (empty policy alternative with no plicyassertions prescribed). |
createEmptyPolicy | public static Policy createEmptyPolicy(String name, String policyId)(Code) | | The factory method creates an immutable policy instance which represents a 'anything allowed'
policy expression.
Parameters: name - global URI of the policy. May be null . Parameters: policyId - local URI of the policy. May be null . policy instance which represents a 'anything allowed' (empty policy alternative with no plicyassertions prescribed). |
createNullPolicy | public static Policy createNullPolicy()(Code) | | The factory method creates an immutable policy instance which represents a 'nothing allowed'
policy expression.
policy instance which represents a 'nothing allowed' (no policy alternatives). |
createNullPolicy | public static Policy createNullPolicy(String name, String policyId)(Code) | | The factory method creates an immutable policy instance which represents a 'nothing allowed'
policy expression.
Parameters: name - global URI of the policy. May be null . Parameters: policyId - local URI of the policy. May be null . policy instance which represents a 'nothing allowed' (no policy alternatives). |
createPolicy | public static Policy createPolicy(Collection<AssertionSet> sets)(Code) | | The factory method creates an immutable policy instance which represents a policy expression with
alternatives specified by
sets input parameter. If the collection of policy alternatives is null or empty
an object representing a 'NULL' policy expression is returned. However, in such case it is better to use
Policy.createNullPolicy() factory method directly.
Parameters: sets - represents the collection of policy alternatives of the policy object created. During the creation ofthe new policy object, the content of the alternatives collection is copied into an internal policy object structure,thus any subsequent operations on the collection will have no impact on the newly constructed policy object. policy instance which represents the policy with given alternatives. |
createPolicy | public static Policy createPolicy(String name, String policyId, Collection<AssertionSet> sets)(Code) | | The factory method creates an immutable policy instance which represents a policy expression with
alternatives specified by
sets input parameter. If the collection of policy alternatives is null or empty
an object representing a 'NULL' policy expression is returned. However, in such case it is better to use
Policy.createNullPolicy(String,String) factory method directly.
Parameters: name - global URI of the policy. May be null . Parameters: policyId - local URI of the policy. May be null . Parameters: sets - represents the collection of policy alternatives of the policy object created. During the creation ofthe new policy object, the content of the alternatives collection is copied into an internal policy object structure,thus any subsequent operations on the collection will have no impact on the newly constructed policy object. policy instance which represents the policy with given alternatives. |
equals | public boolean equals(Object obj)(Code) | | An
Object.equals(Object obj) method override.
|
getId | public String getId()(Code) | | Returns the policy identifier that serves as a local relative policy URI.
policy identifier - a local relative policy URI. If no policy identifier is set, returns null . |
getIdOrName | public String getIdOrName()(Code) | | Returns the policy ID or if that is null the policy name. May return null
if both attributes are null.
See Also: Policy.getId() See Also: Policy.getName() The policy ID if it was set, or the name or null if no attribute was set. |
getName | public String getName()(Code) | | Returns the policy name that serves as a global policy URI.
policy name - a global policy URI. If no policy name is set, returns null . |
getNumberOfAssertionSets | public int getNumberOfAssertionSets()(Code) | | Method returns how many policy alternatives this policy instance contains.
number of policy alternatives contained in this policy instance |
getVocabulary | public Collection<QName> getVocabulary()(Code) | | Retrieves the vocabulary of this policy expression. The vocabulary is represented by an immutable collection of
unique QName objects. Each of those objects represents single assertion type contained in the policy.
immutable collection of assertion types contained in the policy (a policy vocabulary). |
hashCode | public int hashCode()(Code) | | An
Object.hashCode() method override.
|
isEmpty | public boolean isEmpty()(Code) | | Returns
true if the policy instance represents "anything allowed" policy expression
true if the policy instance represents "anything allowed" policy expression, false otherwise. |
isNull | public boolean isNull()(Code) | | Returns
true if the policy instance represents "nothing allowed" policy expression
true if the policy instance represents "nothing allowed" policy expression, false otherwise. |
iterator | public Iterator<AssertionSet> iterator()(Code) | | A policy usually contains one or more assertion sets. Each assertion set
corresponds to a policy alternative as defined by WS-Policy.
An iterator to iterate through all contained assertion sets |
toString | public String toString()(Code) | | An
Object.toString() method override.
|
toString | StringBuffer toString(int indentLevel, StringBuffer buffer)(Code) | | A helper method that appends indented string representation of this instance to the input string buffer.
Parameters: indentLevel - indentation level to be used. Parameters: buffer - buffer to be used for appending string representation of this instance modified buffer containing new string representation of the instance |
|
|