org.opennms.netmgt.config.threshd
Class ThreshdConfiguration

java.lang.Object
  extended by org.opennms.netmgt.config.threshd.ThreshdConfiguration
All Implemented Interfaces:
Serializable

public class ThreshdConfiguration
extends Object
implements Serializable

Top-level element for the threshd-configuration.xml configuration file.

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

Constructor Summary
ThreshdConfiguration()
           
 
Method Summary
 void addPackage(int index, Package vPackage)
           
 void addPackage(Package vPackage)
           
 void addThresholder(int index, Thresholder vThresholder)
           
 void addThresholder(Thresholder vThresholder)
           
 void deleteThreads()
           
 Enumeration<Package> enumeratePackage()
          Method enumeratePackage.
 Enumeration<Thresholder> enumerateThresholder()
          Method enumerateThresholder.
 Package[] getPackage()
          Method getPackage.Returns the contents of the collection in an Array.
 Package getPackage(int index)
          Method getPackage.
 List<Package> getPackageCollection()
          Method getPackageCollection.Returns a reference to '_packageList'.
 int getPackageCount()
          Method getPackageCount.
 int getThreads()
          Returns the value of field 'threads'.
 Thresholder[] getThresholder()
          Method getThresholder.Returns the contents of the collection in an Array.
 Thresholder getThresholder(int index)
          Method getThresholder.
 List<Thresholder> getThresholderCollection()
          Method getThresholderCollection.Returns a reference to '_thresholderList'.
 int getThresholderCount()
          Method getThresholderCount.
 boolean hasThreads()
          Method hasThreads.
 boolean isValid()
          Method isValid.
 Iterator<Package> iteratePackage()
          Method iteratePackage.
 Iterator<Thresholder> iterateThresholder()
          Method iterateThresholder.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllPackage()
           
 void removeAllThresholder()
           
 boolean removePackage(Package vPackage)
          Method removePackage.
 Package removePackageAt(int index)
          Method removePackageAt.
 boolean removeThresholder(Thresholder vThresholder)
          Method removeThresholder.
 Thresholder removeThresholderAt(int index)
          Method removeThresholderAt.
 void setPackage(int index, Package vPackage)
           
 void setPackage(List<Package> vPackageList)
          Sets the value of '_packageList' by copying the given Vector.
 void setPackage(Package[] vPackageArray)
           
 void setPackageCollection(List<Package> _packageList)
          Deprecated.  
 void setThreads(int threads)
          Sets the value of field 'threads'.
 void setThresholder(int index, Thresholder vThresholder)
           
 void setThresholder(List<Thresholder> vThresholderList)
          Sets the value of '_thresholderList' by copying the given Vector.
 void setThresholder(Thresholder[] vThresholderArray)
           
 void setThresholderCollection(List<Thresholder> thresholderList)
          Deprecated.  
static ThreshdConfiguration 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

ThreshdConfiguration

public ThreshdConfiguration()
Method Detail

addPackage

public void addPackage(Package vPackage)
                throws IndexOutOfBoundsException
Parameters:
vPackage -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addPackage

public void addPackage(int index,
                       Package vPackage)
                throws IndexOutOfBoundsException
Parameters:
index -
vPackage -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addThresholder

public void addThresholder(Thresholder vThresholder)
                    throws IndexOutOfBoundsException
Parameters:
vThresholder -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addThresholder

public void addThresholder(int index,
                           Thresholder vThresholder)
                    throws IndexOutOfBoundsException
Parameters:
index -
vThresholder -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteThreads

public void deleteThreads()

enumeratePackage

public Enumeration<Package> enumeratePackage()
Method enumeratePackage.

Returns:
an Enumeration over all possible elements of this collection

enumerateThresholder

public Enumeration<Thresholder> enumerateThresholder()
Method enumerateThresholder.

Returns:
an Enumeration over all possible elements of this collection

getPackage

public Package getPackage(int index)
                   throws IndexOutOfBoundsException
Method getPackage.

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

getPackage

public Package[] getPackage()
Method getPackage.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

getPackageCollection

public List<Package> getPackageCollection()
Method getPackageCollection.Returns a reference to '_packageList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getPackageCount

public int getPackageCount()
Method getPackageCount.

Returns:
the size of this collection

getThreads

public int getThreads()
Returns the value of field 'threads'. The field 'threads' has the following description: Maximum number of threads used for thresholding.

Returns:
the value of field 'Threads'.

getThresholder

public Thresholder getThresholder(int index)
                           throws IndexOutOfBoundsException
Method getThresholder.

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

getThresholder

public Thresholder[] getThresholder()
Method getThresholder.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

getThresholderCollection

public List<Thresholder> getThresholderCollection()
Method getThresholderCollection.Returns a reference to '_thresholderList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getThresholderCount

public int getThresholderCount()
Method getThresholderCount.

Returns:
the size of this collection

hasThreads

public boolean hasThreads()
Method hasThreads.

Returns:
true if at least one Threads has been added

isValid

public boolean isValid()
Method isValid.

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

iteratePackage

public Iterator<Package> iteratePackage()
Method iteratePackage.

Returns:
an Iterator over all possible elements in this collection

iterateThresholder

public Iterator<Thresholder> iterateThresholder()
Method iterateThresholder.

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

removeAllPackage

public void removeAllPackage()

removeAllThresholder

public void removeAllThresholder()

removePackage

public boolean removePackage(Package vPackage)
Method removePackage.

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

removePackageAt

public Package removePackageAt(int index)
Method removePackageAt.

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

removeThresholder

public boolean removeThresholder(Thresholder vThresholder)
Method removeThresholder.

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

removeThresholderAt

public Thresholder removeThresholderAt(int index)
Method removeThresholderAt.

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

setPackage

public void setPackage(int index,
                       Package vPackage)
                throws IndexOutOfBoundsException
Parameters:
index -
vPackage -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setPackage

public void setPackage(Package[] vPackageArray)
Parameters:
vPackageArray -

setPackage

public void setPackage(List<Package> vPackageList)
Sets the value of '_packageList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vPackageList - the Vector to copy.

setPackageCollection

public void setPackageCollection(List<Package> _packageList)
Deprecated. 

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

Parameters:
_packageList - the Vector to set.

setThreads

public void setThreads(int threads)
Sets the value of field 'threads'. The field 'threads' has the following description: Maximum number of threads used for thresholding.

Parameters:
threads - the value of field 'threads'.

setThresholder

public void setThresholder(int index,
                           Thresholder vThresholder)
                    throws IndexOutOfBoundsException
Parameters:
index -
vThresholder -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setThresholder

public void setThresholder(Thresholder[] vThresholderArray)
Parameters:
vThresholderArray -

setThresholder

public void setThresholder(List<Thresholder> vThresholderList)
Sets the value of '_thresholderList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vThresholderList - the Vector to copy.

setThresholderCollection

public void setThresholderCollection(List<Thresholder> thresholderList)
Deprecated. 

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

Parameters:
thresholderList - the Vector to set.

unmarshal

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

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.threshd.ThreshdConfiguration
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.