com.ibm.websphere.fabric.da
Class CompositePolicy<A extends PolicyAssertion,M extends Moment>

java.lang.Object
  extended by com.ibm.websphere.fabric.types.CompositePolicy<A,M>
      extended by com.ibm.websphere.fabric.da.CompositePolicy<A,M>
Type Parameters:
A - formal type paramater indicating the type of PolicyAssertion used by this class
M - formal type parameter indicating the type of Moment used by this class
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<A>

public abstract class CompositePolicy<A extends PolicyAssertion,M extends Moment>
extends CompositePolicy<A,M>
implements java.io.Serializable, java.lang.Iterable<A>

A (usually complex) policy that was computed by reconciling zero or more simpler policies.

Each such policy is applicable under certain contexts, and when applicable, assert a need or preference for constraints. When a collection of applicable policies are expressed as a single composite policy, that policy defines the dis-ambiguated constraints where any contradictions have been reconciled. For example, the following policies:

  1. If patient is a member of HMO-x, then patient should use generic-drugs
  2. If patient is a CxO level employee, then patient should use best-drugs
  3. If patient lives on East Coast, then patient should mail-order medicine from store-y
May get collapsed to this user (who is a CIO in New York) should order best-drugs from store-y. Note that the contradictory constraints use generic-drugs and use best-drugs are reconciled in the composite policy.

Policies are typically applicable from a specific moment until another specific moment. This timespan is described by the effective moment and expiration moment; the entire range referred to as the effectivity range. When a collection of such policies are merged into a composite policy, then the composite policy inherits an effective moment equal to the latest of the applicable policies' effective moments, and an expiration moment equal to the earliest of the policies' expiration moments.

This class is not intended for subclass by external clients.

Version:
$Id: $
Author:
dilumr@us.ibm.com
See Also:
Serialized Form

Constructor Summary
CompositePolicy()
           
 
Method Summary
abstract  A getAssertionAt(int index)
          Gets the assertion at the specified index.
abstract  M getEffectiveDate()
          Gets the moment indicating the earliest moment at which this policy is applicable.
abstract  M getExpiration()
          Gets the earliest moment after the effective moment when this policy stops being applicable.
 
Methods inherited from class com.ibm.websphere.fabric.types.CompositePolicy
getAssertionCount, getAssertionsForType, getSourcePolicyIds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

CompositePolicy

public CompositePolicy()
Method Detail

getEffectiveDate

public abstract M getEffectiveDate()
Gets the moment indicating the earliest moment at which this policy is applicable.

Specified by:
getEffectiveDate in class CompositePolicy<A extends PolicyAssertion,M extends Moment>
Returns:
non-null moment.

getExpiration

public abstract M getExpiration()
Gets the earliest moment after the effective moment when this policy stops being applicable.

Specified by:
getExpiration in class CompositePolicy<A extends PolicyAssertion,M extends Moment>
Returns:
non-null moment.

getAssertionAt

public abstract A getAssertionAt(int index)
Gets the assertion at the specified index. The ordering of the assertions have no significance, but this operation is idempotent; repeated calls with the same index will return the same assertion.

Specified by:
getAssertionAt in class CompositePolicy<A extends PolicyAssertion,M extends Moment>
Parameters:
index - zero-based index of the desired assertion
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is outside the range [0, getAssertionCount()).


Copyright © 2002-2009 IBM. All Rights Reserved.