org.opennms.netmgt.correlation.drools.config
Class EngineConfiguration

java.lang.Object
  extended by org.opennms.netmgt.correlation.drools.config.EngineConfiguration
All Implemented Interfaces:
Serializable

public class EngineConfiguration
extends Object
implements Serializable

The top-level element of the drools-engine.xml configuration file.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
EngineConfiguration()
           
 
Method Summary
 void addRuleSet(int index, RuleSet vRuleSet)
           
 void addRuleSet(RuleSet vRuleSet)
           
 Enumeration<RuleSet> enumerateRuleSet()
          Method enumerateRuleSet.
 RuleSet[] getRuleSet()
          Method getRuleSet.Returns the contents of the collection in an Array.
 RuleSet getRuleSet(int index)
          Method getRuleSet.
 List<RuleSet> getRuleSetCollection()
          Method getRuleSetCollection.Returns a reference to '_ruleSetList'.
 int getRuleSetCount()
          Method getRuleSetCount.
 boolean isValid()
          Method isValid.
 Iterator<RuleSet> iterateRuleSet()
          Method iterateRuleSet.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllRuleSet()
           
 boolean removeRuleSet(RuleSet vRuleSet)
          Method removeRuleSet.
 RuleSet removeRuleSetAt(int index)
          Method removeRuleSetAt.
 void setRuleSet(int index, RuleSet vRuleSet)
           
 void setRuleSet(List<RuleSet> vRuleSetList)
          Sets the value of '_ruleSetList' by copying the given Vector.
 void setRuleSet(RuleSet[] vRuleSetArray)
           
 void setRuleSetCollection(List<RuleSet> ruleSetList)
          Deprecated.  
static EngineConfiguration unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EngineConfiguration

public EngineConfiguration()
Method Detail

addRuleSet

public void addRuleSet(RuleSet vRuleSet)
                throws IndexOutOfBoundsException
Parameters:
vRuleSet -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addRuleSet

public void addRuleSet(int index,
                       RuleSet vRuleSet)
                throws IndexOutOfBoundsException
Parameters:
index -
vRuleSet -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateRuleSet

public Enumeration<RuleSet> enumerateRuleSet()
Method enumerateRuleSet.

Returns:
an Enumeration over all possible elements of this collection

getRuleSet

public RuleSet getRuleSet(int index)
                   throws IndexOutOfBoundsException
Method getRuleSet.

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.correlation.drools.config.RuleSet at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getRuleSet

public RuleSet[] getRuleSet()
Method getRuleSet.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getRuleSetCollection

public List<RuleSet> getRuleSetCollection()
Method getRuleSetCollection.Returns a reference to '_ruleSetList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getRuleSetCount

public int getRuleSetCount()
Method getRuleSetCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateRuleSet

public Iterator<RuleSet> iterateRuleSet()
Method iterateRuleSet.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllRuleSet

public void removeAllRuleSet()

removeRuleSet

public boolean removeRuleSet(RuleSet vRuleSet)
Method removeRuleSet.

Parameters:
vRuleSet -
Returns:
true if the object was removed from the collection.

removeRuleSetAt

public RuleSet removeRuleSetAt(int index)
Method removeRuleSetAt.

Parameters:
index -
Returns:
the element removed from the collection

setRuleSet

public void setRuleSet(int index,
                       RuleSet vRuleSet)
                throws IndexOutOfBoundsException
Parameters:
index -
vRuleSet -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setRuleSet

public void setRuleSet(RuleSet[] vRuleSetArray)
Parameters:
vRuleSetArray -

setRuleSet

public void setRuleSet(List<RuleSet> vRuleSetList)
Sets the value of '_ruleSetList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vRuleSetList - the Vector to copy.

setRuleSetCollection

public void setRuleSetCollection(List<RuleSet> ruleSetList)
Deprecated. 

Sets the value of '_ruleSetList' by setting it to the given Vector. No type checking is performed.

Parameters:
ruleSetList - the Vector to set.

unmarshal

public static EngineConfiguration unmarshal(Reader reader)
                                     throws org.exolab.castor.xml.MarshalException,
                                            org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.correlation.drools.config.EngineConfiguration
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright ? 2008. All Rights Reserved.