Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01

weblogic.wsee.policy.framework
Class NormalizedExpression

java.lang.Object
  extended by weblogic.wsee.policy.framework.NormalizedExpression
All Implemented Interfaces:
Externalizable, Serializable

public class NormalizedExpression
extends Object
implements Externalizable

This class represents a normalized policy expression. A normalized policy expression is a set of policy alternatives. An alternative is simply a set of policy assertions all of which must be true in order for the alternative to be true. A NormalizedExpression can be said to be true if one of its alternatives is true.

See Also:
Serialized Form

Field Summary
protected  String policyNamespaceUri
           
 
Constructor Summary
NormalizedExpression()
           
NormalizedExpression(String policyNamespaceUri)
           
 
Method Summary
 void addAlternative(PolicyAlternative alt)
          Add a PolicyAlternative to this normalized expression
 void addAlternatives(Set addAlts)
          Add a Set of PolicyAlternatives to this normalized expression
 boolean containsPolicyAssertion(Class asst)
          check if contains a particular PolicyAssertion
static NormalizedExpression createEmptyExpression()
          Return an empty NormalizedExpression that contains no policy alternatives.
static NormalizedExpression createFromPolicyAlternatives(Set policyAlts)
          Create a NormalizedExpression from a set of policy alternatives.
static NormalizedExpression createUnitializedExpression()
          Return a NormalizedExpression with no policy associated with it.
 boolean equals(Object o)
           
 PolicyAlternative getPolicyAlternative()
          Retrieve an arbitrary policy alternative from the set of policy alternatives.
 Set getPolicyAlternatives()
          Retrieves the Set of PolicyAlternatives which make up this normalized expression
 Set getPolicyAlternatives(Class assertionClass)
          Retrieves a Set of PolicyAlternatives that are avaiable from this expression and in which an assertion that is an instance of the given class is set
 Set getPolicyAlternatives(PolicyAssertion a)
          Retrieves a Set of PolicyAlternatives that are available from this expression in which a given assertion is set
 PolicyAssertion getPolicyAssertion(Class assertionClass)
          Retrieve a particular policy assertion object
 String getPolicyNamespaceUri()
           
 int hashCode()
           
 boolean isEmpty()
          Does this normalized expression contain an empty set of alternatives, meaning that no configuration is consistent with the policy?
 boolean isUninitialized()
          Is this normalized expression uninitialized, meaning all configurations are consistent with the policy?
 void readExternal(ObjectInput in)
          implement readExternal() of Externalizable interface
 void setPolicyNamespaceUri(String policyNamespaceUri)
           
 PolicyStatement toCompactForm(String id)
          Convert the normalized expression to a compact form.
 String toString()
           
 void writeExternal(ObjectOutput out)
          implement writeExternal() of Externalizable interface
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

policyNamespaceUri

protected String policyNamespaceUri
Constructor Detail

NormalizedExpression

public NormalizedExpression()

NormalizedExpression

public NormalizedExpression(String policyNamespaceUri)
Method Detail

getPolicyNamespaceUri

public String getPolicyNamespaceUri()

setPolicyNamespaceUri

public void setPolicyNamespaceUri(String policyNamespaceUri)

createFromPolicyAlternatives

public static NormalizedExpression createFromPolicyAlternatives(Set policyAlts)
Create a NormalizedExpression from a set of policy alternatives.

Parameters:
policyAlts - a non-empty Set of PolicyAlternatives that will make up the expression.
Returns:
the new NormalizedExpression that encapsulates the Set of PolicyAlternatives

createEmptyExpression

public static NormalizedExpression createEmptyExpression()
Return an empty NormalizedExpression that contains no policy alternatives. This means it represents a policy for which no configuration is valid.

Returns:
an empty NormalizedExpression

createUnitializedExpression

public static NormalizedExpression createUnitializedExpression()
Return a NormalizedExpression with no policy associated with it. This means all all configurations are valid with respect to the policy.


addAlternative

public void addAlternative(PolicyAlternative alt)
Add a PolicyAlternative to this normalized expression

Parameters:
alt - A policy alternative to be added to the set of policy alternatives supported by this expression

addAlternatives

public void addAlternatives(Set addAlts)
Add a Set of PolicyAlternatives to this normalized expression

Parameters:
addAlts - A Set of policy alternatives to be added to the set of policy alternatives supported by this expression

isEmpty

public boolean isEmpty()
Does this normalized expression contain an empty set of alternatives, meaning that no configuration is consistent with the policy?

Returns:
whether the expression contains an empty set of alternatives

isUninitialized

public boolean isUninitialized()
Is this normalized expression uninitialized, meaning all configurations are consistent with the policy?

Returns:
whether the expression is uninitialized

getPolicyAlternatives

public Set getPolicyAlternatives()
Retrieves the Set of PolicyAlternatives which make up this normalized expression

Returns:
a Set of policy alternatives

getPolicyAlternative

public PolicyAlternative getPolicyAlternative()
Retrieve an arbitrary policy alternative from the set of policy alternatives.

Returns:
returns the PolicyAlternative, or null if there are no policy alternatives in this expression.

getPolicyAlternatives

public Set getPolicyAlternatives(PolicyAssertion a)
Retrieves a Set of PolicyAlternatives that are available from this expression in which a given assertion is set

Parameters:
a - the assertion that must be set
Returns:
a Set of PolicyAlternative that contain the assertion or an empty Set if there are none or null if this expression is uninitialized

getPolicyAlternatives

public Set getPolicyAlternatives(Class assertionClass)
Retrieves a Set of PolicyAlternatives that are avaiable from this expression and in which an assertion that is an instance of the given class is set

Parameters:
assertionClass - the class of the assertion that must be set
Returns:
a Set of PolicyAlternatives that contain instances of the assertion class or an empty Set if there are none or null if this expression is uninitialized

containsPolicyAssertion

public boolean containsPolicyAssertion(Class asst)
check if contains a particular PolicyAssertion

Parameters:
asst - PolicyAssertion
Returns:
true if has the assertion

getPolicyAssertion

public PolicyAssertion getPolicyAssertion(Class assertionClass)
Retrieve a particular policy assertion object

Parameters:
assertionClass - cPolicyAssertion class object
Returns:
PolicyAssertion

toString

public String toString()
Overrides:
toString in class Object

toCompactForm

public PolicyStatement toCompactForm(String id)
Convert the normalized expression to a compact form. It will be of the form

(alternative-1) (alternative-2) etc.

Parameters:
id - the name to give the compact form of the expression
Returns:
the compact form of this normalized expression

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
implement readExternal() of Externalizable interface

Specified by:
readExternal in interface Externalizable
Parameters:
in -
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
implement writeExternal() of Externalizable interface

Specified by:
writeExternal in interface Externalizable
Parameters:
out -
Throws:
IOException

Copyright 1996, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01