Package com.ibm.di.config.xml
Class MetamergeConfigXML
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- com.ibm.di.config.base.MetamergeConfigImpl
-
- com.ibm.di.config.xml.MetamergeConfigXML
-
- All Implemented Interfaces:
BaseConfiguration,MetamergeConfig,MetamergeConfigChangeListener,MetamergeFolder,java.io.Serializable
- Direct Known Subclasses:
MetamergeConfigFS
public class MetamergeConfigXML extends MetamergeConfigImpl
MetamergeConfigXML is a class that provides support for TDI XML configuration files. It can create new configurations, load and store existing ones. This class provides access to the structure of a TDI configuration as well to its current status.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetamergeConfigXML.LazyConfig
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIDI_CREATEDstatic java.lang.StringIDI_VERSIONstatic java.lang.StringMETAMERGE_CONFIG_TAGstatic java.lang.StringMETAMERGE_CREATED_TAGstatic java.lang.StringMETAMERGE_CREATEDBY_TAGstatic java.lang.StringMETAMERGE_MODIFIED_TAGstatic java.lang.StringMETAMERGE_MODIFIEDBY_TAGstatic java.lang.StringMETAMERGE_VERSION_IDstatic java.lang.StringMETAMERGE_VERSION_TAGstatic java.lang.StringSERVER_ENCRYPTED_SIGNATURE-
Fields inherited from class com.ibm.di.config.base.MetamergeConfigImpl
classMap, DEFAULT_FOLDER_IMPL, DEFAULT_FOLDER_NAMES, env, externalPropertiesDelegator, logger
-
Fields inherited from class com.ibm.di.config.base.BaseConfigurationImpl
NAME
-
Fields inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
CHILD_PATH_SEPARATOR, DISABLE_EXTPROPS, DISABLE_INHERITANCE, INHERIT_NONE, INHERIT_PARENT, ONE_LEVEL, RECURSIVE, RECURSIVE_ONELEVEL, RECURSIVE_SUBTREE, SEARCH_EXACTCASE, SEARCH_ONELEVEL, SEARCH_PARAMNAME, SEARCH_PARAMNAME_RE, SEARCH_PROPERTY, SEARCH_REGEX, SEARCH_SUBSTRING, SUBTREE
-
Fields inherited from interface com.ibm.di.config.interfaces.MetamergeConfig
ASSEMBLYLINE_FOLDER, ATTRIBUTEMAP_FOLDER, CONFIG_FOLDER, CONNECTOR_FOLDER, DEFAULT_ASSEMBLYLINE_FOLDER, DEFAULT_ATTRIBUTEMAP_FOLDER, DEFAULT_CONFIG_FOLDER, DEFAULT_CONNECTOR_FOLDER, DEFAULT_EXTPROP_FOLDER, DEFAULT_EXTPROP_NAME, DEFAULT_FORM_FOLDER, DEFAULT_FUNCTION_FOLDER, DEFAULT_LIBRARY_FOLDER, DEFAULT_LIBS_FOLDER, DEFAULT_LOGGER_FOLDER, DEFAULT_NAMESPACE_FOLDER, DEFAULT_PARSER_FOLDER, DEFAULT_PROPERTY_FOLDER, DEFAULT_PROPSTORE_FOLDER, DEFAULT_SCHEDULER_FOLDER, DEFAULT_SCRIPT_FOLDER, DEFAULT_SEQUENCE_FOLDER, DEFAULT_SERVER_AUTOSTART, DEFAULT_SERVER_FOLDER, DEFAULT_SERVER_INSTANCE_PROPERTIES, DEFAULT_SERVER_LOG, DEFAULT_SERVER_TOMBSTONES, DEFAULT_SOLUTION_INTERFACE, EXTPROP_FOLDER, FORM_FOLDER, FUNCTION_FOLDER, LIBRARY_FOLDER, LIBS_FOLDER, LOGGER_FOLDER, LOGGING_FOLDER, NAMESPACE_FOLDER, PARSER_FOLDER, PROPERTY_FOLDER, PROPSTORE_FOLDER, SCHEDULER_FOLDER, SCRIPT_FOLDER, SEQUENCE_FOLDER
-
-
Constructor Summary
Constructors Constructor Description MetamergeConfigXML()MetamergeConfigXML(java.util.Hashtable<java.lang.String,java.lang.Object> env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(java.lang.Object name, java.lang.Object obj)Adds a new object to the configuration at the location specified by namevoidcommitChanges(java.lang.Object output, boolean isSave)Save XML tree to output stream.MetamergeFoldercreateFolder(java.lang.Object name)This method creates a foldervoiddebug(java.lang.String msg)org.w3c.dom.ElementfindByName(org.w3c.dom.Element root, java.lang.Object name)This method traverses the document tree searching for an element with an attribute (name) equal to name.org.w3c.dom.ElementfindOneByName(org.w3c.dom.Element root, java.lang.String name)This method searches the children of an element for an element with an attribute (name) equal to name.protected ConfigCachegetCache()java.lang.StringgetConfigVersion()java.lang.StringgetDirectory()Returns the directory this config is placed in.org.w3c.dom.DocumentgetDocument()Returns the XML document object.booleangetModified()XML Doc needs to be saved if we have dirty objects in our cache or if there has been any successful bind/rebind/unbind calls.java.io.OutputStreamgetOutputStream(java.lang.Object out)Returns the output stream to which the XML document is written.org.w3c.dom.ElementgetRootElement()Returns the root element of the XML document.java.lang.StringgetShortName()Gets the shortName attribute of the BaseConfiguration object.voidinitializeConfig()Initializes the XML configuration, including the reading and parsing of the XML file.protected java.lang.ObjectinternalLookup(java.lang.Object namex)Called by super's lookupbooleanisCommittable()Returns true if the configuration driver implements the commitChanges method and the current value for PROVIDER_URL is writable.booleanisDebugMode()booleanisOldVersion()booleanisReadOnly()Returns true if this configuration cannot be modified.booleanisRemote()java.util.Enumeration<javax.naming.Binding>list()This method returns an enumeration with the names in the given folder.java.util.Enumeration<javax.naming.Binding>list(java.lang.Object name)Returns an enumeration of the immediate children of this nodevoidlogmsg(java.lang.String msg)BaseConfigurationnewInstanceOf(java.lang.Object typeName)This method returns a new instance of the object type specified by typeName.voidrebind(java.lang.Object name, java.lang.Object obj)Adds or replaces a new object to the configuration.protected voidremoveElement(java.lang.Object name)voidrename(java.lang.Object name, java.lang.Object newname)Renames an object.voidsetNoBackupOfOldVersion()Sets a flag to prevent an old version of the file to be used as backup.voidsetOutput(java.lang.Object output)Changes the output to wich the configuration driver writes its configuration.voidunbind(java.lang.Object name)Removes a named object from this configuration.-
Methods inherited from class com.ibm.di.config.base.MetamergeConfigImpl
addDefaultFolders, addNameComponent, closeConfig, commitChanges, commitChangesNoEncryption, copy, getAssemblyLine, getAttributeMap, getConnector, getDefaultFolder, getDriverParameter, getDriverParameters, getExternalProperties, getExternalProperties, getFileConfig, getFunction, getNames, getNamespace, getParser, getPassword, getScript, getSequence, getSolutionInterface, getTDIProperties, getTreeMap, getVector, hasPassword, initializeClassMap, instantiateAllObjects, instantiateAllObjects, isModTSEnabled, lookup, lookupInFolder, newInstanceOf, newInstanceOf, setDriverParameter, setDriverParameters, setFileConfig, setModTSEnabled, shouldEncryptProtected, toString, useEncryption
-
Methods inherited from class com.ibm.di.config.base.BaseConfigurationImpl
addListener, configurationChanged, deepClone, detachFromParent, expandPropertyValue, expandPropertyValue, flatten, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getLongName, getMetamergeConfig, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterPropertySourceFromValue, getParameterRaw, getParent, getParentName, getPath, getReferences, getResHash, getScript, getScriptEngine, getStringParameter, getSubstitutionMap, getUseConfigListeners, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFrom, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setupInheritanceChain, setUseConfigListeners, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willExpandProps, willFlatten, willUseInherited
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
addListener, detachFromParent, flatten, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getMetamergeConfig, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterRaw, getParent, getPath, getReferences, getScript, getScriptEngine, getStringParameter, getSubstitutionMap, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFrom, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setupInheritanceChain, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
-
-
-
-
Field Detail
-
SERVER_ENCRYPTED_SIGNATURE
public static final java.lang.String SERVER_ENCRYPTED_SIGNATURE
- See Also:
- Constant Field Values
-
METAMERGE_CONFIG_TAG
public static final java.lang.String METAMERGE_CONFIG_TAG
- See Also:
- Constant Field Values
-
METAMERGE_VERSION_TAG
public static final java.lang.String METAMERGE_VERSION_TAG
- See Also:
- Constant Field Values
-
METAMERGE_CREATED_TAG
public static final java.lang.String METAMERGE_CREATED_TAG
- See Also:
- Constant Field Values
-
METAMERGE_CREATEDBY_TAG
public static final java.lang.String METAMERGE_CREATEDBY_TAG
- See Also:
- Constant Field Values
-
METAMERGE_MODIFIED_TAG
public static final java.lang.String METAMERGE_MODIFIED_TAG
- See Also:
- Constant Field Values
-
METAMERGE_MODIFIEDBY_TAG
public static final java.lang.String METAMERGE_MODIFIEDBY_TAG
- See Also:
- Constant Field Values
-
METAMERGE_VERSION_ID
public static final java.lang.String METAMERGE_VERSION_ID
- See Also:
- Constant Field Values
-
IDI_VERSION
public static final java.lang.String IDI_VERSION
- See Also:
- Constant Field Values
-
IDI_CREATED
public static final java.lang.String IDI_CREATED
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfigVersion
public java.lang.String getConfigVersion()
- Specified by:
getConfigVersionin interfaceMetamergeConfig- Overrides:
getConfigVersionin classMetamergeConfigImpl- Returns:
- The version of the configuration. e.g. "6.1.1", "7.0", "7.1", etc.
-
isOldVersion
public boolean isOldVersion()
-
logmsg
public void logmsg(java.lang.String msg)
- Overrides:
logmsgin classMetamergeConfigImpl
-
debug
public void debug(java.lang.String msg)
-
isDebugMode
public boolean isDebugMode()
- Returns:
- true if debug is enabled. Otherwise, false is returned.
-
initializeConfig
public void initializeConfig() throws java.lang.ExceptionInitializes the XML configuration, including the reading and parsing of the XML file.- Specified by:
initializeConfigin interfaceMetamergeConfig- Overrides:
initializeConfigin classMetamergeConfigImpl- Throws:
java.lang.Exception
-
internalLookup
protected java.lang.Object internalLookup(java.lang.Object namex) throws java.lang.ExceptionCalled by super's lookup- Overrides:
internalLookupin classMetamergeConfigImpl- Throws:
java.lang.Exception
-
list
public java.util.Enumeration<javax.naming.Binding> list() throws java.lang.ExceptionThis method returns an enumeration with the names in the given folder. If the name does does not name a folder an exception is thrown.- Specified by:
listin interfaceMetamergeFolder- Overrides:
listin classMetamergeConfigImpl- Returns:
- Enumeration of Binding objects
- Throws:
java.lang.Exception
-
list
public java.util.Enumeration<javax.naming.Binding> list(java.lang.Object name) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigReturns an enumeration of the immediate children of this node- Specified by:
listin interfaceMetamergeConfig- Overrides:
listin classMetamergeConfigImpl- Parameters:
name- The folder name to list- Returns:
- Enumeration object of javax.naming.Binding objects with names and objects.
- Throws:
java.lang.Exception
-
createFolder
public MetamergeFolder createFolder(java.lang.Object name) throws java.lang.Exception
This method creates a folder- Specified by:
createFolderin interfaceMetamergeFolder- Overrides:
createFolderin classMetamergeConfigImpl- Parameters:
name- Name of sub-folder- Returns:
- The MetamergeFolder object representing the new sub-folder
- Throws:
java.lang.Exception
-
findByName
public org.w3c.dom.Element findByName(org.w3c.dom.Element root, java.lang.Object name) throws java.lang.ExceptionThis method traverses the document tree searching for an element with an attribute (name) equal to name.- Throws:
java.lang.Exception
-
findOneByName
public org.w3c.dom.Element findOneByName(org.w3c.dom.Element root, java.lang.String name)This method searches the children of an element for an element with an attribute (name) equal to name.
-
getRootElement
public org.w3c.dom.Element getRootElement()
Returns the root element of the XML document.
-
getDocument
public org.w3c.dom.Document getDocument()
Returns the XML document object.
-
bind
public void bind(java.lang.Object name, java.lang.Object obj) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigAdds a new object to the configuration at the location specified by name- Specified by:
bindin interfaceMetamergeConfig- Overrides:
bindin classMetamergeConfigImpl- Parameters:
name- Nameobj- Configuration Object- Throws:
java.lang.Exception
-
rebind
public void rebind(java.lang.Object name, java.lang.Object obj) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigAdds or replaces a new object to the configuration.- Specified by:
rebindin interfaceMetamergeConfig- Overrides:
rebindin classMetamergeConfigImpl- Parameters:
name- Nameobj- Configuration Object- Throws:
java.lang.Exception
-
rename
public void rename(java.lang.Object name, java.lang.Object newname) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigRenames an object. If new name is a simple name then location is unchanged, otherwise the object is moved.- Specified by:
renamein interfaceMetamergeConfig- Overrides:
renamein classMetamergeConfigImpl- Parameters:
name- Current Namenewname- New name- Throws:
java.lang.Exception
-
unbind
public void unbind(java.lang.Object name) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigRemoves a named object from this configuration.- Specified by:
unbindin interfaceMetamergeConfig- Overrides:
unbindin classMetamergeConfigImpl- Parameters:
name- The object name to remove- Throws:
java.lang.Exception
-
removeElement
protected void removeElement(java.lang.Object name) throws java.lang.Exception- Throws:
java.lang.Exception
-
commitChanges
public void commitChanges(java.lang.Object output, boolean isSave) throws java.lang.ExceptionSave XML tree to output stream.- Specified by:
commitChangesin interfaceMetamergeConfig- Overrides:
commitChangesin classMetamergeConfigImpl- Parameters:
output- Null or any object supported by the underlying driver.isSave- true if this is a permanent save, false if this just saves to e.g. a command window.- Throws:
java.lang.Exception
-
setOutput
public void setOutput(java.lang.Object output) throws java.lang.ExceptionDescription copied from interface:MetamergeConfigChanges the output to wich the configuration driver writes its configuration. This is different from calling commitChanges(output, false) where the output parameter is temporary (e.g. SaveCopyAs).- Specified by:
setOutputin interfaceMetamergeConfig- Overrides:
setOutputin classMetamergeConfigImpl- Parameters:
output- The new output value- Throws:
java.lang.Exception
-
isCommittable
public boolean isCommittable()
Description copied from interface:MetamergeConfigReturns true if the configuration driver implements the commitChanges method and the current value for PROVIDER_URL is writable.- Specified by:
isCommittablein interfaceMetamergeConfig- Overrides:
isCommittablein classMetamergeConfigImpl- Returns:
- The committable state
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:MetamergeConfigReturns true if this configuration cannot be modified.- Specified by:
isReadOnlyin interfaceMetamergeConfig- Overrides:
isReadOnlyin classMetamergeConfigImpl- Returns:
- The readOnly value
-
getModified
public boolean getModified()
XML Doc needs to be saved if we have dirty objects in our cache or if there has been any successful bind/rebind/unbind calls.- Specified by:
getModifiedin interfaceBaseConfiguration- Overrides:
getModifiedin classBaseConfigurationImpl- Returns:
- the modified state.
-
newInstanceOf
public BaseConfiguration newInstanceOf(java.lang.Object typeName) throws java.lang.Exception
Description copied from interface:MetamergeConfigThis method returns a new instance of the object type specified by typeName. Use the default folder names constants to denote the type. The new object is not added to the configuration.- Specified by:
newInstanceOfin interfaceMetamergeConfig- Overrides:
newInstanceOfin classMetamergeConfigImpl- Parameters:
typeName- The object type to create.- Returns:
- The newly created object.
- Throws:
java.lang.Exception
-
getOutputStream
public java.io.OutputStream getOutputStream(java.lang.Object out) throws java.lang.ExceptionReturns the output stream to which the XML document is written. Called by commitChanges.- Throws:
java.lang.Exception
-
isRemote
public boolean isRemote()
- Specified by:
isRemotein interfaceMetamergeConfig- Overrides:
isRemotein classMetamergeConfigImpl
-
getShortName
public java.lang.String getShortName()
Description copied from class:BaseConfigurationImplGets the shortName attribute of the BaseConfiguration object. The short name is the last component in a multi component name. E.g.: AssemblyLines/MyName --> "MyName"- Specified by:
getShortNamein interfaceBaseConfiguration- Overrides:
getShortNamein classBaseConfigurationImpl- Returns:
- The shortName value
-
getCache
protected ConfigCache getCache()
-
getDirectory
public java.lang.String getDirectory()
Description copied from interface:MetamergeConfigReturns the directory this config is placed in. If nothing can be determined, returns "."- Specified by:
getDirectoryin interfaceMetamergeConfig- Overrides:
getDirectoryin classMetamergeConfigImpl- Returns:
- The directory this config is placed in.
-
setNoBackupOfOldVersion
public void setNoBackupOfOldVersion()
Sets a flag to prevent an old version of the file to be used as backup.- Since:
- 7.2
-
-