com.ibm.di.api.jmx.mbeans
Class TDIProperties

java.lang.Object
  extended by com.ibm.di.api.jmx.mbeans.BaseAdmin
      extended by com.ibm.di.api.jmx.mbeans.TDIProperties
All Implemented Interfaces:
BaseAdminMBean, BaseMBean, TDIPropertiesMBean

public class TDIProperties
extends BaseAdmin
implements TDIPropertiesMBean

Wrapper API to expose the functionality available from com.ibm.di.config.interfaces.TDIProperties.


Field Summary
static String MBEAN_TYPE
          Type of the MBean.
 
Constructor Summary
TDIProperties(TDIProperties aLocalTDIProperties, String aId)
          Class constructor.
 
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.
static ObjectName genObjectName(String aUniqueCode)
          Generates object name for specified TDI-P.
 TDIPropertyStore getDefaultStore()
          Gets the default property store.
 String getId()
          Reads attribute "Id".
 TDIPropertyStore getPasswordStore()
          Returns the password store.
 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.
 TDIPropertyStore getPropertyStore(String name)
          Returns the named property store.
 String[] getPropertyStoreKeys(String propertyStoreName)
          Returns an array containing all the property keys in the named property store.
 List getPropertyStoreNames()
          Returns a list of property store names in use by TDI-P.
 String getType()
          Reads attribute "Type".
 void insertPropertyStore(PropertyStoreConfig config, int atIndex)
          Inserts a connector interface at the given index.
 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.
 void setDefaultStore(TDIPropertyStore defaultStore)
          Sets the default property store.
 void setPasswordStore(TDIPropertyStore passwordStore)
          Sets the password store.
 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 the property in the named property store.
 String trimKey(String key)
          Trims the key from a given string.
 
Methods inherited from class com.ibm.di.api.jmx.mbeans.BaseAdmin
getCurrentUserId, getKeyPropertyList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MBEAN_TYPE

public static final String MBEAN_TYPE
Type of the MBean.

See Also:
Constant Field Values
Constructor Detail

TDIProperties

public TDIProperties(TDIProperties aLocalTDIProperties,
                     String aId)
              throws DIException
Class constructor.

Parameters:
aLocalTDIProperties - TDIProperties instance.
aId - ID.
Throws:
DIException
Method Detail

getType

public String getType()
Reads attribute "Type".

getType() and getId() are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as "type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".

Specified by:
getType in interface BaseMBean
Returns:
the type of this MBean.

getId

public String getId()
Reads attribute "Id". The "Id" value should be different for different MBeans of the same type.

getType() and getId() are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as "type=" + getType() + ",id=" + getId(), for example "type=AssemblyLine,id=Hello".

Specified by:
getId in interface BaseMBean
Returns:
the Id of this MBean.

commit

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

Specified by:
commit in interface TDIPropertiesMBean
Throws:
RemoteException
Exception - if Runtime or Security exception occurs

getProperty

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

Specified by:
getProperty in interface TDIPropertiesMBean
Parameters:
key - The property name
Returns:
The property value
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

setProperty

public TDIPropertyStore setProperty(String key,
                                    Object value)
                             throws RemoteException,
                                    Exception
Sets the property in the property store chosen by TDIProperties.

Specified by:
setProperty in interface TDIPropertiesMBean
Parameters:
key - The property name
value - The new property value
Returns:
the TDIPropertyStore to which the key/value pair was written
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

setProperty

public TDIPropertyStore setProperty(String key,
                                    Object value,
                                    boolean protect)
                             throws RemoteException,
                                    Exception
Sets the property in the property store chosen by TDIProperties.

Specified by:
setProperty in interface TDIPropertiesMBean
Parameters:
key - The property name
value - The new property value
protect - True if value should be protected (driver dependent)
Returns:
the TDIPropertyStore to which the key/value pair was written
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

removeProperty

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

Specified by:
removeProperty in interface TDIPropertiesMBean
Parameters:
propertyStoreName - The name of the property store
key - The property to delete
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

getProperty

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

Specified by:
getProperty in interface TDIPropertiesMBean
Parameters:
propertyStoreName - The name of the property store
key - The property value
Returns:
The property value
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

setProperty

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

Specified by:
setProperty in interface TDIPropertiesMBean
Parameters:
propertyStoreName - The name of the property store
key - The property name
value - The new property value
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

getPropertyStoreKeys

public String[] getPropertyStoreKeys(String propertyStoreName)
                              throws RemoteException,
                                     Exception
Returns an array containing all the property keys in the named property store.

Specified by:
getPropertyStoreKeys in interface TDIPropertiesMBean
Parameters:
propertyStoreName - The name of the property store
Returns:
The propertyStoreKeys value
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

addPropertyStore

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

Specified by:
addPropertyStore in interface TDIPropertiesMBean
Parameters:
config - The property store configuration
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

insertPropertyStore

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

Specified by:
insertPropertyStore in interface TDIPropertiesMBean
Parameters:
config - The property store configuration
atIndex - The position where the new connector is placed (-1 = END, 0 = First)
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

removePropertyStore

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

Specified by:
removePropertyStore in interface TDIPropertiesMBean
Parameters:
propertyStoreName - The name of the property store
Throws:
RemoteException - if a communication-related exception occurs.
Exception - if Runtime or Security exception occurs

getPropertyStoreNames

public List getPropertyStoreNames()
                           throws Exception,
                                  RemoteException
Returns a list of property store names in use by TDI-P.

Specified by:
getPropertyStoreNames in interface TDIPropertiesMBean
Returns:
The propertyStoreNames value
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

getDefaultStore

public TDIPropertyStore getDefaultStore()
                                 throws Exception,
                                        RemoteException
Gets the default property store.

Specified by:
getDefaultStore in interface TDIPropertiesMBean
Returns:
the default property store
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

setDefaultStore

public void setDefaultStore(TDIPropertyStore defaultStore)
                     throws Exception,
                            RemoteException
Sets the default property store.

Specified by:
setDefaultStore in interface TDIPropertiesMBean
Parameters:
defaultStore - the new default property store
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

getPasswordStore

public TDIPropertyStore getPasswordStore()
                                  throws Exception,
                                         RemoteException
Returns the password store.

Specified by:
getPasswordStore in interface TDIPropertiesMBean
Returns:
the password store
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

setPasswordStore

public void setPasswordStore(TDIPropertyStore passwordStore)
                      throws Exception,
                             RemoteException
Sets the password store.

Specified by:
setPasswordStore in interface TDIPropertiesMBean
Parameters:
passwordStore - the new password store
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

getPropertyStore

public TDIPropertyStore getPropertyStore(String name)
                                  throws Exception,
                                         RemoteException
Returns the named property store.

Specified by:
getPropertyStore in interface TDIPropertiesMBean
Parameters:
name - the name of the property store
Returns:
the TDIPropertyStore with specified name
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

trimKey

public String trimKey(String key)
               throws Exception,
                      RemoteException
Trims the key from a given string. For example trimKey("greeting:Hello, world!") will return the following string: "Hello, world!".

Specified by:
trimKey in interface TDIPropertiesMBean
Parameters:
key - a string representing key:value pair
Returns:
string containing only the value
Throws:
Exception - if Runtime or Security exception occurs
RemoteException - if a communication-related exception occurs.

genObjectName

public static ObjectName genObjectName(String aUniqueCode)
                                throws DIException
Generates object name for specified TDI-P.

Parameters:
aUniqueCode - unique code used for building the TDI-P MBean id.
Returns:
the generated object name
Throws:
DIException - if error occurs while creating TDI-P JMX object name.