org.pentaho.di.core.config
Class DatabaseConfigManager<T>

java.lang.Object
  extended by org.pentaho.di.core.config.BasicConfigManager<T>
      extended by org.pentaho.di.core.config.DatabaseConfigManager<T>
Type Parameters:
T -
All Implemented Interfaces:
ConfigManager<T>

public class DatabaseConfigManager<T>
extends BasicConfigManager<T>

A ConfigManager implementation that caters to loading configuration parameters from a database table.

Author:
Alex Silva

Constructor Summary
DatabaseConfigManager()
           
 
Method Summary
 String getConnectionURL()
           
 String getTable()
           
 Collection<T> load()
          Loads the configuration parameters.
<E> Collection<E>
loadAs(Class<? extends E> type)
          Similar to load(), but allows callers to dynamically cast the underlying collection to a specific type.
 void setConnectionURL(String connectionURL)
           
 void setTable(String table)
           
 
Methods inherited from class org.pentaho.di.core.config.BasicConfigManager
getId, setId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseConfigManager

public DatabaseConfigManager()
Method Detail

getConnectionURL

public String getConnectionURL()

setConnectionURL

@Inject
public void setConnectionURL(String connectionURL)

getTable

public String getTable()

setTable

@Inject
public void setTable(String table)

load

public Collection<T> load()
                   throws org.pentaho.di.core.exception.KettleConfigException
Description copied from interface: ConfigManager
Loads the configuration parameters.

Returns:
A collection containing the parameters
Throws:
org.pentaho.di.core.exception.KettleConfigException - If an error occurs during load.

loadAs

public <E> Collection<E> loadAs(Class<? extends E> type)
                     throws org.pentaho.di.core.exception.KettleConfigException
Description copied from interface: ConfigManager
Similar to load(), but allows callers to dynamically cast the underlying collection to a specific type. This is useful for callers who are instantiating this class dynamically and don't know the expected return type until load is called.

Specified by:
loadAs in interface ConfigManager<T>
Overrides:
loadAs in class BasicConfigManager<T>
Type Parameters:
E - The type of the objects managed by this implementation.
Parameters:
type - A class representing this type.
Returns:
A collection of the parameters.
Throws:
org.pentaho.di.core.exception.KettleConfigException - If a loading problem occurs. Implementations are also required to throw this exception if cannot be cast to