org.opennms.netmgt.config.collectd
Class Mbeans

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

public class Mbeans
extends Object
implements Serializable

Class Mbeans.

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

Constructor Summary
Mbeans()
           
 
Method Summary
 void addMbean(int index, Mbean vMbean)
           
 void addMbean(Mbean vMbean)
           
 Enumeration<Mbean> enumerateMbean()
          Method enumerateMbean.
 Mbean[] getMbean()
          Method getMbean.Returns the contents of the collection in an Array.
 Mbean getMbean(int index)
          Method getMbean.
 List<Mbean> getMbeanCollection()
          Method getMbeanCollection.Returns a reference to '_mbeanList'.
 int getMbeanCount()
          Method getMbeanCount.
 boolean isValid()
          Method isValid.
 Iterator<Mbean> iterateMbean()
          Method iterateMbean.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllMbean()
           
 boolean removeMbean(Mbean vMbean)
          Method removeMbean.
 Mbean removeMbeanAt(int index)
          Method removeMbeanAt.
 void setMbean(int index, Mbean vMbean)
           
 void setMbean(List<Mbean> vMbeanList)
          Sets the value of '_mbeanList' by copying the given Vector.
 void setMbean(Mbean[] vMbeanArray)
           
 void setMbeanCollection(List<Mbean> mbeanList)
          Deprecated.  
static Mbeans 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

Mbeans

public Mbeans()
Method Detail

addMbean

public void addMbean(Mbean vMbean)
              throws IndexOutOfBoundsException
Parameters:
vMbean -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addMbean

public void addMbean(int index,
                     Mbean vMbean)
              throws IndexOutOfBoundsException
Parameters:
index -
vMbean -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateMbean

public Enumeration<Mbean> enumerateMbean()
Method enumerateMbean.

Returns:
an Enumeration over all possible elements of this collection

getMbean

public Mbean getMbean(int index)
               throws IndexOutOfBoundsException
Method getMbean.

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

getMbean

public Mbean[] getMbean()
Method getMbean.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

getMbeanCollection

public List<Mbean> getMbeanCollection()
Method getMbeanCollection.Returns a reference to '_mbeanList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getMbeanCount

public int getMbeanCount()
Method getMbeanCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateMbean

public Iterator<Mbean> iterateMbean()
Method iterateMbean.

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

removeAllMbean

public void removeAllMbean()

removeMbean

public boolean removeMbean(Mbean vMbean)
Method removeMbean.

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

removeMbeanAt

public Mbean removeMbeanAt(int index)
Method removeMbeanAt.

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

setMbean

public void setMbean(int index,
                     Mbean vMbean)
              throws IndexOutOfBoundsException
Parameters:
index -
vMbean -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setMbean

public void setMbean(Mbean[] vMbeanArray)
Parameters:
vMbeanArray -

setMbean

public void setMbean(List<Mbean> vMbeanList)
Sets the value of '_mbeanList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vMbeanList - the Vector to copy.

setMbeanCollection

public void setMbeanCollection(List<Mbean> mbeanList)
Deprecated. 

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

Parameters:
mbeanList - the Vector to set.

unmarshal

public static Mbeans 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.Mbeans
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.