com.metamatrix.common.config.xml
Class XMLConfig_42_ImportExportUtility

java.lang.Object
  extended by com.metamatrix.common.config.xml.XMLConfig_Base_ImportExportUtility
      extended by com.metamatrix.common.config.xml.XMLConfig_42_ImportExportUtility
All Implemented Interfaces:
ConfigurationPropertyNames

public class XMLConfig_42_ImportExportUtility
extends XMLConfig_Base_ImportExportUtility

This version of the configuration import/exporter supports the configuration in 4.2.


Field Summary
 
Fields inherited from class com.metamatrix.common.config.xml.XMLConfig_Base_ImportExportUtility
DEFAULT_USER_CREATED_BY
 
Fields inherited from interface com.metamatrix.common.config.util.ConfigurationPropertyNames
APPLICATION_CREATED_BY, APPLICATION_VERSION_CREATED_BY, CONFIGURATION_VERSION, MEMBERSHIP_ADMIN_PASSWORD, MEMBERSHIP_ADMIN_USERNAME, MEMBERSHIP_DOMAIN_ORDER, MEMBERSHIP_SECURITY_ENABLED, METAMATRIX_SYSTEM_VERSION, MM_CONFIG_3_0_VERSION, MM_CONFIG_4_2_VERSION, MM_LATEST_CONFIG_VERSION, TIME, USER_CREATED_BY
 
Constructor Summary
XMLConfig_42_ImportExportUtility()
           
 
Method Summary
protected  ComponentType createComponentType(org.jdom.Element root, ConfigurationObjectEditor editor, java.lang.String name)
           
protected  java.util.Collection createComponentTypes(org.jdom.Element root, ConfigurationObjectEditor editor)
           
 void exportConfiguration(java.io.OutputStream stream, java.util.Collection configurationObjects, java.util.Properties props)
          This method will write to the passed in DirectoryEntry instance a complete representation of the Collection of Configuration objects that are passed into it.
protected  XMLHelper getXMLHelper()
           
 ComponentType importComponentType(org.jdom.Element root, ConfigurationObjectEditor editor, java.lang.String name)
          This method will be used to import a ComponentType Object
 java.util.Collection importComponentTypes(org.jdom.Element root, ConfigurationObjectEditor editor)
          This method will be used to import 1 or more a ComponentType Objects.
 java.util.Collection importConfigurationObjects(org.jdom.Element root, ConfigurationObjectEditor editor, java.lang.String name)
          This method will be used to import a Collection of Configuration objects given an InputStream.
 
Methods inherited from class com.metamatrix.common.config.xml.XMLConfig_Base_ImportExportUtility
createConnectorBinding, createConnectorBindings, exportComponentType, exportComponentTypes, exportConnector, exportConnectorBinding, exportConnectorBindings, exportConnectorBindings, exportServiceComponentDefn, getXMLReaderWriter, importConnectorBinding, importConnectorBindingAndType, importConnectorBindings, importConnectorBindings, importServiceComponentDefn, resolveConfigurationObjects, resolveConfigurationObjects, segregateConfigurationObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLConfig_42_ImportExportUtility

public XMLConfig_42_ImportExportUtility()
Method Detail

exportConfiguration

public void exportConfiguration(java.io.OutputStream stream,
                                java.util.Collection configurationObjects,
                                java.util.Properties props)
                         throws java.io.IOException,
                                ConfigObjectsNotResolvableException

This method will write to the passed in DirectoryEntry instance a complete representation of the Collection of Configuration objects that are passed into it. The failsafe way to build this Collection of objects is to call the getConfigurationAndDependents() method on the AdminAPI of the MetaMatrix Server. This method will retreive the Configuration and all of its dependent objects in their entirety.

In order to export an entire Configuration, the Collection passed into this method should have all of the following object references to be able to resolve the relationships between all objects referenced by a Configuration object.

 1. Configuration object
 2. all ComponentTypes that ComponentObjects reference in the
 Configuration object including the Configuration object's Component Type.
 (this includes ProductTypes)
 3. all ProductTypes that ProductServiceConfig objects reference in the
 Configuration object
 4. all Host objects that are referenced by DeployedComponents in the
 Configuration object
 

All of the above object references must be in the collection passed into this method.

The properties object that is passed into this method may contain the following properties as defined by the ConfigurationPropertyNames class. These properties will define the values for the header of the output of this method.

 ConfigurationPropertyNames.APPLICATION_CREATED_BY
 ConfigurationPropertyNames.APPLICATION_VERSION_CREATED_BY
 ConfigurationPropertyNames.USER_CREATED_BY
 

 

Any of these properties that are not included in the properties object will not be included in the header Element.

Parameters:
stream - the output stream to write the Configuration Object representation to
configurationObjects - a Collection of configuration objects that represents an entire logical Configuration.
props - the properties object that contains the values for the Header
Throws:
java.io.IOException - if there is an error writing to the DirectoryEntry
ConfigObjectsNotResolvableException - if there are references to configuration objects not included in the Collection of configuration objects that cannot be resolved to other configuration objects in the passed in Collection

importConfigurationObjects

public java.util.Collection importConfigurationObjects(org.jdom.Element root,
                                                       ConfigurationObjectEditor editor,
                                                       java.lang.String name)
                                                throws java.io.IOException,
                                                       ConfigObjectsNotResolvableException,
                                                       InvalidConfigurationElementException

This method will be used to import a Collection of Configuration objects given an InputStream. If the InputStream resource does not contain enough data to recombine all of the configuration objects in the Input Stream, then a ConfigurationObjectsNotResolvableException will be thrown.

This method also allows you to rename the imported Configuration object possibly to avoid name conflicts with other Configurations already in the server.

If the name parameter submitted is null, the name of the configuration object as it exists in the InputStream will be used as the name of the resulting Configuration object in the returned collection of configuration objects.

Parameters:
editor - the ConfigurationObjectEditor to use to create the Configuration objects in the InputStream resource.
stream - the input stream to read the configuration object representations from
name - the name for the Configuration object to be created. Can be null if the name specified in the input stream is to be used.
Returns:
the configuration objects that were represented as data in the InputStream resource
Throws:
ConfigObjectsNotResolvableException - if the data representing the Configuration to be imported is incomplete.
java.io.IOException - if there is an error reading from the InputStream
InvalidConfigurationElementException - if there is a problem with the representation of the configuration element as it exists in the InputStream resource, usually some type of formatting problem.

getXMLHelper

protected XMLHelper getXMLHelper()
Specified by:
getXMLHelper in class XMLConfig_Base_ImportExportUtility

importComponentType

public ComponentType importComponentType(org.jdom.Element root,
                                         ConfigurationObjectEditor editor,
                                         java.lang.String name)
                                  throws java.io.IOException,
                                         InvalidConfigurationElementException

This method will be used to import a ComponentType Object

This method also allows you to rename the imported ComponentType object possibly to avoid name conflicts with other objects already in the server.

If the name parameter submitted is null, the name of the configuration object as it exists in the DirectoryEntry will be used.

Parameters:
editor - the ConfigurationObjectEditor to use to create the Configuration objects in the DirectoryEntry resource.
stream - the input stream to read the configuration object representation from
name - the name for the ComponentType object to be created.
Returns:
the configuration object that was represented as data in the DirectoryEntry resource
Throws:
java.io.IOException - if there is an error reading from the DirectoryEntry
InvalidConfigurationElementException - if there is a problem with the representation of the configuration element as it exists in the DirectoryEntry resource, usually some type of formatting problem.

importComponentTypes

public java.util.Collection importComponentTypes(org.jdom.Element root,
                                                 ConfigurationObjectEditor editor)
                                          throws java.io.IOException,
                                                 InvalidConfigurationElementException

This method will be used to import 1 or more a ComponentType Objects.

Parameters:
editor - the ConfigurationObjectEditor to use to create the Configuration objects.
stream - the input stream to read the configuration object representation from
Returns:
Collection of objects of type ComponentType
Throws:
java.io.IOException - if there is an error reading from the DirectoryEntry
InvalidConfigurationElementException - if there is a problem with the representation of the configuration element as it exists in the DirectoryEntry resource, usually some type of formatting problem.

createComponentType

protected ComponentType createComponentType(org.jdom.Element root,
                                            ConfigurationObjectEditor editor,
                                            java.lang.String name)
                                     throws InvalidConfigurationElementException
Overrides:
createComponentType in class XMLConfig_Base_ImportExportUtility
Throws:
InvalidConfigurationElementException

createComponentTypes

protected java.util.Collection createComponentTypes(org.jdom.Element root,
                                                    ConfigurationObjectEditor editor)
                                             throws InvalidConfigurationElementException
Throws:
InvalidConfigurationElementException


Copyright © 2009. All Rights Reserved.