|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.api.config.ds.DataSourceConfiguration
public final class DataSourceConfiguration
Configuration to access a data source via JNDI.
The following properties are valid:
"de.smartics.properties.ds.jndiName"
- the name of the data source in the JNDI."de.smartics.properties.ds.dropTable"
- flag to drop the configuration table if set to true
(usually this should only be used in test environments)."de.smartics.properties.ds.createTable"
- flag to create the configuration table if set to true
. The property CONFIG_SOURCE_ID
allows to track the source of the configuration information.
Field Summary | |
---|---|
static String |
CONFIG_SOURCE_ID The identifier of the configuration for the data source. |
static String |
CREATE_TABLE The key to flag to create the configuration table in the data source. |
static String |
DROP_TABLE The key to flag to drop the configuration table in the data source. |
static String |
JNDI_NAME The key to the JNDI name of the data source. |
Constructor Summary | |
---|---|
DataSourceConfiguration() Convenience constructor to construct the instance first and set properties afterwards. |
|
DataSourceConfiguration(Properties properties) Default constructor. |
|
DataSourceConfiguration(String configSourceId, String jndiName, boolean dropTable, boolean createTable) Default constructor. |
Method Summary | |
---|---|
String |
getConfigSourceId() Returns the source of the data source configuration. |
String |
getJndiName() Returns the name of the data source to lookup in a JNDI context. |
boolean |
isCreateTable() Returns the flag to create the configuration table if set to true . |
boolean |
isDropTable() Returns the flag to drop the configuration table if set to true . |
boolean |
isUnset() Checks whether or not the configuration has value. |
void |
setCreateTable(boolean createTable) Sets the flag to create the configuration if set to true . |
void |
setDropTable(boolean dropTable) Sets the flag to drop the configuration table if set to true . |
void |
setJndiName(String jndiName) Sets the name of the data source to lookup in a JNDI context. |
String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONFIG_SOURCE_ID
"de.smartics.properties.ds.id"
public static final String JNDI_NAME
"de.smartics.properties.ds.jndiName"
public static final String DROP_TABLE
"de.smartics.properties.ds.dropTable"
public static final String CREATE_TABLE
"de.smartics.properties.ds.createTable"
Constructor Detail |
---|
public DataSourceConfiguration(String configSourceId, String jndiName, boolean dropTable, boolean createTable)
configSourceId
- the source of the data source configuration.
jndiName
- the jndi name.
dropTable
- the boolean whether or not existing tables shall be dropped.
createTable
- the boolean whether or the tables shall be created, if they do not exist already
public DataSourceConfiguration(Properties properties)
properties
- the properties containing jndiName, dropTable and createTable.
public DataSourceConfiguration()
Method Detail |
---|
public String getConfigSourceId()
public String getJndiName()
public void setJndiName(String jndiName)
jndiName
- the name of the data source to lookup in a JNDI context.
public boolean isDropTable()
true
.
true
.
public void setDropTable(boolean dropTable)
true
.
dropTable
- the flag to drop the configuration table if set to
true
.
public boolean isCreateTable()
true
.
true
.
public void setCreateTable(boolean createTable)
true
.
createTable
- the flag to create the configuration if set to
true
.
public boolean isUnset()
true
if the configuration is unset,
false
otherwise.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |