org.rhq.domain.correlation
Class CorrelationRule

java.lang.Object
  extended by org.rhq.domain.correlation.CorrelationRule
Direct Known Subclasses:
ActionRule

public class CorrelationRule
extends java.lang.Object

A correlation rule, that takes normalized data as input. Correlation rules serve to put multiple input into relation. So it it possible to say "return red if at least one of the input are red or more then 2 inputy are yellow". The conditions themselves are stored in CorrelationItems that are hanging on this class.

Author:
Heiko W. Rupp

Constructor Summary
CorrelationRule(java.lang.String name, java.lang.String source)
          Create a new correlation rule.
 
Method Summary
 void addItem(CorrelationItem item)
          Add a new CorrelationItem to the list of items for this rule
 java.util.List<CorrelationItem> getItems()
          Obtain the CorrelationItems for this rule
 java.lang.String getRuleName()
          Get the name of this rule
 java.util.Set<java.lang.String> getSourceRules()
          Return the list of all source rules for this rule
 void setItems(java.util.List<CorrelationItem> items)
          Set a new list of CorrelationItem for this rule
 java.lang.String toString()
          Human readable form for of this rule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CorrelationRule

public CorrelationRule(java.lang.String name,
                       java.lang.String source)
Create a new correlation rule. One source is required and may not be this rule.

Parameters:
name - Name of the rule
source - The first (and required) input source
Method Detail

getSourceRules

public java.util.Set<java.lang.String> getSourceRules()
Return the list of all source rules for this rule

Returns:
list of souces

toString

public java.lang.String toString()
Human readable form for of this rule

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this rule

getRuleName

public java.lang.String getRuleName()
Get the name of this rule

Returns:
name of this rule

getItems

public java.util.List<CorrelationItem> getItems()
Obtain the CorrelationItems for this rule

Returns:
the items that make up this rule

setItems

public void setItems(java.util.List<CorrelationItem> items)
Set a new list of CorrelationItem for this rule

Parameters:
items - a new List of CorrelationItem

addItem

public void addItem(CorrelationItem item)
Add a new CorrelationItem to the list of items for this rule

Parameters:
item - an additional CorrelationItem