|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.config.xml.XMLHelperImpl
public class XMLHelperImpl
This helper class is used to create JDOM XML Elements from configuration objects and to create Configuration objects from JDOM XML Elements. NOTE - The helper cannot have any calls to LogManager because the bootstrapping of the CurrentConfiguration uses this class and the CurrentConfiguration has to come up before logging is available.
| Field Summary |
|---|
| 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 | |
|---|---|
XMLHelperImpl()
|
|
| Method Summary | |
|---|---|
ComponentObject |
addProperties(org.jdom.Element propertiesElement,
ComponentObject object,
ConfigurationObjectEditor editor)
This method will create a ComponentObject configuration object from an XML element that represents a ComponentObject. |
ComponentType |
createComponentType(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name,
boolean maintainParentID)
This method will create a ComponentType configuration object from an XML element that represents a ComponentType. |
org.jdom.Element |
createComponentTypeDefnElement(ComponentTypeDefn defn)
This method is used to create a ComponentTypeDefn JDOM Element from a ComponentTypeDefn object. |
org.jdom.Element |
createComponentTypeElement(ComponentType type)
This method is used to create a ComponentType JDOM Element from a ComponentType object. |
org.jdom.Element |
createComponentTypesElement()
This method is used to create a ComponentTypes JDOM Element from a Configuration ID object. |
Configuration |
createConfiguration(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a Configuration configuration object from an XML element that represents a Configuration. |
org.jdom.Element |
createConfigurationElement(Configuration configuration)
This method is used to create a Configuration JDOM Element from a Configuration object. |
org.jdom.Element |
createConfigurationInfoElement(ConfigurationInfo info)
This method is used to create a ConfigurationInfo JDOM Element from a ConfigurationInfo object. |
org.jdom.Element |
createConfigurationsElement()
This method is used to create a Configurations JDOM Element from a Configuration ID object. |
ConnectorBinding |
createConnectorBinding(ConfigurationID configurationID,
org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name,
boolean isImportConfig)
This method will create a ConnectorBinding object from an XML element that represents a ServiceComponentDefn. |
org.jdom.Element |
createConnectorBindingElement(ConnectorBinding connector,
boolean isExportConfig)
This method will create a LogConfiguration configuration object from an XML element that represents a LogConfiguration. |
org.jdom.Element |
createConnectorBindingsElement()
This method is used to create a ConnectorBindings JDOM Element. |
DeployedComponent |
createDeployedComponent(org.jdom.Element element,
Configuration config,
ConfigurationObjectEditor editor,
java.util.Map serviceComponentDefnMap,
java.util.Map vmComponentDefnMap,
java.util.Map componentTypeMap,
java.lang.String name)
This method will create a DeployedComponent configuration object from an XML element that represents a DeployedComponent. |
DeployedComponent |
createDeployedComponent(org.jdom.Element element,
ConfigurationID configID,
HostID hostID,
VMComponentDefnID vmID,
ProductServiceConfigID pscID,
java.util.Map componentTypeMap,
ConfigurationObjectEditor editor)
|
org.jdom.Element |
createDeployedProductServiceConfigElement(ProductServiceConfig config)
|
org.jdom.Element |
createHeaderElement(java.util.Properties props)
This method is used to create a Header JDOM Element from a Properties object. |
Host |
createHost(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a Host configuration object from an XML element that represents a Host. |
org.jdom.Element |
createHostElement(Host host)
This method is used to create a Host JDOM Element from a Host object. |
org.jdom.Element |
createHostsElement()
This method is used to create a Hosts JDOM Element from a Configuration ID object. |
org.jdom.Element |
createIDElement(java.lang.String type,
java.lang.String name)
This method is used to create a Configuration ID JDOM Element from a Configuration ID object. |
ProductServiceConfig |
createProductServiceConfig(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a ProductServiceConfig configuration object from an XML element that represents a ProductServiceConfig. |
org.jdom.Element |
createProductServiceConfigElement(ProductServiceConfig config)
This method is used to create a ProductServiceConfig JDOM Element from a ProductServiceConfig object. |
org.jdom.Element |
createProductServiceConfigsElement()
This method is used to create a ProductServiceConfig JDOM Element from a ProductServiceConfig object. |
ProductType |
createProductType(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.util.Map componentTypeMap,
java.lang.String name)
This method will create a ProductType configuration object from an XML element that represents a ProductType. |
org.jdom.Element |
createProductTypeElement(ProductType type)
This method is used to create a ProductType JDOM Element from a ProductType object. |
org.jdom.Element |
createProductTypesElement()
This method is used to create a ProductType JDOM Element from a ProductType object. |
org.jdom.Element |
createPropertiesElement(java.util.Properties props)
This method is used to create a Properties JDOM Element from a Properties object. |
PropertyDefinition |
createPropertyDefinition(org.jdom.Element element)
This method is a helper method to create a PropertyDefinition object from an XML element that represents same. |
org.jdom.Element |
createPropertyDefinitionElement(PropertyDefinition defn)
This method is used to create a PropertyDefinition JDOM Element from a PropertyDefinition object. |
ResourceDescriptor |
createResourcePool(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor)
This method will create a Resource configuration object from an XML element that represents a Resource. |
org.jdom.Element |
createResourcePoolElement(ResourceDescriptor resource)
This method is used to create a ResourceDescriptor JDOM Element from a ServiceComponentDefn object. |
org.jdom.Element |
createResourcePoolsElement()
This method is used to create a ResourceDescriptors JDOM Element. |
org.jdom.Element |
createRootConfigurationDocumentElement()
This method is used to create a root JDOM Element. |
ComponentDefn |
createServiceComponentDefn(org.jdom.Element element,
Configuration config,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a ServiceComponentDefn configuration object from an XML element that represents a ServiceComponentDefn. |
ComponentDefn |
createServiceComponentDefn(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a ServiceComponentDefn configuration object from an XML element that represents a ServiceComponentDefn. |
org.jdom.Element |
createServiceComponentDefnElement(ServiceComponentDefn defn)
This method is used to create a ServiceComponentDefn JDOM Element from a ServiceComponentDefn object. |
org.jdom.Element |
createServiceComponentDefnsElement()
This method is used to create a ServiceComponentDefns JDOM Element. |
SharedResource |
createSharedResource(org.jdom.Element element,
ConfigurationObjectEditor editor)
This method will create a Resource configuration object from an XML element that represents a Resource. |
org.jdom.Element |
createSharedResourceElement(SharedResource resource)
This method is used to create a ServiceComponentDefn JDOM Element from a ServiceComponentDefn object. |
org.jdom.Element |
createSharedResourcesElement()
This method is used to create a Resources JDOM Element. |
VMComponentDefn |
createVMComponentDefn(org.jdom.Element element,
ConfigurationID configID,
HostID hostID,
ConfigurationObjectEditor editor,
java.lang.String name)
This method will create a VMComponentDefn configuration object from an XML element that represents a VMComponentDefn. |
org.jdom.Element |
createVMComponentDefnElement(VMComponentDefn defn)
This method is used to create a VMComponentDefn JDOM Element from a VMComponentDefn object. |
java.util.Properties |
getHeaderProperties(org.jdom.Element element)
Return the properties stored in the header section. |
boolean |
is42ConfigurationCompatible(org.jdom.Element element)
Returns true if the information in the element indicates that it is compatible with the 4.2 configuration format. |
void |
orderComponentTypeElementList(java.util.List componentTypeElements)
This helper method will order a List of XML JDOM elements that represent ComponentTypes or ProductTypes so that types that are referenced by other types in the list are in the returned list before the object that is referencing it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLHelperImpl()
| Method Detail |
|---|
public org.jdom.Element createConfigurationElement(Configuration configuration)
createConfigurationElement in interface XMLHelperconfiguration - the Object to be converted to a JDOM XML Element
public org.jdom.Element createConfigurationInfoElement(ConfigurationInfo info)
createConfigurationInfoElement in interface XMLHelperinfo - the Object to be converted to a JDOM XML Element
public org.jdom.Element createVMComponentDefnElement(VMComponentDefn defn)
createVMComponentDefnElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public org.jdom.Element createServiceComponentDefnElement(ServiceComponentDefn defn)
createServiceComponentDefnElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public org.jdom.Element createProductServiceConfigElement(ProductServiceConfig config)
createProductServiceConfigElement in interface XMLHelperconfig - the Object to be converted to a JDOM XML Element
public org.jdom.Element createComponentTypeElement(ComponentType type)
createComponentTypeElement in interface XMLHelpertype - the Object to be converted to a JDOM XML Element
public org.jdom.Element createPropertyDefinitionElement(PropertyDefinition defn)
createPropertyDefinitionElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public org.jdom.Element createComponentTypeDefnElement(ComponentTypeDefn defn)
createComponentTypeDefnElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public org.jdom.Element createProductTypeElement(ProductType type)
createProductTypeElement in interface XMLHelpertype - the Object to be converted to a JDOM XML Element
public org.jdom.Element createHostElement(Host host)
createHostElement in interface XMLHelperhost - the Object to be converted to a JDOM XML Element
public java.util.Properties getHeaderProperties(org.jdom.Element element)
throws InvalidConfigurationElementException
XMLHelper
getHeaderProperties in interface XMLHelperInvalidConfigurationElementException - if the element passed in
is not the header element or its XML structure do not conform to the
XML structure specfied in the XMLElementNames class.public org.jdom.Element createHeaderElement(java.util.Properties props)
This method is used to create a Header JDOM Element from a Properties object. The properties object can contain any of the following properties that will be included in the header:
XMLElementNames.Header.ApplicationCreatedDate.ELEMENT XMLElementNames.Header.ApplicationVersionCreatedBy.ELEMENT XMLElementNames.Header.UserName.ELEMENT XMLElementNames.Header.DocumentTypeVersion.ELEMENT XMLElementNames.Header.MetaMatrixServerVersion.ELEMENT XMLElementNames.Header.Time.ELEMENTAny of these properties that are not included in the properties object will not be included in the header Element that is returned.
createHeaderElement in interface XMLHelperprops - the properties object that contains the values for the Header
public org.jdom.Element createPropertiesElement(java.util.Properties props)
createPropertiesElement in interface XMLHelperprops - the Object to be converted to a JDOM XML Element
public org.jdom.Element createIDElement(java.lang.String type,
java.lang.String name)
createIDElement in interface XMLHelpertype - the ID type to be created. @see XMLElementNames.Configurations.Configuration.XXXID.ELEMENT for valid valuesname - the calue of the name attribute of the ID element to create.
public org.jdom.Element createConfigurationsElement()
createConfigurationsElement in interface XMLHelperpublic org.jdom.Element createHostsElement()
createHostsElement in interface XMLHelperpublic org.jdom.Element createServiceComponentDefnsElement()
createServiceComponentDefnsElement in interface XMLHelperpublic org.jdom.Element createComponentTypesElement()
createComponentTypesElement in interface XMLHelperpublic org.jdom.Element createProductTypesElement()
XMLHelper
createProductTypesElement in interface XMLHelperpublic org.jdom.Element createProductServiceConfigsElement()
XMLHelper
createProductServiceConfigsElement in interface XMLHelperpublic org.jdom.Element createConnectorBindingsElement()
XMLHelper
createConnectorBindingsElement in interface XMLHelperpublic org.jdom.Element createRootConfigurationDocumentElement()
createRootConfigurationDocumentElement in interface XMLHelper
public Host createHost(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
createHost in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.public org.jdom.Element createResourcePoolElement(ResourceDescriptor resource)
createResourcePoolElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public ResourceDescriptor createResourcePool(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException
createResourcePool in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.public org.jdom.Element createResourcePoolsElement()
XMLHelper
createResourcePoolsElement in interface XMLHelperpublic org.jdom.Element createSharedResourceElement(SharedResource resource)
createSharedResourceElement in interface XMLHelperdefn - the Object to be converted to a JDOM XML Element
public SharedResource createSharedResource(org.jdom.Element element,
ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException
createSharedResource in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.public org.jdom.Element createSharedResourcesElement()
XMLHelper
createSharedResourcesElement in interface XMLHelper
public ComponentType createComponentType(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name,
boolean maintainParentID)
throws InvalidConfigurationElementException
createComponentType in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public ProductType createProductType(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.util.Map componentTypeMap,
java.lang.String name)
throws InvalidConfigurationElementException
createProductType in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.componentTypeMap - this is a map of ComponentTypeID--->ComponentType
it must contain all of the Component types that the ProductType
that is represented by the passed in XML element references.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public Configuration createConfiguration(org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
createConfiguration in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public org.jdom.Element createConnectorBindingElement(ConnectorBinding connector,
boolean isExportConfig)
createConnectorBindingElement in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public ConnectorBinding createConnectorBinding(ConfigurationID configurationID,
org.jdom.Element element,
ConfigurationObjectEditor editor,
java.lang.String name,
boolean isImportConfig)
throws InvalidConfigurationElementException
XMLHelper
createConnectorBinding in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public ComponentDefn createServiceComponentDefn(org.jdom.Element element,
Configuration config,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
createServiceComponentDefn in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public ComponentDefn createServiceComponentDefn(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
XMLHelper
createServiceComponentDefn in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public boolean is42ConfigurationCompatible(org.jdom.Element element)
throws InvalidConfigurationElementException
XMLHelper
is42ConfigurationCompatible in interface XMLHelperInvalidConfigurationElementException
public ProductServiceConfig createProductServiceConfig(org.jdom.Element element,
ConfigurationID configID,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
createProductServiceConfig in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.configID - is the configuration this PSC will become a part of
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.public org.jdom.Element createDeployedProductServiceConfigElement(ProductServiceConfig config)
createDeployedProductServiceConfigElement in interface XMLHelper
public DeployedComponent createDeployedComponent(org.jdom.Element element,
ConfigurationID configID,
HostID hostID,
VMComponentDefnID vmID,
ProductServiceConfigID pscID,
java.util.Map componentTypeMap,
ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException
createDeployedComponent in interface XMLHelperInvalidConfigurationElementException
public DeployedComponent createDeployedComponent(org.jdom.Element element,
Configuration config,
ConfigurationObjectEditor editor,
java.util.Map serviceComponentDefnMap,
java.util.Map vmComponentDefnMap,
java.util.Map componentTypeMap,
java.lang.String name)
throws InvalidConfigurationElementException
createDeployedComponent in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.serviceComponentDefnMap - a map of ServiceComponentDefnID-->ServiceComponentDefn
this map must contain at the very least the ServiceComponentDefn that
is the service definition of the deployed component that the XML element
references. This is used if the deployedComponent is a Service. Otherwise
it is ignored.vmComponentDefnMap - a map of vmComponentDefnID-->vmComponentDefn
this map must contain at the very least the vmComponentDefn that
is the VM definition of the deployed component that the XML element
references. This is used if the deployedComponent is a VM. Otherwise
it is ignored.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public VMComponentDefn createVMComponentDefn(org.jdom.Element element,
ConfigurationID configID,
HostID hostID,
ConfigurationObjectEditor editor,
java.lang.String name)
throws InvalidConfigurationElementException
createVMComponentDefn in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.configID - is the configuration the vm will become a part of
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public PropertyDefinition createPropertyDefinition(org.jdom.Element element)
throws InvalidConfigurationElementException
element - the XML element that represents a PropertyDefinition object
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.
public ComponentObject addProperties(org.jdom.Element propertiesElement,
ComponentObject object,
ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException
addProperties in interface XMLHelperelement - the JDOM element to convert to a configuration objecteditor - the editor to use to create the configuration objectname - the name of the returned configuration object. Note this
name will override the name in the JDOM element. If the name parameter
is null, the name of the object in the JDOM element will be used as
the name of the object.
InvalidConfigurationElementException - if the element passed in
or its XML structure do not conform to the XML structure specfied in
the XMLElementNames class.public void orderComponentTypeElementList(java.util.List componentTypeElements)
XMLHelper
orderComponentTypeElementList in interface XMLHelper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||