org.opennms.netmgt.config.collectd
Class CollectdConfiguration

java.lang.Object
  extended by org.opennms.netmgt.config.collectd.CollectdConfiguration
All Implemented Interfaces:
Serializable

public class CollectdConfiguration
extends Object
implements Serializable

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

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

Constructor Summary
CollectdConfiguration()
           
 
Method Summary
 void addCollector(Collector vCollector)
           
 void addCollector(int index, Collector vCollector)
           
 void addPackage(int index, Package vPackage)
           
 void addPackage(Package vPackage)
           
 void deleteThreads()
           
 Enumeration<Collector> enumerateCollector()
          Method enumerateCollector.
 Enumeration<Package> enumeratePackage()
          Method enumeratePackage.
 Collector[] getCollector()
          Method getCollector.Returns the contents of the collection in an Array.
 Collector getCollector(int index)
          Method getCollector.
 List<Collector> getCollectorCollection()
          Method getCollectorCollection.Returns a reference to '_collectorList'.
 int getCollectorCount()
          Method getCollectorCount.
 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'.
 boolean hasThreads()
          Method hasThreads.
 boolean isValid()
          Method isValid.
 Iterator<Collector> iterateCollector()
          Method iterateCollector.
 Iterator<Package> iteratePackage()
          Method iteratePackage.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllCollector()
           
 void removeAllPackage()
           
 boolean removeCollector(Collector vCollector)
          Method removeCollector.
 Collector removeCollectorAt(int index)
          Method removeCollectorAt.
 boolean removePackage(Package vPackage)
          Method removePackage.
 Package removePackageAt(int index)
          Method removePackageAt.
 void setCollector(Collector[] vCollectorArray)
           
 void setCollector(int index, Collector vCollector)
           
 void setCollector(List<Collector> vCollectorList)
          Sets the value of '_collectorList' by copying the given Vector.
 void setCollectorCollection(List<Collector> collectorList)
          Deprecated.  
 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'.
static CollectdConfiguration 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

CollectdConfiguration

public CollectdConfiguration()
Method Detail

addCollector

public void addCollector(Collector vCollector)
                  throws IndexOutOfBoundsException
Parameters:
vCollector -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addCollector

public void addCollector(int index,
                         Collector vCollector)
                  throws IndexOutOfBoundsException
Parameters:
index -
vCollector -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

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

deleteThreads

public void deleteThreads()

enumerateCollector

public Enumeration<Collector> enumerateCollector()
Method enumerateCollector.

Returns:
an Enumeration over all possible elements of this collection

enumeratePackage

public Enumeration<Package> enumeratePackage()
Method enumeratePackage.

Returns:
an Enumeration over all possible elements of this collection

getCollector

public Collector getCollector(int index)
                       throws IndexOutOfBoundsException
Method getCollector.

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

getCollector

public Collector[] getCollector()
Method getCollector.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

getCollectorCollection

public List<Collector> getCollectorCollection()
Method getCollectorCollection.Returns a reference to '_collectorList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getCollectorCount

public int getCollectorCount()
Method getCollectorCount.

Returns:
the size of this collection

getPackage

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

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.collectd.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: The maximum number of threads used for data collection.

Returns:
the value of field 'Threads'.

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

iterateCollector

public Iterator<Collector> iterateCollector()
Method iterateCollector.

Returns:
an Iterator over all possible elements in this collection

iteratePackage

public Iterator<Package> iteratePackage()
Method iteratePackage.

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

removeAllCollector

public void removeAllCollector()

removeAllPackage

public void removeAllPackage()

removeCollector

public boolean removeCollector(Collector vCollector)
Method removeCollector.

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

removeCollectorAt

public Collector removeCollectorAt(int index)
Method removeCollectorAt.

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

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

setCollector

public void setCollector(int index,
                         Collector vCollector)
                  throws IndexOutOfBoundsException
Parameters:
index -
vCollector -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setCollector

public void setCollector(Collector[] vCollectorArray)
Parameters:
vCollectorArray -

setCollector

public void setCollector(List<Collector> vCollectorList)
Sets the value of '_collectorList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vCollectorList - the Vector to copy.

setCollectorCollection

public void setCollectorCollection(List<Collector> collectorList)
Deprecated. 

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

Parameters:
collectorList - the Vector to set.

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: The maximum number of threads used for data collection.

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

unmarshal

public static CollectdConfiguration 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.collectd.CollectdConfiguration
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.