public class Policy extends Object implements Iterable<AssertionSet>
AssertionSets
.Modifier and Type | Method and Description |
---|---|
boolean |
contains(QName assertionName)
Determines if the policy instance contains the assertion with the name specified in its vocabulary.
|
boolean |
contains(String namespaceUri)
Returns true if the policy contains the assertion names with specified namespace in its vocabulary
|
static Policy |
createEmptyPolicy()
The factory method creates an immutable policy instance which represents a
|
static Policy |
createEmptyPolicy(NamespaceVersion nsVersion,
String name,
String policyId)
The factory method creates an immutable policy instance which represents a
|
static Policy |
createEmptyPolicy(String name,
String policyId)
The factory method creates an immutable policy instance which represents a
|
static Policy |
createNullPolicy()
The factory method creates an immutable policy instance which represents a
|
static Policy |
createNullPolicy(NamespaceVersion nsVersion,
String name,
String policyId)
The factory method creates an immutable policy instance which represents a
|
static Policy |
createNullPolicy(String name,
String policyId)
The factory method creates an immutable policy instance which represents a
|
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. |
static Policy |
createPolicy(NamespaceVersion nsVersion,
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. |
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. |
boolean |
equals(Object obj)
An
Object.equals(Object obj) method override. |
String |
getId()
Returns the policy identifier that serves as a local relative policy URI.
|
String |
getIdOrName()
Returns the policy ID or if that is null the policy name.
|
String |
getName()
Returns the policy name that serves as a global policy URI.
|
NamespaceVersion |
getNamespaceVersion() |
int |
getNumberOfAssertionSets()
Method returns how many policy alternatives this policy instance contains.
|
Collection<QName> |
getVocabulary()
Retrieves the vocabulary of this policy expression.
|
int |
hashCode()
An
Object.hashCode() method override. |
boolean |
isEmpty()
Returns
true if the policy instance represents "anything allowed" policy expression |
boolean |
isNull()
Returns
true if the policy instance represents "nothing allowed" policy expression |
Iterator<AssertionSet> |
iterator()
A policy usually contains one or more assertion sets.
|
String |
toString()
An
Object.toString() method override. |
public static Policy createNullPolicy()
public static Policy createEmptyPolicy()
public static Policy createNullPolicy(String name, String policyId)
name
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.public static Policy createNullPolicy(NamespaceVersion nsVersion, String name, String policyId)
nsVersion
- Policy namespace version to be used when marshalling the policy expressionname
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.public static Policy createEmptyPolicy(String name, String policyId)
name
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.public static Policy createEmptyPolicy(NamespaceVersion nsVersion, String name, String policyId)
nsVersion
- Policy namespace version to be used when marshalling the policy expressionname
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.public static Policy createPolicy(Collection<AssertionSet> sets)
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
createNullPolicy()
factory method directly. The policy is created using the latest namespace version supported.sets
- represents the collection of policy alternatives of the policy object created. During the creation of
the 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.public static Policy createPolicy(String name, String policyId, Collection<AssertionSet> sets)
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
createNullPolicy(String, String)
factory method directly. The policy is created using the latest namespace version supported.name
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.sets
- represents the collection of policy alternatives of the policy object created. During the creation of
the 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.public static Policy createPolicy(NamespaceVersion nsVersion, String name, String policyId, Collection<AssertionSet> sets)
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
createNullPolicy(String, String)
factory method directly. The policy is created using the latest namespace version supported.nsVersion
- Policy namespace version to be used when marshalling the policy expressionname
- global URI of the policy. May be null
.policyId
- local URI of the policy. May be null
.sets
- represents the collection of policy alternatives of the policy object created. During the creation of
the 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.public String getId()
null
.public String getName()
null
.public NamespaceVersion getNamespaceVersion()
public String getIdOrName()
public int getNumberOfAssertionSets()
public Iterator<AssertionSet> iterator()
iterator
in interface Iterable<AssertionSet>
public boolean isNull()
true
if the policy instance represents "nothing allowed" policy expressiontrue
if the policy instance represents "nothing allowed" policy expression, false
otherwise.public boolean isEmpty()
true
if the policy instance represents "anything allowed" policy expressiontrue
if the policy instance represents "anything allowed" policy expression, false
otherwise.public boolean contains(String namespaceUri)
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.public Collection<QName> getVocabulary()
public boolean contains(QName assertionName)
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.public boolean equals(Object obj)
Object.equals(Object obj)
method override.public int hashCode()
Object.hashCode()
method override.Copyright © 2006-2015 Oracle Corporation. All Rights Reserved.