Package com.ibm.di.config.interfaces
Class TDIProperties
- java.lang.Object
-
- com.ibm.di.config.interfaces.TDIProperties
-
- All Implemented Interfaces:
java.io.Serializable
public class TDIProperties extends java.lang.Object implements java.io.SerializableThis class provides access to the property stores defined for a specific configuration instance.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEY_ATTRIBUTEstatic LogloggerThis is the logger object used by this class and other configuration drivers.protected PropertyManagerpmstatic java.lang.StringPROTECT_ATTRIBUTEprotected java.util.List<TDIPropertyStore>storesstatic java.lang.StringVALUE_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description TDIProperties()TDIProperties(MetamergeConfig mc)TDIProperties constructor to create instance for a specified Config.TDIProperties(MetamergeConfig mc, boolean initStores)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyStore(PropertyStoreConfig config)Adds a property store to the end of the list of TDI-P's list of property stores.voidcommit()Does a commit on all property storesvoiddebug(java.lang.String msg)TDIPropertyStoregetDefaultStore()MetamergeConfiggetMetamergeConfig()Returns the MetamergeConfig to which this object belongs.TDIPropertyStoregetPasswordStore()java.lang.ObjectgetProperty(java.lang.String key)Gets the property value from the property store chosen by TDIProperties.java.lang.ObjectgetProperty(java.lang.String propertyStoreName, java.lang.String key)Returns the property value from the named property store.EntrygetPropertyEntry(java.lang.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.TDIPropertyStoregetPropertyStore(java.lang.String name)java.util.Iterator<java.lang.String>getPropertyStoreKeys(java.lang.String propertyStoreName)Returns an Iterator for all the property keys in the named property store.java.util.List<java.lang.String>getPropertyStoreNames()Returns a list of property store names in use by TDI-P.intindexOf(java.lang.String name)Returns the index for a named property storevoidinitStores()voidinsertPropertyStore(PropertyStoreConfig config, int atIndex)Inserts a connector interface at the given index.voidlogerror(java.lang.String msg)voidremoveProperty(java.lang.String propertyStoreName, java.lang.String key)Removes a property in the named property store.voidremovePropertyStore(java.lang.String propertyStoreName)Removes a property store from TDI-P.protected java.util.List<TDIPropertyStore>selectStore(java.lang.String key, boolean read)Returns the preferred store for a property keyprotected TDIPropertiesselectTDIProperties(java.lang.String key, TDIProperties defaultProps)Returns the TDIProperties object associated with the key.voidsetDefaultStore(TDIPropertyStore defaultStore)voidsetPasswordStore(TDIPropertyStore passwordStore)TDIPropertyStoresetProperty(java.lang.String key, java.lang.Object value)Sets the property in the property store chosen by TDIProperties.TDIPropertyStoresetProperty(java.lang.String key, java.lang.Object value, boolean protect)Sets the property in the property store chosen by TDIProperties.voidsetProperty(java.lang.String propertyStoreName, java.lang.String key, java.lang.Object value)Sets a property in the named property store.java.lang.StringtrimKey(java.lang.String key)voidwarn(java.lang.String msg)
-
-
-
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 java.lang.String KEY_ATTRIBUTE
- See Also:
- Constant Field Values
-
VALUE_ATTRIBUTE
public static final java.lang.String VALUE_ATTRIBUTE
- See Also:
- Constant Field Values
-
PROTECT_ATTRIBUTE
public static final java.lang.String PROTECT_ATTRIBUTE
- See Also:
- Constant Field Values
-
stores
protected java.util.List<TDIPropertyStore> stores
-
pm
protected PropertyManager pm
-
-
Constructor Detail
-
TDIProperties
public TDIProperties()
-
TDIProperties
public TDIProperties(MetamergeConfig mc) throws java.lang.Exception
TDIProperties constructor to create instance for a specified Config.- Parameters:
mc-- Throws:
java.lang.Exception
-
TDIProperties
public TDIProperties(MetamergeConfig mc, boolean initStores) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
getMetamergeConfig
public MetamergeConfig getMetamergeConfig()
Returns the MetamergeConfig to which this object belongs.- Returns:
-
initStores
public void initStores()
-
debug
public void debug(java.lang.String msg)
-
warn
public void warn(java.lang.String msg)
-
logerror
public void logerror(java.lang.String msg)
-
commit
public void commit() throws java.lang.ExceptionDoes a commit on all property stores- Throws:
java.lang.Exception
-
getProperty
public java.lang.Object getProperty(java.lang.String key) throws java.lang.ExceptionGets the property value from the property store chosen by TDIProperties.- Parameters:
key- The property name- Returns:
- The property value
- Throws:
java.lang.Exception- Runtime or security exception
-
setProperty
public TDIPropertyStore setProperty(java.lang.String key, java.lang.Object value) throws java.lang.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 namevalue- The new property value- Throws:
java.lang.Exception- Runtime or security exception
-
setProperty
public TDIPropertyStore setProperty(java.lang.String key, java.lang.Object value, boolean protect) throws java.lang.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 namevalue- The new property valueprotect- True if value should be protected (driver dependent)- Throws:
java.lang.Exception- Runtime or security exception
-
removeProperty
public void removeProperty(java.lang.String propertyStoreName, java.lang.String key) throws java.lang.ExceptionRemoves a property in the named property store.- Parameters:
propertyStoreName- The name of the property storekey- The property to delete- Throws:
java.lang.Exception
-
getProperty
public java.lang.Object getProperty(java.lang.String propertyStoreName, java.lang.String key) throws java.lang.ExceptionReturns the property value from the named property store.- Parameters:
propertyStoreName- The name of the property storekey- The property value- Returns:
- The property value
- Throws:
java.lang.Exception- Runtime or security exception
-
setProperty
public void setProperty(java.lang.String propertyStoreName, java.lang.String key, java.lang.Object value) throws java.lang.ExceptionSets a property in the named property store.- Parameters:
propertyStoreName- The name of the property storekey- The property valuevalue- The new property value- Throws:
java.lang.Exception- Runtime or security exception
-
getPropertyEntry
public Entry getPropertyEntry(java.lang.String key) throws java.lang.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:
java.lang.Exception
-
getPropertyStoreKeys
public java.util.Iterator<java.lang.String> getPropertyStoreKeys(java.lang.String propertyStoreName) throws java.lang.ExceptionReturns 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:
java.lang.Exception- Runtime or security exception
-
addPropertyStore
public void addPropertyStore(PropertyStoreConfig config) throws java.lang.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:
java.lang.Exception- Runtime or security exception
-
insertPropertyStore
public void insertPropertyStore(PropertyStoreConfig config, int atIndex) throws java.lang.Exception
Inserts a connector interface at the given index. See addPropertyStore() for a description of parameters.- Parameters:
config- The property store configurationatIndex- The position where the new connector is placed (-1 = END, 0 = First)- Throws:
java.lang.Exception- Runtime or security exception
-
removePropertyStore
public void removePropertyStore(java.lang.String propertyStoreName) throws java.lang.ExceptionRemoves a property store from TDI-P. The connector interface is closed and then removed.- Parameters:
propertyStoreName- The name of the property store- Throws:
java.lang.Exception- Runtime or security exception
-
getPropertyStoreNames
public java.util.List<java.lang.String> getPropertyStoreNames()
Returns a list of property store names in use by TDI-P.- Returns:
- The propertyStoreNames value
-
indexOf
public int indexOf(java.lang.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 java.util.List<TDIPropertyStore> selectStore(java.lang.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(java.lang.String name)
-
trimKey
public java.lang.String trimKey(java.lang.String key)
-
selectTDIProperties
protected TDIProperties selectTDIProperties(java.lang.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:
-
-