org.opennms.netmgt.config.opennmsDataSources
Class JdbcDataSource

java.lang.Object
  extended by org.opennms.netmgt.config.opennmsDataSources.JdbcDataSource
All Implemented Interfaces:
Serializable

public class JdbcDataSource
extends Object
implements Serializable

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

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

Constructor Summary
JdbcDataSource()
           
 
Method Summary
 void addParam(int index, Param vParam)
           
 void addParam(Param vParam)
           
 Enumeration<Param> enumerateParam()
          Method enumerateParam.
 String getClassName()
          Returns the value of field 'className'.
 String getName()
          Returns the value of field 'name'.
 Param[] getParam()
          Method getParam.Returns the contents of the collection in an Array.
 Param getParam(int index)
          Method getParam.
 List<Param> getParamCollection()
          Method getParamCollection.Returns a reference to '_paramList'.
 int getParamCount()
          Method getParamCount.
 String getPassword()
          Returns the value of field 'password'.
 String getUrl()
          Returns the value of field 'url'.
 String getUserName()
          Returns the value of field 'userName'.
 boolean isValid()
          Method isValid.
 Iterator<Param> iterateParam()
          Method iterateParam.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllParam()
           
 boolean removeParam(Param vParam)
          Method removeParam.
 Param removeParamAt(int index)
          Method removeParamAt.
 void setClassName(String className)
          Sets the value of field 'className'.
 void setName(String name)
          Sets the value of field 'name'.
 void setParam(int index, Param vParam)
           
 void setParam(List<Param> vParamList)
          Sets the value of '_paramList' by copying the given Vector.
 void setParam(Param[] vParamArray)
           
 void setParamCollection(List<Param> paramList)
          Deprecated.  
 void setPassword(String password)
          Sets the value of field 'password'.
 void setUrl(String url)
          Sets the value of field 'url'.
 void setUserName(String userName)
          Sets the value of field 'userName'.
static JdbcDataSource 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

JdbcDataSource

public JdbcDataSource()
Method Detail

addParam

public void addParam(Param vParam)
              throws IndexOutOfBoundsException
Parameters:
vParam -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addParam

public void addParam(int index,
                     Param vParam)
              throws IndexOutOfBoundsException
Parameters:
index -
vParam -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateParam

public Enumeration<Param> enumerateParam()
Method enumerateParam.

Returns:
an Enumeration over all possible elements of this collection

getClassName

public String getClassName()
Returns the value of field 'className'.

Returns:
the value of field 'ClassName'.

getName

public String getName()
Returns the value of field 'name'.

Returns:
the value of field 'Name'.

getParam

public Param getParam(int index)
               throws IndexOutOfBoundsException
Method getParam.

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

getParam

public Param[] getParam()
Method getParam.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

getParamCollection

public List<Param> getParamCollection()
Method getParamCollection.Returns a reference to '_paramList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getParamCount

public int getParamCount()
Method getParamCount.

Returns:
the size of this collection

getPassword

public String getPassword()
Returns the value of field 'password'.

Returns:
the value of field 'Password'.

getUrl

public String getUrl()
Returns the value of field 'url'.

Returns:
the value of field 'Url'.

getUserName

public String getUserName()
Returns the value of field 'userName'.

Returns:
the value of field 'UserName'.

isValid

public boolean isValid()
Method isValid.

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

iterateParam

public Iterator<Param> iterateParam()
Method iterateParam.

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

removeAllParam

public void removeAllParam()

removeParam

public boolean removeParam(Param vParam)
Method removeParam.

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

removeParamAt

public Param removeParamAt(int index)
Method removeParamAt.

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

setClassName

public void setClassName(String className)
Sets the value of field 'className'.

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

setName

public void setName(String name)
Sets the value of field 'name'.

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

setParam

public void setParam(int index,
                     Param vParam)
              throws IndexOutOfBoundsException
Parameters:
index -
vParam -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setParam

public void setParam(Param[] vParamArray)
Parameters:
vParamArray -

setParam

public void setParam(List<Param> vParamList)
Sets the value of '_paramList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vParamList - the Vector to copy.

setParamCollection

public void setParamCollection(List<Param> paramList)
Deprecated. 

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

Parameters:
paramList - the Vector to set.

setPassword

public void setPassword(String password)
Sets the value of field 'password'.

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

setUrl

public void setUrl(String url)
Sets the value of field 'url'.

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

setUserName

public void setUserName(String userName)
Sets the value of field 'userName'.

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

unmarshal

public static JdbcDataSource 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.opennmsDataSources.JdbcDataSource
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.