org.opennms.netmgt.config.filter
Class DatabaseSchema

java.lang.Object
  extended by org.opennms.netmgt.config.filter.DatabaseSchema
All Implemented Interfaces:
Serializable

public class DatabaseSchema
extends Object
implements Serializable

Top-level element for the database-schema.xml configuration file.

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

Constructor Summary
DatabaseSchema()
           
 
Method Summary
 void addTable(int index, Table vTable)
           
 void addTable(Table vTable)
           
 Enumeration<Table> enumerateTable()
          Method enumerateTable.
 Table[] getTable()
          Method getTable.Returns the contents of the collection in an Array.
 Table getTable(int index)
          Method getTable.
 List<Table> getTableCollection()
          Method getTableCollection.Returns a reference to '_tableList'.
 int getTableCount()
          Method getTableCount.
 boolean isValid()
          Method isValid.
 Iterator<Table> iterateTable()
          Method iterateTable.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllTable()
           
 boolean removeTable(Table vTable)
          Method removeTable.
 Table removeTableAt(int index)
          Method removeTableAt.
 void setTable(int index, Table vTable)
           
 void setTable(List<Table> vTableList)
          Sets the value of '_tableList' by copying the given Vector.
 void setTable(Table[] vTableArray)
           
 void setTableCollection(List<Table> tableList)
          Deprecated.  
static DatabaseSchema 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

DatabaseSchema

public DatabaseSchema()
Method Detail

addTable

public void addTable(Table vTable)
              throws IndexOutOfBoundsException
Parameters:
vTable -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addTable

public void addTable(int index,
                     Table vTable)
              throws IndexOutOfBoundsException
Parameters:
index -
vTable -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateTable

public Enumeration<Table> enumerateTable()
Method enumerateTable.

Returns:
an Enumeration over all possible elements of this collection

getTable

public Table getTable(int index)
               throws IndexOutOfBoundsException
Method getTable.

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

getTable

public Table[] getTable()
Method getTable.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

getTableCollection

public List<Table> getTableCollection()
Method getTableCollection.Returns a reference to '_tableList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getTableCount

public int getTableCount()
Method getTableCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateTable

public Iterator<Table> iterateTable()
Method iterateTable.

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

removeAllTable

public void removeAllTable()

removeTable

public boolean removeTable(Table vTable)
Method removeTable.

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

removeTableAt

public Table removeTableAt(int index)
Method removeTableAt.

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

setTable

public void setTable(int index,
                     Table vTable)
              throws IndexOutOfBoundsException
Parameters:
index -
vTable -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setTable

public void setTable(Table[] vTableArray)
Parameters:
vTableArray -

setTable

public void setTable(List<Table> vTableList)
Sets the value of '_tableList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vTableList - the Vector to copy.

setTableCollection

public void setTableCollection(List<Table> tableList)
Deprecated. 

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

Parameters:
tableList - the Vector to set.

unmarshal

public static DatabaseSchema 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.filter.DatabaseSchema
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 © 2011. All Rights Reserved.