org.apache.ws.policy
Interface Assertion

All Known Subinterfaces:
CompositeAssertion
All Known Implementing Classes:
AbstractAssertion, AndCompositeAssertion, Policy, PolicyReference, PrimitiveAssertion, XorCompositeAssertion

public interface Assertion

Assertion is an interface which all constructs of policy must implement. It defines three policy operations that all policy constructs must support. Sanka Samaranayake (sanka@apache.org)


Field Summary
static short COMPOSITE_AND_TYPE
          Defines the short value for ANDCompositeAssertion
static short COMPOSITE_POLICY_TYPE
          Defines the short value for Policy Assertion
static short COMPOSITE_XOR_TYPE
          Defines the short value for XORCompositeAssertion
static short POLIY_REFERCE_TYPE
          Defines the short value for PolicyReferece Assertion
static short PRIMITIVE_TYPE
          Defines the short value for Primitive Assertions
 
Method Summary
 void addTerm(Assertion assertion)
          Adds an assertion as a term of this assertion.
 void addTerms(java.util.List assertions)
          Adds a list of assertions as terms of this assertion.
 int getLineNo()
          Returns the line no of the assertion which is line no of the assertion in the file where the assertion is first read.
 Assertion getParent()
          Returns the parent of self or null if a parent non-exists
 java.lang.String getSource()
          Returns a string which describes the source of the assertion.
 java.util.List getTerms()
          Returns the list of terms of this assertion.
 short getType()
          Returns a short type which describes the type of the assertion.
 boolean hasParent()
          Returns ture if the assertion has a parent
 Assertion intersect(Assertion assertion)
          Returns an assertion which is the equivalent of intersect of self and argument.
 Assertion intersect(Assertion assertion, PolicyRegistry reg)
          Returns an assertion which is equivalent of intersect of self and argument.
 boolean isEmpty()
          Returns true if there are no terms in this assertion.
 boolean isNormalized()
          Returns true if the assertion is in normalized form.
 Assertion merge(Assertion assertion)
          Returns the equivalent of merge of self and argument.
 Assertion merge(Assertion assertion, PolicyRegistry reg)
          Returns the equivalent of merge of self and argument.
 Assertion normalize()
          Returns a new assertion which is the normalized form of this assertion.
 Assertion normalize(PolicyRegistry reg)
          Returns a new assertion which is the normalized form of this assertion.
 boolean remove(Assertion assertion)
          Removes the specified assertion from the terms list.
 void setLineNo(int lineNo)
          Sets the line no of the assertion which should be the line no of the assertion in the file where the assertion is first read.
 void setNormalized(boolean flag)
          Marks this assertion as in normalized form.
 void setParent(Assertion parent)
          Sets the parent to argument
 void setSource(java.lang.String source)
          Sets specified string as the source of the assertion.
 int size()
          Returns the number of terms of this assertion.
 

Field Detail

PRIMITIVE_TYPE

public static final short PRIMITIVE_TYPE
Defines the short value for Primitive Assertions

See Also:
Constant Field Values

COMPOSITE_AND_TYPE

public static final short COMPOSITE_AND_TYPE
Defines the short value for ANDCompositeAssertion

See Also:
Constant Field Values

COMPOSITE_XOR_TYPE

public static final short COMPOSITE_XOR_TYPE
Defines the short value for XORCompositeAssertion

See Also:
Constant Field Values

COMPOSITE_POLICY_TYPE

public static final short COMPOSITE_POLICY_TYPE
Defines the short value for Policy Assertion

See Also:
Constant Field Values

POLIY_REFERCE_TYPE

public static final short POLIY_REFERCE_TYPE
Defines the short value for PolicyReferece Assertion

See Also:
Constant Field Values
Method Detail

normalize

public Assertion normalize()
                    throws java.lang.UnsupportedOperationException
Returns a new assertion which is the normalized form of this assertion.

Returns:
an assertion which is normalized form of this.
Throws:
java.lang.UnsupportedOperationException

normalize

public Assertion normalize(PolicyRegistry reg)
                    throws java.lang.UnsupportedOperationException
Returns a new assertion which is the normalized form of this assertion.

Parameters:
reg - the registry which is used to resolve any policy references in the process of normalization.
Returns:
Throws:
java.lang.UnsupportedOperationException - if an assertion does not support this operation.

intersect

public Assertion intersect(Assertion assertion)
                    throws java.lang.UnsupportedOperationException
Returns an assertion which is the equivalent of intersect of self and argument. The rules to construct the equivalent assertion are specified in WS Policy 1.0 specification.

Parameters:
assertion - the assertion to intersect with
Returns:
the equivalent of intersect of self and the argument
Throws:
java.lang.UnsupportedOperationException

intersect

public Assertion intersect(Assertion assertion,
                           PolicyRegistry reg)
                    throws java.lang.UnsupportedOperationException
Returns an assertion which is equivalent of intersect of self and argument. Here the external policy are resolved via a policy registry that is supplied as an argument.

Parameters:
assertion - the assertion to intersect with
Returns:
the equivalent of intersection of self and argument
Throws:
java.lang.UnsupportedOperationException - if the operation is not meaningful

merge

public Assertion merge(Assertion assertion)
                throws java.lang.UnsupportedOperationException
Returns the equivalent of merge of self and argument. The rules to construct the equivalent of merge are defined in WS Policy specification 1.0

Parameters:
assertion - the argument to merge with
Returns:
the equivalent of the merge of self and argument
Throws:
java.lang.UnsupportedOperationException

merge

public Assertion merge(Assertion assertion,
                       PolicyRegistry reg)
                throws java.lang.UnsupportedOperationException
Returns the equivalent of merge of self and argument. The rules to construct argument are specified in WS Policy specification 1.0 Here the external policy references are resolved via a policy registry that is supplied as an argument

Parameters:
assertion - the assertion to merge with
reg - the policy registry that should be used to resolve external policy references
Returns:
the equivalent of merge of self and argument
Throws:
java.lang.UnsupportedOperationException - if the merge is not meaningful

isNormalized

public boolean isNormalized()
Returns true if the assertion is in normalized form.

Returns:
true if the assertion is in normalized form.

setNormalized

public void setNormalized(boolean flag)
Marks this assertion as in normalized form.

Parameters:
flag -

hasParent

public boolean hasParent()
Returns ture if the assertion has a parent

Returns:
true if a parent exists , false otherwise

getParent

public Assertion getParent()
Returns the parent of self or null if a parent non-exists

Returns:
the parent of self

setParent

public void setParent(Assertion parent)
Sets the parent to argument

Parameters:
parent - the parent that should be parent of self

addTerm

public void addTerm(Assertion assertion)
Adds an assertion as a term of this assertion.

Parameters:
assertion - the assertion to add as a term

addTerms

public void addTerms(java.util.List assertions)
Adds a list of assertions as terms of this assertion.

Parameters:
assertions - the list of assertions to add as terms

getTerms

public java.util.List getTerms()
Returns the list of terms of this assertion.

Returns:
list of terms

isEmpty

public boolean isEmpty()
Returns true if there are no terms in this assertion.

Returns:
true if there are no terms.

remove

public boolean remove(Assertion assertion)
Removes the specified assertion from the terms list.

Parameters:
assertion - the assertion to remove from the terms list.
Returns:
true if it is removed from the child list.

size

public int size()
Returns the number of terms of this assertion.

Returns:
the no of terms of this assertion.

getType

public short getType()
Returns a short type which describes the type of the assertion.

Returns:
a short value of one of following values: PRIMITIVE_TYPE : if the assertion is a PrimitiveAssertion COMPOSITE_AND_TYPE : if the assertion is a AndCompositeAssertion COMPOSITE_XOR_TYPE : if the assertion is a XorCompositeAssertion COMPOSITE_POLICY_TYPE : if the assertion is a Policy POLICY_REFERENCE_TYPE : if the assertion is a PolicyReferece

getSource

public java.lang.String getSource()
Returns a string which describes the source of the assertion. For instance name of the policy file that contains the assertion. Returns null if it is not set.

Returns:
a string that describe the origin of the assertion.

setSource

public void setSource(java.lang.String source)
Sets specified string as the source of the assertion.

Parameters:
source - the string which describe the source of the origin of the assertion

getLineNo

public int getLineNo()
Returns the line no of the assertion which is line no of the assertion in the file where the assertion is first read. came from. Returns -1 if it is not set.

Returns:
the line no of the assertion in file where the assertion is first read.

setLineNo

public void setLineNo(int lineNo)
Sets the line no of the assertion which should be the line no of the assertion in the file where the assertion is first read.

Parameters:
lineNo -


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.