|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.cargo.container.property.DataSourceConverter
public class DataSourceConverter
A DataSource is a representation of an database pool bound to JNDI. This converter will take a property and convert it to a DataSource and visa versa.
| Constructor Summary | |
|---|---|
DataSourceConverter()
|
|
| Method Summary | |
|---|---|
Resource |
convertToResource(DataSource ds,
java.lang.String resourceType,
java.lang.String driverParameter)
This method converts the DataSource to a Resource. |
protected static java.lang.String |
createIdFromJndiLocation(java.lang.String jndiLocation)
Get a string name for the configuration of this datasource. |
DataSource |
fromProperties(java.util.Properties properties)
Construct a DataSource from a list of properties. |
DataSource |
fromPropertyString(java.lang.String datasourceInformation)
Construct a DataSource from a single String. |
java.lang.String |
getConnectionPropertiesAsASemicolonDelimitedString(DataSource data)
tests to see if the value is null before attempting to join the database properties on a semicolon. |
java.util.Properties |
toProperties(DataSource data)
Get a properties object containing all of the members of this datasource object. |
java.lang.String |
toPropertyString(DataSource data)
Get a string representation of this datasource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataSourceConverter()
| Method Detail |
|---|
public DataSource fromPropertyString(java.lang.String datasourceInformation)
CreateDatabase=create;DatabaseName=TEST.
datasourceInformation - A string, really a list of properties, representing a datasource
PropertyUtils.splitPropertiesOnPipe(String)public DataSource fromProperties(java.util.Properties properties)
properties - A list of properties representing this datasource
PropertyUtils.splitPropertiesOnPipe(String)protected static java.lang.String createIdFromJndiLocation(java.lang.String jndiLocation)
jndiLocation - used to construct the id
public java.lang.String toPropertyString(DataSource data)
data - DataSource to serialize into a string.
PropertyUtils#joinPropertiesOnPipe(java.util.Properties)public java.util.Properties toProperties(DataSource data)
data - DataSource to serialize into properties.
public java.lang.String getConnectionPropertiesAsASemicolonDelimitedString(DataSource data)
data - DataSource to parse connection properties from.
public Resource convertToResource(DataSource ds,
java.lang.String resourceType,
java.lang.String driverParameter)
ds - DataSource to convert to a resource.resourceType - the type of the Resource to convert to. ex.
javax.sql.DataSourcedriverParameter - the name of the parameter to store driverClass.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||