com.ibm.di.config.interfaces
Class TDIProperties

java.lang.Object
  extended by com.ibm.di.config.interfaces.TDIProperties
All Implemented Interfaces:
Serializable

public class TDIProperties
extends Object
implements Serializable

This class provides access to the property stores defined for a specific configuration instance.

See Also:
Serialized Form

Field Summary
static String KEY_ATTRIBUTE
           
static Log logger
          This is the logger object used by this class and other configuration drivers.
protected  PropertyManager pm
           
static String PROTECT_ATTRIBUTE
           
protected  List<TDIPropertyStore> stores
           
static String VALUE_ATTRIBUTE
           
 
Constructor Summary
TDIProperties()
           
TDIProperties(MetamergeConfig mc)
          TDIProperties constructor to create instance for a specified Config.
TDIProperties(MetamergeConfig mc, boolean initStores)
           
 
Method Summary
 void addPropertyStore(PropertyStoreConfig config)
          Adds a property store to the end of the list of TDI-P's list of property stores.
 void commit()
          Does a commit on all property stores
 void debug(String msg)
           
 TDIPropertyStore getDefaultStore()
           
 MetamergeConfig getMetamergeConfig()
          Returns the MetamergeConfig to which this object belongs.
 TDIPropertyStore getPasswordStore()
           
 Object getProperty(String key)
          Gets the property value from the property store chosen by TDIProperties.
 Object getProperty(String propertyStoreName, String key)
          Returns the property value from the named property store.
 Entry getPropertyEntry(String key)
          Returns the Entry object for a key - this is the same call as getProperty(key) only the Entry object is returned for the property.
 TDIPropertyStore getPropertyStore(String name)
           
 Iterator<String> getPropertyStoreKeys(String propertyStoreName)
          Returns an Iterator for all the property keys in the named property store.
 List<String> getPropertyStoreNames()
          Returns a list of property store names in use by TDI-P.
 int indexOf(String name)
          Returns the index for a named property store
 void initStores()
           
 void insertPropertyStore(PropertyStoreConfig config, int atIndex)
          Inserts a connector interface at the given index.
 void logerror(String msg)
           
 void removeProperty(String propertyStoreName, String key)
          Removes a property in the named property store.
 void removePropertyStore(String propertyStoreName)
          Removes a property store from TDI-P.
protected  List<TDIPropertyStore> selectStore(String key, boolean read)
          Returns the preferred store for a property key
protected  TDIProperties selectTDIProperties(String key, TDIProperties defaultProps)
          Returns the TDIProperties object associated with the key.
 void setDefaultStore(TDIPropertyStore defaultStore)
           
 void setPasswordStore(TDIPropertyStore passwordStore)
           
 TDIPropertyStore setProperty(String key, Object value)
          Sets the property in the property store chosen by TDIProperties.
 TDIPropertyStore setProperty(String key, Object value, boolean protect)
          Sets the property in the property store chosen by TDIProperties.
 void setProperty(String propertyStoreName, String key, Object value)
          Sets a property in the named property store.
 String trimKey(String key)
           
 void warn(String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Log logger
This is the logger object used by this class and other configuration drivers.


KEY_ATTRIBUTE

public static final String KEY_ATTRIBUTE
See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final String VALUE_ATTRIBUTE
See Also:
Constant Field Values

PROTECT_ATTRIBUTE

public static final String PROTECT_ATTRIBUTE
See Also:
Constant Field Values

stores

protected List<TDIPropertyStore> stores

pm

protected PropertyManager pm
Constructor Detail

TDIProperties

public TDIProperties()

TDIProperties

public TDIProperties(MetamergeConfig mc)
              throws Exception
TDIProperties constructor to create instance for a specified Config.

Parameters:
mc -
Throws:
Exception

TDIProperties

public TDIProperties(MetamergeConfig mc,
                     boolean initStores)
              throws Exception
Throws:
Exception
Method Detail

getMetamergeConfig

public MetamergeConfig getMetamergeConfig()
Returns the MetamergeConfig to which this object belongs.

Returns:

initStores

public void initStores()

debug

public void debug(String msg)

warn

public void warn(String msg)

logerror

public void logerror(String msg)

commit

public void commit()
            throws Exception
Does a commit on all property stores

Throws:
Exception

getProperty

public Object getProperty(String key)
                   throws Exception
Gets the property value from the property store chosen by TDIProperties.

Parameters:
key - The property name
Returns:
The property value
Throws:
Exception - Runtime or security exception

setProperty

public TDIPropertyStore setProperty(String key,
                                    Object value)
                             throws Exception
Sets the property in the property store chosen by TDIProperties. The returned TDIPropertyStore is the store to which the key/value pair was written.

Parameters:
key - The property name
value - The new property value
Throws:
Exception - Runtime or security exception

setProperty

public TDIPropertyStore setProperty(String key,
                                    Object value,
                                    boolean protect)
                             throws Exception
Sets the property in the property store chosen by TDIProperties. The returned TDIPropertyStore is the store to which the key/value pair was written.

Parameters:
key - The property name
value - The new property value
protect - True if value should be protected (driver dependent)
Throws:
Exception - Runtime or security exception

removeProperty

public void removeProperty(String propertyStoreName,
                           String key)
                    throws Exception
Removes a property in the named property store.

Parameters:
propertyStoreName - The name of the property store
key - The property to delete
Throws:
Exception

getProperty

public Object getProperty(String propertyStoreName,
                          String key)
                   throws Exception
Returns the property value from the named property store.

Parameters:
propertyStoreName - The name of the property store
key - The property value
Returns:
The property value
Throws:
Exception - Runtime or security exception

setProperty

public void setProperty(String propertyStoreName,
                        String key,
                        Object value)
                 throws Exception
Sets a property in the named property store.

Parameters:
propertyStoreName - The name of the property store
key - The property value
value - The new property value
Throws:
Exception - Runtime or security exception

getPropertyEntry

public Entry getPropertyEntry(String key)
                       throws Exception
Returns the Entry object for a key - this is the same call as getProperty(key) only the Entry object is returned for the property.

Throws:
Exception

getPropertyStoreKeys

public Iterator<String> getPropertyStoreKeys(String propertyStoreName)
                                      throws Exception
Returns an Iterator for all the property keys in the named property store.

Parameters:
propertyStoreName - The name of the property store
Returns:
The propertyStoreKeys value
Throws:
Exception - Runtime or security exception

addPropertyStore

public void addPropertyStore(PropertyStoreConfig config)
                      throws Exception
Adds a property store to the end of the list of TDI-P's list of property stores.

Parameters:
config - The property store configuration
Throws:
Exception - Runtime or security exception

insertPropertyStore

public void insertPropertyStore(PropertyStoreConfig config,
                                int atIndex)
                         throws Exception
Inserts a connector interface at the given index. See addPropertyStore() for a description of parameters.

Parameters:
config - The property store configuration
atIndex - The position where the new connector is placed (-1 = END, 0 = First)
Throws:
Exception - Runtime or security exception

removePropertyStore

public void removePropertyStore(String propertyStoreName)
                         throws Exception
Removes a property store from TDI-P. The connector interface is closed and then removed.

Parameters:
propertyStoreName - The name of the property store
Throws:
Exception - Runtime or security exception

getPropertyStoreNames

public List<String> getPropertyStoreNames()
Returns a list of property store names in use by TDI-P.

Returns:
The propertyStoreNames value

indexOf

public int indexOf(String name)
Returns the index for a named property store

Parameters:
name - Name of property store
Returns:
The position of the property store

selectStore

protected List<TDIPropertyStore> selectStore(String key,
                                             boolean read)
Returns the preferred store for a property key


getDefaultStore

public TDIPropertyStore getDefaultStore()

setDefaultStore

public void setDefaultStore(TDIPropertyStore defaultStore)

getPasswordStore

public TDIPropertyStore getPasswordStore()

setPasswordStore

public void setPasswordStore(TDIPropertyStore passwordStore)

getPropertyStore

public TDIPropertyStore getPropertyStore(String name)

trimKey

public String trimKey(String key)

selectTDIProperties

protected TDIProperties selectTDIProperties(String key,
                                            TDIProperties defaultProps)
Returns the TDIProperties object associated with the key. If the key has a ref to another project/config we return that. Otherwise the defaultProps is returned. (store:property@referencedMC)

Parameters:
key -
defaultProps -
Returns: