Author: vhalbert(a)redhat.com
Date: 2009-04-09 17:30:19 -0400 (Thu, 09 Apr 2009)
New Revision: 742
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentDefn.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationModelContainer.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponent.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponentID.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicDeployedComponent.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductServiceConfig.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicUtil.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerImpl.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationObjectEditorHelper.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigUtil.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_HelperImpl.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_ImportExportUtility.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_Visitor.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_Base_ImportExportUtility.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelper.java
Log:
Teiid 323 - removing the psc nomeclature
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -26,6 +26,7 @@
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Properties;
@@ -40,6 +41,7 @@
import com.metamatrix.common.config.api.VMComponentDefn;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.config.model.BasicHost;
+import com.metamatrix.common.config.model.BasicProductType;
import com.metamatrix.common.config.reader.CurrentConfigurationReader;
import com.metamatrix.common.config.reader.PropertiesConfigurationReader;
import com.metamatrix.common.properties.UnmodifiableProperties;
@@ -298,7 +300,9 @@
* @see #ProductType
*/
public Collection getProductTypes() throws ConfigurationException {
- return getReader().getConfigurationModel().getProductTypes();
+ Collection c = new ArrayList(1);
+ c.add(BasicProductType.PRODUCT_TYPE);
+ return c;
}
/**
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentDefn.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentDefn.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentDefn.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -35,7 +35,6 @@
public static final int PRODUCT_COMPONENT_CODE =
ComponentType.PRODUCT_COMPONENT_TYPE_CODE;
public static final int VM_COMPONENT_CODE = ComponentType.VM_COMPONENT_TYPE_CODE;
public static final int RESOURCE_DESCRIPTOR_COMPONENT_CODE = 9;
- public static final int PSC_COMPONENT_CODE = ComponentType.PSC_COMPONENT_TYPE_CODE;
public static final int HOST_COMPONENT_CODE =
ComponentType.HOST_COMPONENT_TYPE_CODE;
public static final int SHARED_RESOURCE_COMPONENT_CODE = 10;
public static final int DEPLOYED_COMPONENT_CODE =
ComponentType.DEPLOYED_COMPONENT_TYPE_CODE;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -38,7 +38,7 @@
public static final int RESOURCE_COMPONENT_TYPE_CODE = 4;
public static final int VM_COMPONENT_TYPE_CODE = 5;
- public static final int PSC_COMPONENT_TYPE_CODE = 6;
+// public static final int PSC_COMPONENT_TYPE_CODE = 6;
public static final int HOST_COMPONENT_TYPE_CODE = 7;
public static final int DEPLOYED_COMPONENT_TYPE_CODE = 8;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -173,14 +173,14 @@
* @param pscID is the ProductServiceConfig for which the component belongs
* @return Collection of deployed components that belong to the
ProductServiceConfig
*/
- Collection getDeployedComponents(ComponentDefnID componentDefnID,
ProductServiceConfigID pscID);
+// Collection getDeployedComponents(ComponentDefnID componentDefnID,
ProductServiceConfigID pscID);
/**
* Returns true if the PSC is deployed to any host.
* @returns boolean true if the PSC is deployed
*/
- boolean isPSCDeployed(ProductServiceConfigID pscID);
+ // boolean isPSCDeployed(ProductServiceConfigID pscID);
/**
@@ -252,7 +252,6 @@
* be returned for the <i>deployed</i> vm that they are deployed to,
* <i>not</i> the vm component definition which may itself be deployed
* many times.
- * @deprecated As of v2.0, replaced by {@link
#getDeployedServicesForVM(DeployedComponent)}
*/
Collection getDeployedServicesForVM(VMComponentDefnID vmComponentID) ;
@@ -277,7 +276,7 @@
* @return Collection of DeployedComponent objects representing deployed
* services
*/
- Collection getDeployedServices(VMComponentDefn vm, ProductServiceConfig psc) ;
+ // Collection getDeployedServices(VMComponentDefn vm, ProductServiceConfig psc) ;
/**
* Returns a Collection of ProductServiceConfig objects which have
@@ -291,7 +290,7 @@
* VMComponentDefn
* @return Collection of ProductServiceConfig objects
*/
- Collection getPSCsForVM(VMComponentDefn vm) ;
+// Collection getPSCsForVM(VMComponentDefn vm) ;
/**
@@ -299,7 +298,7 @@
* @param pscID is the id for specific ProductServiceConfig
* @return ProductServiceConfig to be returned
*/
- ProductServiceConfig getPSC(ComponentDefnID pscID) ;
+// ProductServiceConfig getPSC(ComponentDefnID pscID) ;
/**
@@ -313,7 +312,7 @@
* @return Collection of type {@link ProductServiceConfigID PSCID} that contain the
* ServiceComponentDefnID, or empty collection if none is found
*/
- Collection getPSCsForServiceDefn(ServiceComponentDefnID serviceDefnID) ;
+ // Collection getPSCsForServiceDefn(ServiceComponentDefnID serviceDefnID) ;
/**
* Returns a <code>Collection</code> of component objects that are
dependent on the
@@ -391,7 +390,7 @@
* all the ProductServiceConfig defined.
* @return Collection of type <code>ProductServiceConfig</code>
*/
- Collection getPSCs();
+// Collection getPSCs();
/**
* Returns a <code>ServiceComponentDefn</code>
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationModelContainer.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationModelContainer.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationModelContainer.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -135,21 +135,19 @@
* @return
* @since 4.2
*/
- Collection getProductTypes();
+ // Collection getProductTypes();
/**
* Return a <code>ProductType</code> based on the specified name.
* @return
* @since 4.2
*/
- ProductType getProductType(String fullname);
+ // ProductType getProductType(String fullname);
SharedResource getResource(String resourceName);
Collection getResources();
-
- ConfigurationModelContainer copyAs(ConfigurationID configID) throws
ConfigurationException;
Object clone();
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -126,7 +126,7 @@
* property values will also be copied. The copies will all retain their original
* short names; their full names will reflect the new configuration name.</p>
*/
- Configuration createConfiguration(Configuration original, String newName);
+ // Configuration createConfiguration(Configuration original, String newName);
/**
* Create a new ComponentType instance with the specified name.
@@ -159,7 +159,7 @@
* @param monitored is a boolean insdicating if the type is to be monitored
* @return ComponentType
*/
- ProductType createProductType(String name, boolean deployable, boolean monitored);
+// ProductType createProductType(String name, boolean deployable, boolean monitored);
/**
* Create a new ProductType instance with the specified name.
@@ -170,7 +170,7 @@
* @param monitored is a boolean insdicating if the type is to be monitored
* @return ComponentType
*/
- ProductType createProductType(String name, Collection serviceComponentTypes, boolean
deployable, boolean monitored);
+// ProductType createProductType(String name, Collection serviceComponentTypes,
boolean deployable, boolean monitored);
/**
* Create a new ComponentTypeDefn and update the ComponentType with the new
defintion.
@@ -310,7 +310,7 @@
* will belong to
* @return new ServiceComponentDefn
*/
- ServiceComponentDefn createServiceComponentDefn(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID);
+// ServiceComponentDefn createServiceComponentDefn(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID);
/**
* Create a new ResourceDescriptor Component Definition instance with a specified
configuration
@@ -401,15 +401,13 @@
* @param hostId the host the vm is deployed in.
* @param vmId the VM that the service is deployed in.
* @param serviceComponentDefnID is the service component definition to be deployed
- * @param pscID the ID of the ProductServiceConfig of the
- * ServiceComponentDefn which is to be deployed.
* @param serviceComponentTypeID is type of the service to be deployed
* @return the DeployedComponent instance with the specified ID.
* @throws IllegalArgumentException if either of the IDs null
*
* @see createDeployedServiceComponent(String, Configuration, HostID,
VMComponentDefn)
*/
- DeployedComponent createDeployedServiceComponent(String instanceName, ConfigurationID
configurationID, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID
serviceComponentDefnID, ProductServiceConfigID pscID, ComponentTypeID
serviceComponentTypeID);
+ DeployedComponent createDeployedServiceComponent(String instanceName, ConfigurationID
configurationID, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID
serviceComponentDefnID, ComponentTypeID serviceComponentTypeID);
/**
* Create a new DeployedComponent instance respresenting a deployed Service.
@@ -424,7 +422,7 @@
* @return the DeployedComponent instance with the specified ID.
* @throws IllegalArgumentException if either of the IDs null
*/
- DeployedComponent createDeployedServiceComponent(String instanceName, Configuration
configuration, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfigID pscID);
+// DeployedComponent createDeployedServiceComponent(String instanceName, Configuration
configuration, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfigID pscID);
/**
* Copy-creation method, creates a new PSC from the given PSC, with the
@@ -439,7 +437,7 @@
* @param newName new String name for the new PSC
* @return newly-created ProductServiceConfig object
*/
- ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductServiceConfig originalPSC, String newName);
+// ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductServiceConfig originalPSC, String newName);
/**
* Copy-creation method, creates a new PSC from the given PSC, with the
@@ -463,14 +461,14 @@
* ID objects. Use {@link #addServiceComponentDefn} or
* {@link #removeServiceComponentDefn} in conjuncture with this method.
*/
- ProductServiceConfig createProductServiceConfig(ConfigurationID configurationID,
ProductTypeID productTypeID, String componentName);
+ // ProductServiceConfig createProductServiceConfig(ConfigurationID configurationID,
ProductTypeID productTypeID, String componentName);
/**
* Allows the creation of an empty ProductServiceConfig entirely from
* ID objects. Use {@link #addServiceComponentDefn} or
* {@link #removeServiceComponentDefn} in conjuncture with this method.
*/
- ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductTypeID productTypeID, String componentName);
+// ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductTypeID productTypeID, String componentName);
/**
* Deploys the ServiceComponentDefns indicated by the ProductServiceConfig,
@@ -485,26 +483,24 @@
* @return Collection of DeployedComponent objects, each representing
* one of the deployed ServiceComponentDefns
*/
- Collection deployProductServiceConfig(Configuration configuration,
ProductServiceConfig psc, HostID hostId, VMComponentDefnID vmId);
+ // Collection deployProductServiceConfig(Configuration configuration,
ProductServiceConfig psc, HostID hostId, VMComponentDefnID vmId);
/**
- * Deploys a ServiceComponentDefn anywhere that it's PSC is already
- * deployed. This method is harmless to call if the
- * ServiceComponentDefn is already deployed anywhere. It is
- * also harmless to call if the PSC has not been deployed at
- * all (meaning no other services of the PSC have been deployed.) The
- * ServiceComponentDefn must belong to the PSC, but this method
- * does not check for that. A Collection of any newly-created
+ * Deploys a ServiceComponentDefn to the specified VM.
+ * This method is harmless to call if the
+ * ServiceComponentDefn is already deployed. It is
+ * also harmless to call if the VM has not been started at
+ * all. A Collection of any newly-created
* DeployedComponent objects is returned.
* @param configuration must be the Configuration containing both
- * the ServiceComponentDefn and PSC ID parameters (but this is not
+ * the ServiceComponentDefn and VM ID parameters (but this is not
* checked for in this method)
* @param serviceComponentDefn to be deployed
- * @param pscID PSC ID that may already be deployed somewhere in the
+ * @param vmID VMComponentDefn ID that may already be deployed somewhere in the
* Configuration parameter
- * @return Collection of newly-created DeployedComponent objects
+ * @return DeployedComponent of newly-created DeployedComponent object
*/
- Collection deployServiceDefn(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfigID pscID);
+ DeployedComponent deployServiceDefn(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, VMComponentDefnID vmID);
//
----------------------------------------------------------------------------------
// M O D I F I C A T I O N M E T H O D S
@@ -571,17 +567,6 @@
* will have it's <code>enabled</code> field updated.
* @param enabled whether this service definition should be enabled for
* deployment or not.
- * @param deleteDeployedComps With this parameter the client can control
- * whether any deployed service components of the ServiceComponentDefn
- * parameter are deleted automatically. If <code>false</code> is passed
- * in, and one or more deployed services <i>do</i> exist for the
- * ServiceComponentDefn parameter, a ConfigurationException will be thrown.
- * If <code>true</code> is passed in, any deployed service components
- * in the indicated configuration will be automatically deleted.
- * @return the Collection of affected
- * {@link DeployedComponent DeployedComponents}; either the newly-created
- * DeployedComponents, or the newly-deleted DeployedComponents. If
- * none were affected, a non-null empty Collection will be returned.
* @throws ConfigurationException if <code>false</code> was passed in
for
* the deleteDeployedComps parameter, and any
* {@link DeployedComponent DeployedComponents} exist for the
@@ -591,15 +576,15 @@
*/
- Collection setEnabled(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfig psc, boolean enabled, boolean
deleteDeployedComps)
+ DeployedComponent setEnabled(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, VMComponentDefn vm, boolean enabled)
throws ConfigurationException;
/**
- * It simply modifies the ProductServiceConfig by setting the specified service
- * enabled value and creates the necessary change object.
+ * It simply updates the DeployedComponent by setting the specified service
+ * enabled value.
*/
- ProductServiceConfig setEnabled(ServiceComponentDefnID serviceComponentDefnID,
ProductServiceConfig psc, boolean enabled);
+ DeployedComponent setEnabled(ServiceComponentDefnID serviceComponentDefnID,
DeployedComponent deployComponent, boolean enabled);
/**
@@ -611,8 +596,8 @@
* @return updated ProductServiceConfig
* @throws ConfigurationException
*/
- ProductServiceConfig updateProductServiceConfig(Configuration config,
ProductServiceConfig psc, Collection newServiceIDList)
- throws ConfigurationException;
+// ProductServiceConfig updateProductServiceConfig(Configuration config,
ProductServiceConfig psc, Collection newServiceIDList)
+ // throws ConfigurationException;
/**
@@ -627,7 +612,7 @@
* ProductServiceConfiguration (and removed from any PSC it previously
* belonged to).
*/
- ProductServiceConfig addServiceComponentDefn(Configuration configuration,
ProductServiceConfig psc, ServiceComponentDefnID serviceComponentDefnID);
+// ProductServiceConfig addServiceComponentDefn(Configuration configuration,
ProductServiceConfig psc, ServiceComponentDefnID serviceComponentDefnID);
/**
* Adds an existing ServiceComponentDefn to indicated PSC.
@@ -638,7 +623,7 @@
* ProductServiceConfiguration (and removed from any PSC it previously
* belonged to).
*/
- ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc,
ServiceComponentDefnID serviceComponentDefnID);
+ // ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc,
ServiceComponentDefnID serviceComponentDefnID);
/**
* Deletes the ServiceComponentDefn from the indicated PSC, and from the
@@ -657,7 +642,7 @@
* @param serviceComponentType ComponentType to be added to the
* ProductType
*/
- ProductType addServiceComponentType(ProductType productType, ComponentType
serviceComponentType);
+ // ProductType addServiceComponentType(ProductType productType, ComponentType
serviceComponentType);
/**
* Removes the service type represented by the indicated ComponentType from
@@ -666,7 +651,7 @@
* @param serviceComponentType ComponentType to be taken from the
* ProductType
*/
- ProductType removeServiceComponentType(ProductType productType, ComponentType
serviceComponentType);
+ // ProductType removeServiceComponentType(ProductType productType, ComponentType
serviceComponentType);
/**
* Returns a modifiable properties object for the specified ComponentObject.
@@ -683,7 +668,7 @@
* @param name The new name.
* @return The PSC with its name changed.
*/
- ProductServiceConfig renamePSC(ProductServiceConfig psc, String name) throws
ConfigurationException;
+// ProductServiceConfig renamePSC(ProductServiceConfig psc, String name) throws
ConfigurationException;
/**
* Change the name of a previously defined VM.
@@ -964,7 +949,7 @@
* will belong to
* @return new ConnectorBinding
*/
- ConnectorBinding createConnectorComponent(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) ;
+ // ConnectorBinding createConnectorComponent(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) ;
void addAuthenticationProvider(Configuration configuration, AuthenticationProvider
provider);
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -32,7 +32,7 @@
public static final String COMPONENT_TYPE_NAME = "Connector";
//$NON-NLS-1$
public static final ComponentTypeID CONNECTOR_TYPE_ID = new
ComponentTypeID(COMPONENT_TYPE_NAME);
- public static final ProductTypeID CONNECTOR_PROD_TYPEID = new
ProductTypeID(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME);
+ public static final ProductTypeID CONNECTOR_PROD_TYPEID =
ProductTypeID.PRODUCT_TYPE_ID;
public interface Attributes {
public static final String CONNECTOR_CLASS =
"ConnectorClass";//$NON-NLS-1$
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponent.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponent.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponent.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -62,6 +62,12 @@
* when the deployed component is a VM.
*/
public static final Long SERVICE_UID_FOR_DEPLOYED_VM = new Long(0);
+
+ /**
+ * Indicates if the deployed component is enabled for starting.
+ * @return true if the deployed component is enabled for starting
+ */
+ boolean isEnabled();
/**
* <p>
@@ -96,15 +102,6 @@
public ServiceComponentDefnID getServiceComponentDefnID();
/**
- * Returns the <code>ProductServiceConfigID</code> of the service that
is
- * deployed (if it is a service).
- * Null will be returned if this <code>DeployedComponent</code>
- * is a deployed VM.
- * @return the component id, null when this is a deployed VM
- */
- public ProductServiceConfigID getProductServiceConfigID();
-
- /**
* Returns the <code>ComponentID</code> for the VM that this component
* is deployed on, or if this object represents the deployed VM itself.
* @return the vm id
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponentID.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponentID.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/DeployedComponentID.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -31,7 +31,6 @@
private final HostID hostID;
private final VMComponentDefnID vmID;
private final ServiceComponentDefnID serviceID;
- private final ProductServiceConfigID pscID;
/**
* Instantiate a VM Deployed Component ID
@@ -42,20 +41,18 @@
this.hostID = hostId;
this.vmID = vmId;
this.serviceID = null;
- this.pscID = null;
}
/**
* Instantiate a Service or Connector Binding deployed service, that incorporates
the
* PSC name into it
*/
- public DeployedComponentID(String name, ConfigurationID configId, HostID hostId,
VMComponentDefnID vmId, ProductServiceConfigID pscID, ServiceComponentDefnID serviceId) {
- super(DeployedComponentID.createDeployedName(name, configId, hostId, vmId, pscID,
serviceId));
+ public DeployedComponentID(String name, ConfigurationID configId, HostID hostId,
VMComponentDefnID vmId, ServiceComponentDefnID serviceId) {
+ super(DeployedComponentID.createDeployedName(name, configId, hostId, vmId,
serviceId));
this.configID = configId;
this.hostID = hostId;
this.vmID = vmId;
this.serviceID = serviceId;
- this.pscID = pscID;
}
/**
@@ -83,9 +80,8 @@
/**
* Responsible for creating the structuring Service id for this deployed component
*/
- private static final String createDeployedName(String name, ConfigurationID configID,
HostID hostID, VMComponentDefnID vmComponentID, ProductServiceConfigID pscID,
ServiceComponentDefnID serviceComponentID) {
+ private static final String createDeployedName(String name, ConfigurationID configID,
HostID hostID, VMComponentDefnID vmComponentID, ServiceComponentDefnID serviceComponentID)
{
Assertion.isNotNull(configID);
- Assertion.isNotNull(pscID);
Assertion.isNotNull(hostID);
Assertion.isNotNull(vmComponentID);
Assertion.isNotNull(serviceComponentID);
@@ -96,8 +92,6 @@
sb.append(hostID.getName());
sb.append(IDVerifier.DELIMITER_CHARACTER);
sb.append(vmComponentID.getName());
- sb.append(IDVerifier.DELIMITER_CHARACTER);
- sb.append(pscID.getName());
sb.append(IDVerifier.DELIMITER_CHARACTER);
sb.append(serviceComponentID.getName());
@@ -123,8 +117,5 @@
public ServiceComponentDefnID getServiceID() {
return serviceID;
}
- public ProductServiceConfigID getPscID() {
- return pscID;
- }
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -24,6 +24,8 @@
import java.util.Collection;
+import com.metamatrix.common.config.model.BasicProductType;
+
/**
* <p>A Product, in this context, is simply a named collection of
* Service types. For example, the MetaMatrix Server product has
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -24,6 +24,7 @@
public class ProductTypeID extends ComponentTypeID {
+ public static final ProductTypeID PRODUCT_TYPE_ID = new
ProductTypeID(ProductType.COMPONENT_TYPE_NAME);
// /**
// * This is a Collection of all known type names of
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -87,7 +87,6 @@
/**
* Key = ComponentID Value=Component
*/
- private Map pscs = new HashMap();
private Map svcComponents = new HashMap();
private Map connectors = new HashMap();
private Map authProviders = new HashMap();
@@ -142,12 +141,7 @@
*/
public Map getComponentDefns() {
int s = 1;
-
-
- if (pscs != null) {
- s += pscs.size();
- }
-
+
if (svcComponents != null) {
s += svcComponents.size();
}
@@ -174,7 +168,6 @@
Map comps = new HashMap(s);
- comps.putAll(pscs);
comps.putAll(pools);
comps.putAll(svcComponents);
comps.putAll(vms);
@@ -194,12 +187,7 @@
return true;
}
return false;
- case ComponentType.PSC_COMPONENT_TYPE_CODE:
- if (getPSC(componentID) != null) {
- return true;
- }
- return false;
-
+
case ComponentType.SERVICE_COMPONENT_TYPE_CODE:
if (getServiceComponentDefn(componentID) != null) {
return true;
@@ -245,9 +233,7 @@
switch(BasicUtil.getComponentType(componentID)){
case ComponentType.VM_COMPONENT_TYPE_CODE:
return getVMDefn(componentID);
- case ComponentType.PSC_COMPONENT_TYPE_CODE:
- return getPSC(componentID);
- case ComponentType.SERVICE_COMPONENT_TYPE_CODE:
+ case ComponentType.SERVICE_COMPONENT_TYPE_CODE:
return getServiceComponentDefn(componentID);
case ComponentType.RESOURCE_COMPONENT_TYPE_CODE:
return getConnectionPool(componentID);
@@ -307,14 +293,6 @@
}
- public ProductServiceConfig getPSC(ComponentDefnID componentID) {
-
- if (pscs.containsKey(componentID)) {
- return ((ProductServiceConfig) pscs.get(componentID));
- }
- return null;
- }
-
public ResourceDescriptor getConnectionPool(ComponentDefnID componentID) {
if (pools.containsKey(componentID)) {
@@ -432,13 +410,7 @@
return ids;
}
- allDefnsIDs = pscs.values().iterator();
- ids = getIDs(allDefnsIDs, componentTypeID);
-
- if (ids.size() > 0) {
- return ids;
- }
-
+
allDefnsIDs = pools.values().iterator();
ids = getIDs(allDefnsIDs, componentTypeID);
@@ -480,27 +452,6 @@
}
- /**
- * Returns Collection of ProductServiceConfigID objects for the
- * specified Product type
- * @param productTypeID of product type
- * @return Collection of ProductServiceConfigID objects of this type,
- * contained in this Configuration
- * @deprecated As of GG, please use {@link #getComponentDefnIDs(ComponentTypeID)}
- */
- public Collection getProductServiceConfigIDs(ProductTypeID productTypeID){
- ArrayList ids = new ArrayList();
- Iterator allDefns = pscs.values().iterator();
- ProductServiceConfig aDefn = null;
- while (allDefns.hasNext()){
- aDefn = (ProductServiceConfig)allDefns.next();
- if (aDefn.getComponentTypeID().equals(productTypeID)){
- ids.add(aDefn.getID());
- }
- }
- return ids;
- }
-
public Properties getDependentPropsForComponent(BaseID componentObjectID) {
if (componentObjectID == null) {
return new Properties();
@@ -607,55 +558,8 @@
return comps;
}
+
- public boolean isPSCDeployed(ProductServiceConfigID pscID) {
-
- ProductServiceConfig psc = getPSC(pscID);
- if (psc == null) {
- return false;
- }
-
- for (Iterator it=psc.getServiceComponentDefnIDs().iterator(); it.hasNext();) {
- ServiceComponentDefnID svcID = (ServiceComponentDefnID) it.next();
-
- // check to make sure the service is deployed to the sepecific PSC
- Collection dcs = getDeployedComponents(svcID);
- for (Iterator itdcs = dcs.iterator(); itdcs.hasNext(); ) {
- DeployedComponent dc = (DeployedComponent) itdcs.next();
-
- if (dc.getProductServiceConfigID().equals(pscID)) {
- return true;
- }
- }
-
- }
-
- return false;
-
-
- }
- public Collection getDeployedComponents(ComponentDefnID componentDefnID,
ProductServiceConfigID pscID) {
-
- Collection comps = new ArrayList(deployedComponents.size());
-
- // verify the component is a componentDefn in this configuration
- if (doesExist(componentDefnID)) {
-
- DeployedComponent dc;
- for (Iterator it=getDeployedComponents().iterator(); it.hasNext(); ){
- dc = (DeployedComponent) it.next();
- if (dc.getDeployedComponentDefnID().equals(componentDefnID) &&
- dc.getProductServiceConfigID().equals(pscID) ) {
- comps.add(dc);
- }
- }
- }
-
- return comps;
-
- }
-
-
public VMComponentDefn getVMForHost(VMComponentDefnID vmID, HostID hostID) {
Collection dcs = getVMsForHost(hostID);
@@ -835,8 +739,7 @@
* be returned for the <i>deployed</i> vm that they are deployed to,
* <i>not</i> the vm component definition which may itself be deployed
* many times.
- * @deprecated As of v2.0, replaced by {@link
#getDeployedServicesForVM(DeployedComponent)}
- */
+ */
public Collection getDeployedServicesForVM(VMComponentDefnID vmComponentID) {
if (vmComponentID == null) {
return Collections.EMPTY_LIST;
@@ -883,34 +786,34 @@
* services
* @throws InvalidArgumentException if either parameter is null
*/
- public Collection getDeployedServices(VMComponentDefn vm, ProductServiceConfig psc)
{
- if (vm == null || psc == null) {
- return Collections.EMPTY_LIST;
- }
- VMComponentDefnID vmComponentID = (VMComponentDefnID) vm.getID();
- HostID hostID = vm.getHostID();
- ProductServiceConfigID pscID = (ProductServiceConfigID)psc.getID();
-
- Collection dcs = getDeployedComponents();
+// public Collection getDeployedServices(VMComponentDefn vm, ProductServiceConfig psc)
{
+// if (vm == null || psc == null) {
+// return Collections.EMPTY_LIST;
+// }
+// VMComponentDefnID vmComponentID = (VMComponentDefnID) vm.getID();
+// HostID hostID = vm.getHostID();
+// ProductServiceConfigID pscID = (ProductServiceConfigID)psc.getID();
+//
+// Collection dcs = getDeployedComponents();
+//
+// Collection comps = new ArrayList(dcs.size());
+// DeployedComponent dc;
+//// ComponentDefn comp;
+// for (Iterator it = dcs.iterator(); it.hasNext(); ) {
+// dc = (DeployedComponent) it.next();
+// // if component is a ServiceComponent and the VM id matches
+//// comp = dc.getDeployedComponentDefn(this);
+//// if (comp instanceof ServiceComponentDefn &&
+// if (dc.getVMComponentDefnID().equals(vmComponentID) &&
+// dc.getHostID().equals(hostID) && dc.getProductServiceConfigID()
!= null &&
+// dc.getProductServiceConfigID().equals(pscID)) {
+// comps.add(dc);
+// }
+// }
+// return comps;
+// }
- Collection comps = new ArrayList(dcs.size());
- DeployedComponent dc;
-// ComponentDefn comp;
- for (Iterator it = dcs.iterator(); it.hasNext(); ) {
- dc = (DeployedComponent) it.next();
- // if component is a ServiceComponent and the VM id matches
-// comp = dc.getDeployedComponentDefn(this);
-// if (comp instanceof ServiceComponentDefn &&
- if (dc.getVMComponentDefnID().equals(vmComponentID) &&
- dc.getHostID().equals(hostID) && dc.getProductServiceConfigID()
!= null &&
- dc.getProductServiceConfigID().equals(pscID)) {
- comps.add(dc);
- }
- }
- return comps;
- }
-
/**
* Returns a Collection of ProductServiceConfig objects which have
* ServiceComponentDefns which are deployed to the indicated VM.
@@ -924,34 +827,34 @@
* @return Collection of ProductServiceConfig objects
* @throws InvalidArgumentException if the parameter is null
*/
- public Collection getPSCsForVM(VMComponentDefn vm){
- Iterator deployedServices = this.getDeployedServicesForVM(vm).iterator();
- HashSet result = new HashSet();
- DeployedComponent dc = null;
- while (deployedServices.hasNext()){
- dc = (DeployedComponent)deployedServices.next();
- result.add(this.getPSC((dc.getProductServiceConfigID())));
- }
- return result;
- }
+// public Collection getPSCsForVM(VMComponentDefn vm){
+// Iterator deployedServices = this.getDeployedServicesForVM(vm).iterator();
+// HashSet result = new HashSet();
+// DeployedComponent dc = null;
+// while (deployedServices.hasNext()){
+// dc = (DeployedComponent)deployedServices.next();
+// result.add(this.getPSC((dc.getProductServiceConfigID())));
+// }
+// return result;
+// }
- public Collection getPSCsForServiceDefn(ServiceComponentDefnID serviceDefnID) {
- Collection result = new ArrayList(pscs.size());
- if (serviceDefnID == null) {
- return Collections.EMPTY_LIST;
- }
- Object obj;
- ProductServiceConfig psc = null;
- for (Iterator iter = pscs.values().iterator(); iter.hasNext(); ){
- obj = iter.next();
- psc = (ProductServiceConfig)obj;
- if (psc.getServiceComponentDefnIDs().contains(serviceDefnID)){
- result.add(psc);
- }
- }
- return result;
-
- }
+// public Collection getPSCsForServiceDefn(ServiceComponentDefnID serviceDefnID) {
+// Collection result = new ArrayList(pscs.size());
+// if (serviceDefnID == null) {
+// return Collections.EMPTY_LIST;
+// }
+// Object obj;
+// ProductServiceConfig psc = null;
+// for (Iterator iter = pscs.values().iterator(); iter.hasNext(); ){
+// obj = iter.next();
+// psc = (ProductServiceConfig)obj;
+// if (psc.getServiceComponentDefnIDs().contains(serviceDefnID)){
+// result.add(psc);
+// }
+// }
+// return result;
+//
+// }
public Collection getComponentObjectDependencies(BaseID componentObjectID) {
@@ -977,18 +880,18 @@
* of the BasicServiceComponentDefn cannot check to see if it is
* dependent upon its PSC.
*/
- if (componentObjectID instanceof ProductServiceConfigID) {
- ProductServiceConfigID pscID = (ProductServiceConfigID)componentObjectID;
- ProductServiceConfig psc = (ProductServiceConfig)this.pscs.get(pscID);
- Collection serviceComponentDefns = psc.getServiceComponentDefnIDs();
- Iterator iterator = serviceComponentDefns.iterator();
- while (iterator.hasNext()) {
- ComponentDefnID id = (ComponentDefnID) iterator.next();
- deps.add(getComponentDefn(id));
-
-// deps.add(this.getComponentDefns().get(iterator.next()));
- }
- }else {
+// if (componentObjectID instanceof ProductServiceConfigID) {
+// ProductServiceConfigID pscID = (ProductServiceConfigID)componentObjectID;
+// ProductServiceConfig psc = (ProductServiceConfig)this.pscs.get(pscID);
+// Collection serviceComponentDefns = psc.getServiceComponentDefnIDs();
+// Iterator iterator = serviceComponentDefns.iterator();
+// while (iterator.hasNext()) {
+// ComponentDefnID id = (ComponentDefnID) iterator.next();
+// deps.add(getComponentDefn(id));
+//
+//// deps.add(this.getComponentDefns().get(iterator.next()));
+// }
+// }else {
Map cd = this.getComponentDefns();
for (Iterator it=cd.values().iterator(); it.hasNext(); ) {
@@ -997,7 +900,7 @@
deps.add(co);
}
}
- }
+ // }
@@ -1030,34 +933,7 @@
}
-
- /**
- * Returns a <code>Collection</code> of type
<code>ProductServiceConfig</code> that represent
- * all the ProductServiceConfig defined.
- * @return Collection of type <code>ProductServiceConfig</code>
- * @throws ConfigurationException if an error occurred within or during communication
with the Configuration Service.
- * @see #ProductServiceConfig
- */
- public Collection getPSCs() {
- if (pscs == null) {
- return Collections.EMPTY_LIST;
- }
-
- Collection rd = new ArrayList(pscs.size());
-
- Iterator compDefns = pscs.values().iterator();
- ComponentDefn aDefn = null;
-
- while (compDefns.hasNext()){
- aDefn = (ComponentDefn)compDefns.next();
- rd.add(aDefn);
- }
-
- return rd;
-
- }
-
-
+
/**
* Returns a <code>Collection</code> of type
<code>ServiceComponentDefn</code> that represent
* all the ServiceComponentDefn defined.
@@ -1251,9 +1127,6 @@
case ComponentType.CONNECTOR_COMPONENT_TYPE_CODE:
addConnectorBinding(component);
return;
- case ComponentType.PSC_COMPONENT_TYPE_CODE:
- pscs.put(component.getID(), component);
- return;
case ComponentType.RESOURCE_COMPONENT_TYPE_CODE:
pools.put(component.getID(), component);
return;
@@ -1320,18 +1193,13 @@
removeDeployedVM( vm);
// vms.remove(defnID);
break;
- case ComponentType.PSC_COMPONENT_TYPE_CODE:
- removeDeployedServicesFromPSC((ProductServiceConfigID) componentID);
- pscs.remove(defnID);
- break;
+
case ComponentType.CONNECTOR_COMPONENT_TYPE_CODE:
- removeServiceFromPSCs((ConnectorBindingID)defnID);
- removeConnectorBinding(defnID);
+ removeConnectorBinding(defnID);
break;
case ComponentType.SERVICE_COMPONENT_TYPE_CODE:
- removeServiceFromPSCs((ServiceComponentDefnID)defnID);
- svcComponents.remove(defnID);
+ svcComponents.remove(defnID);
break;
case ComponentType.RESOURCE_COMPONENT_TYPE_CODE:
pools.remove(defnID);
@@ -1367,50 +1235,50 @@
}
- private void removeServiceFromPSCs(ServiceComponentDefnID defnID) {
- if (defnID==null) {
- return;
- }
- Collection pscs = null;
- pscs = getPSCsForServiceDefn(defnID);
-
-
- for (Iterator it=pscs.iterator(); it.hasNext(); ) {
- ProductServiceConfig psc =(ProductServiceConfig) it.next();
- if (psc.containsService(defnID)) {
- BasicProductServiceConfig basicPSC = (BasicProductServiceConfig) psc;
- basicPSC.removeServiceComponentDefnID(defnID);
- }
- }
-
-
- }
+// private void removeServiceFromPSCs(ServiceComponentDefnID defnID) {
+// if (defnID==null) {
+// return;
+// }
+// Collection pscs = null;
+// pscs = getPSCsForServiceDefn(defnID);
+//
+//
+// for (Iterator it=pscs.iterator(); it.hasNext(); ) {
+// ProductServiceConfig psc =(ProductServiceConfig) it.next();
+// if (psc.containsService(defnID)) {
+// BasicProductServiceConfig basicPSC = (BasicProductServiceConfig) psc;
+// basicPSC.removeServiceComponentDefnID(defnID);
+// }
+// }
+//
+//
+// }
- private void removeDeployedServicesFromPSC(ProductServiceConfigID pscID) {
-
- ProductServiceConfig psc = getPSC(pscID);
- if (psc == null) {
- return;
- }
- Iterator serviceDefnIDs = psc.getServiceComponentDefnIDs().iterator();
-
- ServiceComponentDefnID serviceID = null;
- //delete each service definition of this PSC, one by one
- while (serviceDefnIDs.hasNext()){
- serviceID = (ServiceComponentDefnID)serviceDefnIDs.next();
-
- Collection dcs = getDeployedComponents(serviceID, (ProductServiceConfigID)
psc.getID());
-
- if (dcs != null) {
- Iterator dcIter = dcs.iterator();
- while (dcIter.hasNext()) {
- DeployedComponent comp = (DeployedComponent)dcIter.next();
- removeComponentObject((ComponentObjectID)comp.getID());
- }
- }
- }
-
- }
+// private void removeDeployedServicesFromVM(ProductServiceConfigID pscID) {
+//
+// ProductServiceConfig psc = getPSC(pscID);
+// if (psc == null) {
+// return;
+// }
+// Iterator serviceDefnIDs = psc.getServiceComponentDefnIDs().iterator();
+//
+// ServiceComponentDefnID serviceID = null;
+// //delete each service definition of this PSC, one by one
+// while (serviceDefnIDs.hasNext()){
+// serviceID = (ServiceComponentDefnID)serviceDefnIDs.next();
+//
+// Collection dcs = getDeployedComponents(serviceID, (ProductServiceConfigID)
psc.getID());
+//
+// if (dcs != null) {
+// Iterator dcIter = dcs.iterator();
+// while (dcIter.hasNext()) {
+// DeployedComponent comp = (DeployedComponent)dcIter.next();
+// removeComponentObject((ComponentObjectID)comp.getID());
+// }
+// }
+// }
+//
+// }
/**
* used whend removing the complete host
@@ -1462,24 +1330,8 @@
removeDeployedServicesForVM(vm);
-
-// Collection dcs = getDeployedComponents();
-//
-// DeployedComponent dc;
-//
-// for (Iterator it = dcs.iterator(); it.hasNext(); ) {
-// dc = (DeployedComponent) it.next();
-//
-// // only get the deployed VM and let the remove method
-// // handle the actual removing logic
-// if (!dc.isDeployedService()) {
-// if (dc.getVMComponentDefnID().equals(vmID)) {
-// removeDeployedServicesForVM(vm);
-// }
-// }
-// }
-
- vms.remove(vm.getID());
+
+ vms.remove(vm.getID());
@@ -1503,16 +1355,7 @@
}
}
- // now remove the deployed VM
-
-// deployedComponents.remove(vmDeployedComp.getID());
-
- // remove the VM defn
- // *** the assumption is that there is a one-for-one match between
- // the deployed VM and VM Defn. If one gets deleted, so should the other
-
-
}
@@ -1539,8 +1382,7 @@
public void setComponentDefns(Map components) {
- this.pscs = new HashMap();
- this.svcComponents = new HashMap();
+ this.svcComponents = new HashMap();
this.vms = new HashMap();
this.pools = new HashMap();
this.connectors = new HashMap();
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -68,7 +68,8 @@
return factory;
}
- /**
+
+ /**
* Create an instance of this editor, and specify whether actions are to be created
* during modifications. If actions are created, then each action is sent directly
* to the destination at the time the action is created.
@@ -566,114 +567,110 @@
* property values will also be copied. The copies will all retain their original
* short names; their full names will reflect the new configuration name.</p>
*/
- public Configuration createConfiguration(Configuration original, String newName){
- if (original == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0079));
- }
- if (newName == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0081));
- }
- if (original.getName().equals(newName) ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0084,
newName));
- }
-
- BasicConfiguration config = ( BasicConfiguration) createConfiguration(newName);
-
- //copy the configuration properties
- this.modifyProperties(config, original.getProperties(), ADD);
-
- if (original.getHosts() != null) {
- for (Iterator hIt=original.getHosts().iterator(); hIt.hasNext(); ) {
- Host h = (Host) hIt.next();
- this.createHost(config, h, h.getName());
- }
- }
-
- Iterator svcDefns = original.getServiceComponentDefns().iterator();
- while (svcDefns.hasNext()) {
- ServiceComponentDefn sDefn = (ServiceComponentDefn) svcDefns.next();
- this.createServiceComponentDefn(config, sDefn, sDefn.getName());
- }
-
- Iterator vmsDefns = original.getVMComponentDefns().iterator();
- while (vmsDefns.hasNext()) {
- VMComponentDefn vDefn = (VMComponentDefn) vmsDefns.next();
- this.createVMComponentDefn(config, vDefn, vDefn.getName());
- }
-
- Iterator bindings = original.getConnectorBindings().iterator();
- while (bindings.hasNext()) {
- ConnectorBinding cc = (ConnectorBinding) bindings.next();
-
- this.createConnectorComponent(config, cc, cc.getName());
-
- }
-
- Iterator authProviders = original.getAuthenticationProviders().iterator();
- while (authProviders.hasNext()) {
- AuthenticationProvider provider = (AuthenticationProvider) authProviders.next();
-
- this.createAuthenticationProviderComponent(config, provider,
provider.getName());
-
- }
-
- Iterator pscs = original.getPSCs().iterator();
- while (pscs.hasNext()) {
- ProductServiceConfig psc = (ProductServiceConfig) pscs.next();
- this.createProductServiceConfig(config, psc, psc.getName());
- }
-
-
- //copy all internal deployed components
- ConfigurationID configID = (ConfigurationID)config.getID();
- VMComponentDefnID vmID = null;
- ProductServiceConfigID pscID = null;
- DeployedComponent originalDeployed = null;
- ServiceComponentDefn service = null;
-// VMComponentDefn vm = null;
- for (Iterator iter=original.getDeployedComponents().iterator(); iter.hasNext();
){
- originalDeployed = (DeployedComponent)iter.next();
- if (originalDeployed.isDeployedConnector()) {
- ConnectorBindingID serviceID = new ConnectorBindingID(configID,
originalDeployed.getServiceComponentDefnID().getName());
- pscID = new ProductServiceConfigID(configID,
originalDeployed.getProductServiceConfigID().getName());
- vmID = new VMComponentDefnID(configID, originalDeployed.getHostID(),
originalDeployed.getVMComponentDefnID().getName());
- service = config.getConnectorBinding(serviceID);
-
-
- if (service==null) {
- throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0086,
- new Object[] { serviceID, originalDeployed.getName()}));
- }
- this.createDeployedServiceComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vmID, service, pscID);
-
-
- } else if (originalDeployed.isDeployedService()){
-
- ServiceComponentDefnID serviceID = new ServiceComponentDefnID(configID,
originalDeployed.getServiceComponentDefnID().getName());
- pscID = new ProductServiceConfigID(configID,
originalDeployed.getProductServiceConfigID().getName());
- vmID = new VMComponentDefnID(configID, originalDeployed.getHostID(),
originalDeployed.getVMComponentDefnID().getName());
- service = config.getServiceComponentDefn(serviceID);
-
- if (service==null) {
- throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0085,
- new Object[] { serviceID, originalDeployed.getName()}));
- }
- this.createDeployedServiceComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vmID, service, pscID);
- }
-// else {
+// public Configuration createConfiguration(Configuration original, String newName){
+// if (original == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0079));
+// }
+// if (newName == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0081));
+// }
+// if (original.getName().equals(newName) ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0084,
newName));
+// }
+//
+// BasicConfiguration config = ( BasicConfiguration) createConfiguration(newName);
+//
+//
+//
+// //copy the configuration properties
+// this.modifyProperties(config, original.getProperties(), ADD);
+//
+// if (original.getHosts() != null) {
+// for (Iterator hIt=original.getHosts().iterator(); hIt.hasNext(); ) {
+// Host h = (Host) hIt.next();
+// this.createHost(config, h, h.getName());
+// }
+// }
+//
+// Iterator svcDefns = original.getServiceComponentDefns().iterator();
+// while (svcDefns.hasNext()) {
+// ServiceComponentDefn sDefn = (ServiceComponentDefn) svcDefns.next();
+// this.createServiceComponentDefn(config, sDefn, sDefn.getName());
+// }
+//
+// Iterator vmsDefns = original.getVMComponentDefns().iterator();
+// while (vmsDefns.hasNext()) {
+// VMComponentDefn vDefn = (VMComponentDefn) vmsDefns.next();
+// this.createVMComponentDefn(config, vDefn, vDefn.getName());
+// }
+//
+// Iterator bindings = original.getConnectorBindings().iterator();
+// while (bindings.hasNext()) {
+// ConnectorBinding cc = (ConnectorBinding) bindings.next();
+//
+// this.createConnectorComponent(config, cc, cc.getName());
+//
+// }
+//
+// Iterator authProviders = original.getAuthenticationProviders().iterator();
+// while (authProviders.hasNext()) {
+// AuthenticationProvider provider = (AuthenticationProvider) authProviders.next();
+//
+// this.createAuthenticationProviderComponent(config, provider,
provider.getName());
+//
+// }
+//
+//
+// //copy all internal deployed components
+// ConfigurationID configID = (ConfigurationID)config.getID();
+// VMComponentDefnID vmID = null;
+// ProductServiceConfigID pscID = null;
+// DeployedComponent originalDeployed = null;
+// ServiceComponentDefn service = null;
+//// VMComponentDefn vm = null;
+// for (Iterator iter=original.getDeployedComponents().iterator(); iter.hasNext();
){
+// originalDeployed = (DeployedComponent)iter.next();
+// if (originalDeployed.isDeployedConnector()) {
+// ConnectorBindingID serviceID = new ConnectorBindingID(configID,
originalDeployed.getServiceComponentDefnID().getName());
+// pscID = new ProductServiceConfigID(configID,
originalDeployed.getProductServiceConfigID().getName());
+// vmID = new VMComponentDefnID(configID,
originalDeployed.getHostID(), originalDeployed.getVMComponentDefnID().getName());
+// service = config.getConnectorBinding(serviceID);
+//
//
-// this.createVMComponentDefn(config, originalDeployed.getHostID(),
originalDeployed.getComponentTypeID(), originalDeployed.getName());
-//
+// if (service==null) {
+// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0086,
+// new Object[] { serviceID,
originalDeployed.getName()}));
+// }
+// this.createDeployedServiceComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vmID, service, pscID);
+//
+//
+// } else if (originalDeployed.isDeployedService()){
+//
+// ServiceComponentDefnID serviceID = new ServiceComponentDefnID(configID,
originalDeployed.getServiceComponentDefnID().getName());
+// pscID = new ProductServiceConfigID(configID,
originalDeployed.getProductServiceConfigID().getName());
// vmID = new VMComponentDefnID(configID,
originalDeployed.getHostID(), originalDeployed.getVMComponentDefnID().getName());
-// vm = config.getVMComponentDefn(vmID);
-// this.createDeployedVMComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vm);
-// }
- }
+// service = config.getServiceComponentDefn(serviceID);
+//
+// if (service==null) {
+// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0085,
+// new Object[] { serviceID,
originalDeployed.getName()}));
+// }
+// this.createDeployedServiceComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vmID, service, pscID);
+// }
+//// else {
+////
+//// this.createVMComponentDefn(config, originalDeployed.getHostID(),
originalDeployed.getComponentTypeID(), originalDeployed.getName());
+////
+//// vmID = new VMComponentDefnID(configID,
originalDeployed.getHostID(), originalDeployed.getVMComponentDefnID().getName());
+//// vm = config.getVMComponentDefn(vmID);
+//// this.createDeployedVMComponent(originalDeployed.getName(), config,
originalDeployed.getHostID(), vm);
+//// }
+// }
+//
+// Configuration newConfig = (Configuration) config.clone();
+// return newConfig;
+// }
- Configuration newConfig = (Configuration) config.clone();
- return newConfig;
- }
-
public ComponentType createComponentType(int classTypeCode, String name,
ComponentTypeID parentID, ComponentTypeID superID, boolean deployable, boolean monitored)
{
if (name == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
ComponentType.class.getName()));
@@ -721,26 +718,26 @@
* @param monitored is a boolean insdicating if the type is to be monitored
* @return ComponentType
*/
- public ProductType createProductType(String name, Collection serviceComponentTypes,
boolean deployable, boolean monitored) {
-// BasicProductTypeType productType =
(BasicProductTypeType)this.createComponentType(ComponentObject.PRODUCT_COMPONENT_TYPE_CODE,
name, null, ProductTypeType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
+// public ProductType createProductType(String name, Collection serviceComponentTypes,
boolean deployable, boolean monitored) {
+//// BasicProductTypeType productType =
(BasicProductTypeType)this.createComponentType(ComponentObject.PRODUCT_COMPONENT_TYPE_CODE,
name, null, ProductTypeType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
+//
+// BasicProductType productType = (BasicProductType) createProductType(name,
deployable, monitored);
+// //(BasicProductType)
BasicUtil.createComponentObject(ComponentObject.PRODUCT_COMPONENT_TYPE_CODE,
ProductType.PRODUCT_TYPE_ID, name);
+//
+// //this code sets up the legal service types for the product type
+//// ComponentTypeID productTypeID = productType.getComponentTypeID();
+// ComponentType serviceComponentType = null;
+// Iterator iter = serviceComponentTypes.iterator();
+// while (iter.hasNext()){
+//
+// serviceComponentType = (ComponentType)iter.next();
+//// this.setParentComponentTypeID(serviceComponentType, productTypeID);
+// //add the service ComponentTypeID to the BasicProductType
+//
productType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
+// }
+// return productType;
+// }
- BasicProductType productType = (BasicProductType) createProductType(name,
deployable, monitored);
- //(BasicProductType)
BasicUtil.createComponentObject(ComponentObject.PRODUCT_COMPONENT_TYPE_CODE,
ProductType.PRODUCT_TYPE_ID, name);
-
- //this code sets up the legal service types for the product type
-// ComponentTypeID productTypeID = productType.getComponentTypeID();
- ComponentType serviceComponentType = null;
- Iterator iter = serviceComponentTypes.iterator();
- while (iter.hasNext()){
-
- serviceComponentType = (ComponentType)iter.next();
-// this.setParentComponentTypeID(serviceComponentType, productTypeID);
- //add the service ComponentTypeID to the BasicProductType
- productType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
- }
- return productType;
- }
-
/**
* Create a new ProductType instance with the specified name. Use
* {@link createProductType(String, Collection, boolean, boolean)} to
@@ -750,15 +747,15 @@
* @param monitored is a boolean insdicating if the type is to be monitored
* @return ComponentType
*/
- public ProductType createProductType(String name, boolean deployable, boolean
monitored) {
-// ProductType productType =
(ProductType)this.createComponentType(ComponentType.PRODUCT_COMPONENT_TYPE_CODE, name,
null, ProductTypeType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
+// public ProductType createProductType(String name, boolean deployable, boolean
monitored) {
+//// ProductType productType =
(ProductType)this.createComponentType(ComponentType.PRODUCT_COMPONENT_TYPE_CODE, name,
null, ProductTypeType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
+//
+// BasicProductType productType = (BasicProductType)
BasicUtil.createComponentType(ComponentType.PRODUCT_COMPONENT_TYPE_CODE, name, null,
ProductType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
+//// createComponentObject(ComponentDefn.PRODUCT_COMPONENT_CODE,
ProductType.PRODUCT_TYPE_ID, name);
+//
+// return productType;
+// }
- BasicProductType productType = (BasicProductType)
BasicUtil.createComponentType(ComponentType.PRODUCT_COMPONENT_TYPE_CODE, name, null,
ProductType.PRODUCT_SUPER_TYPE_ID, deployable, monitored);
-// createComponentObject(ComponentDefn.PRODUCT_COMPONENT_CODE,
ProductType.PRODUCT_TYPE_ID, name);
-
- return productType;
- }
-
/**
* This method is not provided in the interface, it is only used by the
* spi implementation for ease of creating the correct type of component defn.
@@ -873,7 +870,7 @@
return bv;
}
- public DeployedComponent createDeployedServiceComponent(String name, Configuration
configuration, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfigID pscID) {
+ public DeployedComponent createDeployedServiceComponent(String name, Configuration
configuration, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefn
serviceComponentDefn) {
if ( name == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
DeployedComponent.class.getName()));
}
@@ -889,9 +886,6 @@
if (serviceComponentDefn == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ServiceComponentDefn.class.getName()));
}
- if (pscID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
- }
ConfigurationID configID = (ConfigurationID) configuration.getID();
@@ -903,8 +897,7 @@
configID,
hostId,
vmId,
- (ServiceComponentDefnID)
serviceComponentDefn.getID(),
- pscID,
+ (ServiceComponentDefnID)
serviceComponentDefn.getID(),
serviceComponentDefn.getComponentTypeID());
@@ -922,7 +915,7 @@
/*
* @see createDeployedServiceComponent(String, Configuration, HostID,
VMComponentDefn)
*/
- public DeployedComponent createDeployedServiceComponent(String name, ConfigurationID
configurationID, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID
serviceComponentDefnID, ProductServiceConfigID pscID, ComponentTypeID
serviceComponentTypeID) {
+ public DeployedComponent createDeployedServiceComponent(String name, ConfigurationID
configurationID, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID
serviceComponentDefnID, ComponentTypeID serviceComponentTypeID) {
if ( name == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
DeployedComponent.class.getName()));
}
@@ -941,9 +934,6 @@
if (serviceComponentTypeID == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ComponentTypeID.class.getName()));
}
- if (pscID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
- }
// DeployedComponentID id = new DeployedComponentID(name, configurationID,
hostId, vmId, pscID, serviceComponentDefnID);
@@ -955,7 +945,6 @@
hostId,
vmId,
serviceComponentDefnID,
-
pscID,
serviceComponentTypeID);
// BasicDeployedComponent deployComponent = new BasicDeployedComponent(id,
@@ -1120,38 +1109,38 @@
* will belong to
* @return new ServiceComponentDefn
*/
- public ServiceComponentDefn createServiceComponentDefn(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) {
- if ( configuration == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
- }
- if ( pscID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
- }
- ProductServiceConfig psc =
(ProductServiceConfig)configuration.getComponentDefn(pscID);
+// public ServiceComponentDefn createServiceComponentDefn(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) {
+// if ( configuration == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
+// }
+// if ( pscID == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
+// }
+// ProductServiceConfig psc =
(ProductServiceConfig)configuration.getComponentDefn(pscID);
+//
+// Assertion.isNotNull(psc, "PSC " + pscID + " does not
exist"); //$NON-NLS-1$ //$NON-NLS-2$
+// ConfigurationID configurationID = (ConfigurationID)configuration.getID();
+//
+// BasicServiceComponentDefn newServiceDefn = (BasicServiceComponentDefn)
BasicUtil.createComponentDefn(ComponentDefn.SERVICE_COMPONENT_CODE, configurationID,
typeID, componentName);
+//
+//// BasicComponentDefn.getInstance(ComponentDefn.SERVICE_COMPONENT_DEFN_CODE,
+//// configurationID,
+//// typeID,
+//// componentName);
+// // add the service to the psc so that this relationship is found in the
deployServiceDefn method
+// addServiceComponentDefn(psc, (ServiceComponentDefnID) newServiceDefn.getID());
+//
+// ServiceComponentDefn newDefn = (ServiceComponentDefn)
newServiceDefn.clone();
+//
+// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
+// bc.addComponentDefn(newDefn);
+//
+// //automatically deploy the service anywhere that the PSC is already
deployed
+// this.deployServiceDefn(bc,newDefn,pscID);
+//
+// return newDefn;
+// }
- Assertion.isNotNull(psc, "PSC " + pscID + " does not exist");
//$NON-NLS-1$ //$NON-NLS-2$
- ConfigurationID configurationID = (ConfigurationID)configuration.getID();
-
- BasicServiceComponentDefn newServiceDefn = (BasicServiceComponentDefn)
BasicUtil.createComponentDefn(ComponentDefn.SERVICE_COMPONENT_CODE, configurationID,
typeID, componentName);
-
-// BasicComponentDefn.getInstance(ComponentDefn.SERVICE_COMPONENT_DEFN_CODE,
-// configurationID,
-// typeID,
-// componentName);
- // add the service to the psc so that this relationship is found in the
deployServiceDefn method
- addServiceComponentDefn(psc, (ServiceComponentDefnID) newServiceDefn.getID());
-
- ServiceComponentDefn newDefn = (ServiceComponentDefn)
newServiceDefn.clone();
-
- BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
- bc.addComponentDefn(newDefn);
-
- //automatically deploy the service anywhere that the PSC is already deployed
- this.deployServiceDefn(bc,newDefn,pscID);
-
- return newDefn;
- }
-
public ServiceComponentDefn createServiceComponentDefn(Configuration configuration,
ComponentTypeID typeID, String componentName) {
if ( configuration == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
@@ -1465,76 +1454,76 @@
* @param newName new String name for the new PSC
* @return newly-created ProductServiceConfig object
*/
- public ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductServiceConfig originalPSC, String newName){
- if ( configuration == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
- }
+// public ProductServiceConfig createProductServiceConfig(Configuration configuration,
ProductServiceConfig originalPSC, String newName){
+// if ( configuration == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
+// }
+//
+// if (originalPSC == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+//
+// if (newName == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
ProductServiceConfig.class.getName()));
+// }
+//
+// ProductServiceConfig psc = createProductServiceConfig(configuration,
(ProductTypeID) originalPSC.getComponentTypeID(),newName);
+//
+// this.modifyProperties(psc, originalPSC.getProperties(), ADD);
+//
+// Iterator iter = originalPSC.getServiceComponentDefnIDs().iterator();
+// ServiceComponentDefnID originalServiceDefnID = null;
+// while (iter.hasNext()){
+// originalServiceDefnID = (ServiceComponentDefnID)iter.next();
+// this.addServiceComponentDefn(psc, originalServiceDefnID);
+//
+// }
+//
+// ProductServiceConfig newPSC = (ProductServiceConfig) psc.clone();
+// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
+// bc.addComponentDefn(newPSC);
+// return newPSC;
+// }
- if (originalPSC == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
-
- if (newName == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
ProductServiceConfig.class.getName()));
- }
-
- ProductServiceConfig psc = createProductServiceConfig(configuration, (ProductTypeID)
originalPSC.getComponentTypeID(),newName);
-
- this.modifyProperties(psc, originalPSC.getProperties(), ADD);
-
- Iterator iter = originalPSC.getServiceComponentDefnIDs().iterator();
- ServiceComponentDefnID originalServiceDefnID = null;
- while (iter.hasNext()){
- originalServiceDefnID = (ServiceComponentDefnID)iter.next();
- this.addServiceComponentDefn(psc, originalServiceDefnID);
-
- }
-
- ProductServiceConfig newPSC = (ProductServiceConfig) psc.clone();
- BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
- bc.addComponentDefn(newPSC);
- return newPSC;
- }
-
/**
* Allows the creation of an empty ProductServiceConfig entirely from
* ID objects.
*/
- public ProductServiceConfig createProductServiceConfig(ConfigurationID
configurationID, ProductTypeID productTypeID, String componentName){
- if ( configurationID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ConfigurationID.class.getName()));
- }
+// public ProductServiceConfig createProductServiceConfig(ConfigurationID
configurationID, ProductTypeID productTypeID, String componentName){
+// if ( configurationID == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ConfigurationID.class.getName()));
+// }
+//
+// if (productTypeID == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ComponentTypeID.class.getName()));
+// }
+//
+// if (componentName == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
ProductServiceConfig.class.getName()));
+// }
+//
+//
+//
+// BasicProductServiceConfig psc = (BasicProductServiceConfig)
BasicUtil.createComponentDefn(ComponentDefn.PSC_COMPONENT_CODE, configurationID,
productTypeID, componentName);
+//// BasicComponentDefn.getInstance(ComponentDefn.PRODUCT_SERVICE_DEFN_CODE,
+//// configurationID,
+//// productTypeID,
+//// componentName);
+//
+// createCreationAction(psc.getID(), psc);
+//
+// ProductServiceConfig newPSC = (ProductServiceConfig) psc.clone();
+// return newPSC;
+// }
- if (productTypeID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ComponentTypeID.class.getName()));
- }
- if (componentName == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0087,
ProductServiceConfig.class.getName()));
- }
-
+// public ProductServiceConfig createProductServiceConfig(Configuration config,
ProductTypeID productTypeID, String name) {
+// ProductServiceConfig psc =
createProductServiceConfig((ConfigurationID)config.getID(), productTypeID, name);
+// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(config,BasicConfiguration.class);
+// bc.addComponentDefn(psc);
+// return psc;
+// }
-
- BasicProductServiceConfig psc = (BasicProductServiceConfig)
BasicUtil.createComponentDefn(ComponentDefn.PSC_COMPONENT_CODE, configurationID,
productTypeID, componentName);
-// BasicComponentDefn.getInstance(ComponentDefn.PRODUCT_SERVICE_DEFN_CODE,
-// configurationID,
-// productTypeID,
-// componentName);
-
- createCreationAction(psc.getID(), psc);
-
- ProductServiceConfig newPSC = (ProductServiceConfig) psc.clone();
- return newPSC;
- }
-
-
- public ProductServiceConfig createProductServiceConfig(Configuration config,
ProductTypeID productTypeID, String name) {
- ProductServiceConfig psc =
createProductServiceConfig((ConfigurationID)config.getID(), productTypeID, name);
- BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(config,BasicConfiguration.class);
- bc.addComponentDefn(psc);
- return psc;
- }
-
/**
* Deploys the ServiceComponentDefns indicated by the ProductServiceConfig,
* contained by the Configuration, onto the specified Host and VM.
@@ -1548,68 +1537,68 @@
* @return Collection of DeployedComponent objects, each representing
* one of the deployed ServiceComponentDefns
*/
- public Collection deployProductServiceConfig(Configuration configuration,
ProductServiceConfig psc, HostID hostId, VMComponentDefnID vmId){
- if ( configuration == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
- }
- if ( hostId == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
HostID.class.getName()));
- }
- if ( vmId == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
VMComponentDefnID.class.getName()));
- }
- if (psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
-// ConfigurationID configID = (ConfigurationID) configuration.getID();
- ProductServiceConfigID pscID = ( ProductServiceConfigID) psc.getID();
-
- Collection serviceComponentDefnIDs = psc.getServiceComponentDefnIDs();
- HashSet result = new HashSet(serviceComponentDefnIDs.size());
- Iterator iter = serviceComponentDefnIDs.iterator();
- ServiceComponentDefn serviceDefn = null;
- ServiceComponentDefnID serviceDefnID = null;
- while (iter.hasNext()){
-
- serviceDefnID = (ServiceComponentDefnID)iter.next();
- serviceDefn =
(ServiceComponentDefn)configuration.getComponentDefn(serviceDefnID);
-
- //only deploy the service defn if it is enabled
- if (psc.isServiceEnabled(serviceDefnID)) {
- DeployedComponentID id = new DeployedComponentID(serviceDefnID.getName(),
(ConfigurationID) configuration.getID(), hostId, vmId, pscID, serviceDefnID);
-
- if (configuration.getDeployedComponent(id) != null) {
- continue;
- }
-
- DeployedComponent dc =
this.createDeployedServiceComponent(serviceDefnID.getName(), configuration, hostId, vmId,
serviceDefn, pscID);
- result.add(dc);
-// DeployedComponentID id = new
DeployedComponentID(serviceDefnID.getName(), configID, hostId, vmId, pscID,
serviceDefnID);
-// BasicDeployedComponent deployComponent = new
BasicDeployedComponent(id,
-// configID,
-// hostId,
-// vmId,
-// serviceDefnID,
-// pscID,
-//
serviceDefn.getComponentTypeID());
-
-// createCreationAction(id, deployComponent );
-
-// try {
-// DeployedComponent newDefn = (DeployedComponent)
deployComponent.clone();
+// public Collection deployProductServiceConfig(Configuration configuration,
ProductServiceConfig psc, HostID hostId, VMComponentDefnID vmId){
+// if ( configuration == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
+// }
+// if ( hostId == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
HostID.class.getName()));
+// }
+// if ( vmId == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
VMComponentDefnID.class.getName()));
+// }
+// if (psc == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+//// ConfigurationID configID = (ConfigurationID) configuration.getID();
+// ProductServiceConfigID pscID = ( ProductServiceConfigID) psc.getID();
//
-// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
-// bc.addDeployedComponent(newDefn);
+// Collection serviceComponentDefnIDs = psc.getServiceComponentDefnIDs();
+// HashSet result = new HashSet(serviceComponentDefnIDs.size());
+// Iterator iter = serviceComponentDefnIDs.iterator();
+// ServiceComponentDefn serviceDefn = null;
+// ServiceComponentDefnID serviceDefnID = null;
+// while (iter.hasNext()){
//
-// result.add( newDefn);
-// } catch (CloneNotSupportedException e) {
-// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0078,
-// new Object[] {DeployedComponent.class.getName(),
e.getMessage()}));
+// serviceDefnID = (ServiceComponentDefnID)iter.next();
+// serviceDefn =
(ServiceComponentDefn)configuration.getComponentDefn(serviceDefnID);
+//
+// //only deploy the service defn if it is enabled
+// if (psc.isServiceEnabled(serviceDefnID)) {
+// DeployedComponentID id = new
DeployedComponentID(serviceDefnID.getName(), (ConfigurationID) configuration.getID(),
hostId, vmId, pscID, serviceDefnID);
+//
+// if (configuration.getDeployedComponent(id) != null) {
+// continue;
// }
- }
- }
- return result;
- }
+//
+// DeployedComponent dc =
this.createDeployedServiceComponent(serviceDefnID.getName(), configuration, hostId, vmId,
serviceDefn, pscID);
+// result.add(dc);
+//// DeployedComponentID id = new
DeployedComponentID(serviceDefnID.getName(), configID, hostId, vmId, pscID,
serviceDefnID);
+//// BasicDeployedComponent deployComponent = new
BasicDeployedComponent(id,
+//// configID,
+//// hostId,
+//// vmId,
+////
serviceDefnID,
+//// pscID,
+////
serviceDefn.getComponentTypeID());
+//
+//// createCreationAction(id, deployComponent );
+//
+//// try {
+//// DeployedComponent newDefn = (DeployedComponent)
deployComponent.clone();
+////
+//// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
+//// bc.addDeployedComponent(newDefn);
+////
+//// result.add( newDefn);
+//// } catch (CloneNotSupportedException e) {
+//// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0078,
+//// new Object[] {DeployedComponent.class.getName(),
e.getMessage()}));
+//// }
+// }
+// }
+// return result;
+// }
/**
* This method will update a PSC by adding the new service list of ID's and
removing
@@ -1620,69 +1609,69 @@
* @return updated ProductServiceConfig
* @throws ConfigurationException
*/
- public ProductServiceConfig updateProductServiceConfig(Configuration config,
ProductServiceConfig psc, Collection newServiceIDList) throws ConfigurationException
{
- if ( config == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
- }
- if (psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
-
- if (newServiceIDList == null) {
- return psc;
- }
-
- // keep the old-current services for later processing
- HashSet set = new HashSet();
- set.addAll(psc.getServiceComponentDefnIDs());
-
- ProductServiceConfig c = (ProductServiceConfig) psc.clone();
-
- BasicProductServiceConfig basicPSC = (BasicProductServiceConfig)
verifyTargetClass(c,BasicProductServiceConfig.class);
- basicPSC.resetServices();
- // 1st - deploy the service to the PSC
- ProductServiceConfigID pscID = (ProductServiceConfigID) psc.getID();
-
-
- // all the services have been removed from this psc
- // def# 12847 not removing the last service from a psc
- if (newServiceIDList.isEmpty()) {
- basicPSC.resetServices();
- } else {
-
- for (Iterator it = newServiceIDList.iterator(); it.hasNext(); ) {
- // if the service isnt associated with the psc, then add it
- // and also deploy it
- ServiceComponentDefnID sid = (ServiceComponentDefnID)it.next();
- ServiceComponentDefn sd = (ServiceComponentDefn)
config.getComponentDefn(sid);
+// public ProductServiceConfig updateProductServiceConfig(Configuration config,
ProductServiceConfig psc, Collection newServiceIDList) throws ConfigurationException
{
+// if ( config == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
+// }
+// if (psc == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+//
+// if (newServiceIDList == null) {
+// return psc;
+// }
+//
+// // keep the old-current services for later processing
+// HashSet set = new HashSet();
+// set.addAll(psc.getServiceComponentDefnIDs());
+//
+// ProductServiceConfig c = (ProductServiceConfig) psc.clone();
+//
+// BasicProductServiceConfig basicPSC = (BasicProductServiceConfig)
verifyTargetClass(c,BasicProductServiceConfig.class);
+// basicPSC.resetServices();
+// // 1st - deploy the service to the PSC
+// ProductServiceConfigID pscID = (ProductServiceConfigID) psc.getID();
+//
+//
+// // all the services have been removed from this psc
+// // def# 12847 not removing the last service from a psc
+// if (newServiceIDList.isEmpty()) {
+// basicPSC.resetServices();
+// } else {
+//
+// for (Iterator it = newServiceIDList.iterator(); it.hasNext(); ) {
+// // if the service isnt associated with the psc, then add it
+// // and also deploy it
+// ServiceComponentDefnID sid = (ServiceComponentDefnID)it.next();
+// ServiceComponentDefn sd = (ServiceComponentDefn)
config.getComponentDefn(sid);
+//
+// if (psc.containsService(sid)) {
+// // remove it from the set so that whats left are those
+// // that have to be removed from the psc
+// set.remove(sid);
+//
+// } else {
+// deployServiceDefn(config, sd, pscID);
+// }
+//
+// basicPSC.addServiceComponentDefnID(sid);
+//
+// }
+// }
+//
+// // 2nd - remove any services no longer selected
+// for (Iterator it = set.iterator(); it.hasNext(); ) {
+// ServiceComponentDefnID sid = (ServiceComponentDefnID) it.next();
+// ServiceComponentDefn sdefn = (ServiceComponentDefn)
config.getComponentDefn(sid);
+// // set the service enabled flag to false so that it will be undeployed
+// this.setEnabled(config, sdefn, psc, false, true);
+// }
+// createExchangeAction(pscID,ConfigurationModel.Attribute.UPDATE_PSC,
newServiceIDList, Boolean.TRUE);
+//
+// return basicPSC;
+//
+// }
- if (psc.containsService(sid)) {
- // remove it from the set so that whats left are those
- // that have to be removed from the psc
- set.remove(sid);
-
- } else {
- deployServiceDefn(config, sd, pscID);
- }
-
- basicPSC.addServiceComponentDefnID(sid);
-
- }
- }
-
- // 2nd - remove any services no longer selected
- for (Iterator it = set.iterator(); it.hasNext(); ) {
- ServiceComponentDefnID sid = (ServiceComponentDefnID) it.next();
- ServiceComponentDefn sdefn = (ServiceComponentDefn)
config.getComponentDefn(sid);
- // set the service enabled flag to false so that it will be undeployed
- this.setEnabled(config, sdefn, psc, false, true);
- }
- createExchangeAction(pscID,ConfigurationModel.Attribute.UPDATE_PSC,
newServiceIDList, Boolean.TRUE);
-
- return basicPSC;
-
- }
-
/**
* This will update / replace the existing component type with the specified
* component type.
@@ -1730,39 +1719,38 @@
}
- public ProductServiceConfig setEnabled(ServiceComponentDefnID serviceComponentDefnID,
ProductServiceConfig psc, boolean enabled) {
+ public DeployedComponent setEnabled(ServiceComponentDefnID serviceComponentDefnID,
DeployedComponent deployedcomponent, boolean enabled) {
if ( serviceComponentDefnID == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ServiceComponentDefnID.class.getName()));
}
- if ( psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+ if ( deployedcomponent == null ) {
+ throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
DeployedComponent.class.getName()));
}
- if (!psc.containsService(serviceComponentDefnID)) {
- return psc;
-// throw new ConfigurationException("Service " + svcID + " is not
currently part of PSC " + psc.getName() + ", therefore the service cannot be
enabled for this PSC");
+ if
(!deployedcomponent.getDeployedComponentDefnID().equals(serviceComponentDefnID)) {
+ return deployedcomponent;
}
- boolean oldEnabled = psc.isServiceEnabled(serviceComponentDefnID);
+ boolean oldEnabled = deployedcomponent.isEnabled();
//if a change is not being made to the enabled value, this whole method
//will be essentially bypassed
if (enabled != oldEnabled){
- BasicProductServiceConfig basicPSC = (BasicProductServiceConfig)
verifyTargetClass(psc,BasicProductServiceConfig.class);
- basicPSC.setServiceEnabled(serviceComponentDefnID, enabled);
+ BasicDeployedComponent basicDC = (BasicDeployedComponent)
verifyTargetClass(deployedcomponent,BasicDeployedComponent.class);
+ basicDC.setIsEnabled(enabled);
-
createExchangeAction(basicPSC.getID(),ConfigurationModel.Attribute.IS_ENABLED,
serviceComponentDefnID, Boolean.valueOf(enabled));
+ createExchangeAction(basicDC.getID(),ConfigurationModel.Attribute.IS_ENABLED,
serviceComponentDefnID, Boolean.valueOf(enabled));
- return basicPSC;
+ return basicDC;
} //end if enabled!= oldEnabled
- return psc;
+ return deployedcomponent;
}
- public Collection setEnabled(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfig psc, boolean enabled, boolean
deleteDeployedComps)
+ public DeployedComponent setEnabled(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, VMComponentDefn vm, boolean enabled)
throws ConfigurationException {
if ( configuration == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
@@ -1770,73 +1758,65 @@
if ( serviceComponentDefn == null ) {
throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ServiceComponentDefn.class.getName()));
}
- if ( psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+ if ( vm == null ) {
+ throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
VMComponentDefn.class.getName()));
}
- Collection result = null;
+ ServiceComponentDefnID svcID = (ServiceComponentDefnID)
serviceComponentDefn.getID();
- ServiceComponentDefnID svcID = (ServiceComponentDefnID)
serviceComponentDefn.getID();
+ DeployedComponent dc = configuration.getDeployedServiceForVM(svcID, vm);
+ return this.setEnabled(svcID, dc, enabled);
- if (!psc.containsService(svcID)) {
- throw new
ConfigurationException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0091,
- new Object[] { svcID, psc.getName()} ));
- }
- boolean oldEnabled = psc.isServiceEnabled(svcID);
-
-
-
//if a change is not being made to the enabled value, this whole method
//will be essentially bypassed
- if (enabled != oldEnabled){
- psc = this.setEnabled(svcID, psc, enabled);
+// if (enabled != dc.isEnabled()){
+// dc = this.setEnabled(svcID, dc, enabled);
+//
+// BasicConfiguration targetConfig = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
+//
+//
+// // if disabling and there are deployed components, then undeploy the
components
+// if (!enabled && deleteDeployedComps) {
+//
+// if (!deps.isEmpty()) {
+// DeployedComponent deployedService;
+// DeployedComponentID deployedServiceID;
+// result = new ArrayList(deps.size());
+// for (Iterator it=deps.iterator(); it.hasNext(); ) {
+// deployedService = (DeployedComponent) it.next();
+// deployedServiceID = (DeployedComponentID)
deployedService.getID();
+//
+// this.createDestroyAction(deployedServiceID, deployedService);
+// targetConfig.removeComponentObject(deployedServiceID );
+//
+// DeployedComponent ds =
targetConfig.getDeployedComponent(deployedServiceID);
+// if (ds != null) {
+// throw new ConfigurationException("Deployed Component
" + deployedServiceID + " was not removed"); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// DeployedComponent newService = (DeployedComponent)
deployedService.clone();
+// result.add(newService);
+// }
+// }
+// } else if (enabled){
+// //we must automagically create DeployedComponents for the newly-
+// //enabled service defn, wherever its PSC has already been deployed
+// ProductServiceConfigID pscID = (ProductServiceConfigID) psc.getID();
+// result =
this.deployServiceDefn(targetConfig,serviceComponentDefn,pscID);
+//
+// }
+//
+// //this will overwrite the service if it already is in the Configuration
+// targetConfig.addComponentDefn(psc);
+//
+// } //end if enabled!= oldEnabled
+// if (result == null){
+// result = Collections.EMPTY_LIST;
+//
+// }
+// return result;
- BasicConfiguration targetConfig = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
- Collection deps = targetConfig.getDeployedComponents(svcID,
(ProductServiceConfigID) psc.getID());
-
- // if disabling and there are deployed components, then undeploy the
components
- if (!enabled && deleteDeployedComps) {
-
- if (!deps.isEmpty()) {
- DeployedComponent deployedService;
- DeployedComponentID deployedServiceID;
- result = new ArrayList(deps.size());
- for (Iterator it=deps.iterator(); it.hasNext(); ) {
- deployedService = (DeployedComponent) it.next();
- deployedServiceID = (DeployedComponentID)
deployedService.getID();
-
- this.createDestroyAction(deployedServiceID, deployedService);
- targetConfig.removeComponentObject(deployedServiceID );
-
- DeployedComponent ds =
targetConfig.getDeployedComponent(deployedServiceID);
- if (ds != null) {
- throw new ConfigurationException("Deployed Component
" + deployedServiceID + " was not removed"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- DeployedComponent newService = (DeployedComponent)
deployedService.clone();
- result.add(newService);
- }
- }
- } else if (enabled){
- //we must automagically create DeployedComponents for the newly-
- //enabled service defn, wherever its PSC has already been deployed
- ProductServiceConfigID pscID = (ProductServiceConfigID) psc.getID();
- result =
this.deployServiceDefn(targetConfig,serviceComponentDefn,pscID);
-
- }
-
- //this will overwrite the service if it already is in the Configuration
- targetConfig.addComponentDefn(psc);
-
- } //end if enabled!= oldEnabled
- if (result == null){
- result = Collections.EMPTY_LIST;
-
- }
- return result;
-
-
}
@@ -1864,9 +1844,9 @@
* ProductServiceConfiguration (and removed from any PSC it previously
* belonged to).
*/
- public ProductServiceConfig addServiceComponentDefn(Configuration configuration,
ProductServiceConfig psc, ServiceComponentDefnID serviceComponentDefnID){
- return this.addServiceComponentDefn(psc, serviceComponentDefnID);
- }
+// public ProductServiceConfig addServiceComponentDefn(Configuration configuration,
ProductServiceConfig psc, ServiceComponentDefnID serviceComponentDefnID){
+// return this.addServiceComponentDefn(psc, serviceComponentDefnID);
+// }
/**
* Adds an existing ServiceComponentDefn to indicated PSC.
@@ -1878,26 +1858,26 @@
* ProductServiceConfiguration (and removed from any PSC it previously
* belonged to).
*/
- public ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc,
ServiceComponentDefnID serviceComponentDefnID){
- if ( psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
- if ( serviceComponentDefnID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ServiceComponentDefnID.class.getName()));
- }
+// public ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc,
ServiceComponentDefnID serviceComponentDefnID){
+// if ( psc == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+// if ( serviceComponentDefnID == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ServiceComponentDefnID.class.getName()));
+// }
+//
+// BasicProductServiceConfig basicPSC = (BasicProductServiceConfig)
verifyTargetClass(psc,BasicProductServiceConfig.class);
+// basicPSC.addServiceComponentDefnID(serviceComponentDefnID);
+//
+// //todo get old PSC of this service defn
+// //ProductServiceConfigID oldValue =
serviceComponentDefn.getParentComponentTypeID();
+//
createExchangeAction(serviceComponentDefnID,ConfigurationModel.Attribute.PSC_NAME, null,
basicPSC.getID());
+//
+//
+// ProductServiceConfig newDefn = (ProductServiceConfig) basicPSC.clone();
+// return newDefn;
+// }
- BasicProductServiceConfig basicPSC = (BasicProductServiceConfig)
verifyTargetClass(psc,BasicProductServiceConfig.class);
- basicPSC.addServiceComponentDefnID(serviceComponentDefnID);
-
- //todo get old PSC of this service defn
- //ProductServiceConfigID oldValue =
serviceComponentDefn.getParentComponentTypeID();
-
createExchangeAction(serviceComponentDefnID,ConfigurationModel.Attribute.PSC_NAME, null,
basicPSC.getID());
-
-
- ProductServiceConfig newDefn = (ProductServiceConfig) basicPSC.clone();
- return newDefn;
- }
-
/**
* Adds the service type represented by the indicated ComponentType to
* the list of legal service types of the indicated ProductType.
@@ -1905,17 +1885,17 @@
* @param serviceComponentType ComponentType to be added to the
* ProductType
*/
- public ProductType addServiceComponentType(ProductType productType, ComponentType
serviceComponentType){
- BasicProductType basicProdType = (BasicProductType)productType;
+// public ProductType addServiceComponentType(ProductType productType, ComponentType
serviceComponentType){
+// BasicProductType basicProdType = (BasicProductType)productType;
+//
+// ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
+// this.setParentComponentTypeID(serviceComponentType, productTypeID);
+// //add the service ComponentTypeID to the BasicProductType
+// basicProdType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
+//
+// return basicProdType;
+// }
- ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
- this.setParentComponentTypeID(serviceComponentType, productTypeID);
- //add the service ComponentTypeID to the BasicProductType
- basicProdType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
-
- return basicProdType;
- }
-
/**
* Removes the service type represented by the indicated ComponentType from
* the list of legal service types of the indicated ProductType.
@@ -1923,17 +1903,17 @@
* @param serviceComponentType ComponentType to be taken from the
* ProductType
*/
- public ProductType removeServiceComponentType(ProductType productType, ComponentType
serviceComponentType){
- BasicProductType basicProdType = (BasicProductType)productType;
+// public ProductType removeServiceComponentType(ProductType productType,
ComponentType serviceComponentType){
+// BasicProductType basicProdType = (BasicProductType)productType;
+//
+// ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
+// this.setParentComponentTypeID(serviceComponentType, productTypeID);
+// //add the service ComponentTypeID to the BasicProductType
+//
basicProdType.removeServiceTypeID((ComponentTypeID)serviceComponentType.getID());
+//
+// return basicProdType;
+// }
- ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
- this.setParentComponentTypeID(serviceComponentType, productTypeID);
- //add the service ComponentTypeID to the BasicProductType
-
basicProdType.removeServiceTypeID((ComponentTypeID)serviceComponentType.getID());
-
- return basicProdType;
- }
-
/**
* Sets the LogConfiguration in effect for the Configuration
*/
@@ -2351,24 +2331,24 @@
* @param name The new name.
* @return The PSC with its name changed.
*/
- public ProductServiceConfig renamePSC(ProductServiceConfig psc, String name) throws
ConfigurationException {
- if ( psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
- BasicProductServiceConfig target = (BasicProductServiceConfig)
verifyTargetClass(psc,BasicProductServiceConfig.class);
- ConfigurationID configID = target.getConfigurationID();
+// public ProductServiceConfig renamePSC(ProductServiceConfig psc, String name) throws
ConfigurationException {
+// if ( psc == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+// BasicProductServiceConfig target = (BasicProductServiceConfig)
verifyTargetClass(psc,BasicProductServiceConfig.class);
+// ConfigurationID configID = target.getConfigurationID();
+//
+//// ProductServiceConfigID newID = new ProductServiceConfigID(configID, name);
+//// ComponentTypeID typeID = target.getComponentTypeID();
+// target = (BasicProductServiceConfig)
BasicUtil.createComponentDefn(ComponentDefn.PSC_COMPONENT_CODE, configID,
psc.getComponentTypeID(), name) ;
+//
+// createExchangeAction( target.getID(), ConfigurationModel.Attribute.NAME,
+// target.getName(), name );
+//
+//// new BasicProductServiceConfig(configID, newID, psc.getProductTypeID());
+// return target;
+// }
-// ProductServiceConfigID newID = new ProductServiceConfigID(configID, name);
-// ComponentTypeID typeID = target.getComponentTypeID();
- target = (BasicProductServiceConfig)
BasicUtil.createComponentDefn(ComponentDefn.PSC_COMPONENT_CODE, configID,
psc.getComponentTypeID(), name) ;
-
- createExchangeAction( target.getID(), ConfigurationModel.Attribute.NAME,
- target.getName(), name );
-
-// new BasicProductServiceConfig(configID, newID, psc.getProductTypeID());
- return target;
- }
-
/**
* Change the name of a previously defined VM in the Next Startup config.
* @param vm The VM whose name to change.
@@ -2397,13 +2377,10 @@
public boolean isDeployed(ServiceComponentDefnID defnID, Configuration config) {
- Iterator iterator = config.getDeployedComponents().iterator();
- while (iterator.hasNext()) {
- DeployedComponent comp = (DeployedComponent)iterator.next();
- ServiceComponentDefnID depDefnID = comp.getServiceComponentDefnID();
- if (defnID.equals(depDefnID)) {
- return true;
- }
+ Collection dcs = config.getDeployedComponents(defnID);
+ if (dcs != null && dcs.size() > 0) {
+ return true;
+
}
return false;
}
@@ -2616,34 +2593,34 @@
return newDefn;
}
- public ConnectorBinding createConnectorComponent(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) {
- if ( configuration == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
- }
- if ( pscID == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
- }
- ProductServiceConfig psc =
(ProductServiceConfig)configuration.getComponentDefn(pscID);
- if (psc == null ) {
- throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
- }
+// public ConnectorBinding createConnectorComponent(Configuration configuration,
ComponentTypeID typeID, String componentName, ProductServiceConfigID pscID) {
+// if ( configuration == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
Configuration.class.getName()));
+// }
+// if ( pscID == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfigID.class.getName()));
+// }
+// ProductServiceConfig psc =
(ProductServiceConfig)configuration.getComponentDefn(pscID);
+// if (psc == null ) {
+// throw new
IllegalArgumentException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0089,
ProductServiceConfig.class.getName()));
+// }
+//
+// BasicConnectorBinding newServiceDefn = (BasicConnectorBinding)
+// createConnectorComponent((ConfigurationID) configuration.getID(), typeID,
componentName, null);
+//
+// // add the service to the psc so that this relationship is found in the
deployServiceDefn method
+// addServiceComponentDefn(psc, (ServiceComponentDefnID) newServiceDefn.getID());
+//
+// BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
+// bc.addComponentDefn(newServiceDefn);
+//
+// //automatically deploy the service anywhere that the PSC is already deployed
+// this.deployServiceDefn(bc,newServiceDefn,pscID);
+//
+// return newServiceDefn;
+// }
- BasicConnectorBinding newServiceDefn = (BasicConnectorBinding)
- createConnectorComponent((ConfigurationID) configuration.getID(), typeID,
componentName, null);
- // add the service to the psc so that this relationship is found in the
deployServiceDefn method
- addServiceComponentDefn(psc, (ServiceComponentDefnID) newServiceDefn.getID());
-
- BasicConfiguration bc = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
- bc.addComponentDefn(newServiceDefn);
-
- //automatically deploy the service anywhere that the PSC is already deployed
- this.deployServiceDefn(bc,newServiceDefn,pscID);
-
- return newServiceDefn;
- }
-
-
public ConnectorBinding createConnectorComponent(ConfigurationID configurationID,
ConnectorBinding original, String newName, String routingUUID) {
if (original == null ) {
@@ -2794,96 +2771,91 @@
//
----------------------------------------------------------------------------------
/**
- * Deploys a ServiceComponentDefn anywhere that it's PSC is already
- * deployed. This method is harmless to call if the
- * ServiceComponentDefn is already deployed anywhere. It is
- * also harmless to call if the PSC has not been deployed at
- * all (meaning no other services of the PSC have been deployed.)
- * If the ServiceComponentDefn does not belong to the PSC, it
- * will be added. A Collection of any newly-created
- * DeployedComponent objects is returned.
+ * Deploys a ServiceComponentDefn to the specified VM
+ * This method is harmless to call if the
+ * ServiceComponentDefn is already deployed anywhere.
* @param configuration must be the Configuration containing both
* the ServiceComponentDefn and PSC ID parameters (but this is not
* checked for in this method)
* @param serviceComponentDefn to be deployed
- * @param pscID PSC ID that may already be deployed somewhere in the
- * Configuration parameter
- * @return Collection of newly-created DeployedComponent objects
+ * @param VMID VM ID indicates the process to deploy the service to
+ * @return DeployedComponent of newly-created DeployedComponent object
*/
- public Collection deployServiceDefn(Configuration configuration, ServiceComponentDefn
serviceComponentDefn, ProductServiceConfigID pscID) {
- Collection result = null;
-
- BasicServiceComponentDefn basicService = (BasicServiceComponentDefn)
verifyTargetClass(serviceComponentDefn,BasicServiceComponentDefn.class);
+ public DeployedComponent deployServiceDefn(Configuration configuration,
ServiceComponentDefn serviceComponentDefn, VMComponentDefnID vmID) {
+ BasicServiceComponentDefn basicService = (BasicServiceComponentDefn)
verifyTargetClass(serviceComponentDefn,BasicServiceComponentDefn.class);
BasicConfiguration targetConfig = (BasicConfiguration)
verifyTargetClass(configuration,BasicConfiguration.class);
//we must automagically create DeployedComponents for the newly-
//enabled service defn, wherever its PSC has already been deployed
DeployedComponent aDeployedComponent = null;
- ProductServiceConfigID aPscID = null;
- HostID hostID = null;
- VMComponentDefnID vmID = null;
- ConfigurationID configID = (ConfigurationID)targetConfig.getID();
+ HostID hostID = null;
+ ConfigurationID configID = (ConfigurationID)targetConfig.getID();
ServiceComponentDefnID serviceDefnID =
(ServiceComponentDefnID)basicService.getID();
- //ProductServiceConfigID pscID =
targetConfig.getPSCForServiceDefn(serviceDefnID);
+
+ VMComponentDefn vm = targetConfig.getVMComponentDefn(vmID);
+ DeployedComponent deployComponent = targetConfig.getDeployedServiceForVM(
serviceDefnID, vm);
+
+ // if its not deployed, deploy it
+ if (deployComponent == null) {
+ DeployedComponentID id = new DeployedComponentID(serviceDefnID.getName(),
configID, hostID, vmID, serviceDefnID);
+ deployComponent =
this.createDeployedServiceComponent(serviceDefnID.getName(), configuration, hostID, vmID,
basicService);
- ProductServiceConfig psc = targetConfig.getPSC(pscID);
+ }
- HashSet deployedIDs = new HashSet();
- for ( Iterator iter = targetConfig.getDeployedComponents().iterator();
iter.hasNext(); ){
- aDeployedComponent = (DeployedComponent)iter.next();
- aPscID = aDeployedComponent.getProductServiceConfigID();
- if (aPscID != null && aPscID.equals(pscID)){
- hostID = aDeployedComponent.getHostID();
- vmID = aDeployedComponent.getVMComponentDefnID();
-
-
- DeployedComponentID id = new DeployedComponentID(serviceDefnID.getName(),
configID, hostID, vmID, pscID, serviceDefnID);
- if (!deployedIDs.contains(id)){
- deployedIDs.add(id);
-
- DeployedComponent deployComponent =
this.createDeployedServiceComponent(serviceDefnID.getName(), configuration, hostID, vmID,
basicService, aPscID);
-// BasicDeployedComponent deployComponent = new
BasicDeployedComponent(id,
-// configID,
-// hostID,
-// vmID,
-//
serviceDefnID,
-// pscID,
-//
basicService.getComponentTypeID());
+// HashSet deployedIDs = new HashSet();
+// for ( Iterator iter = targetConfig.getDeployedServiceForVM(serviceDefnID,
vm).iterator(); iter.hasNext(); ){
+// aDeployedComponent = (DeployedComponent)iter.next();
+// VMComponentDefnID aVMID = aDeployedComponent.getVMComponentDefnID();
+// if (aVMID != null && aVMID.equals(vmID)){
+// hostID = aDeployedComponent.getHostID();
+// // vmID = aDeployedComponent.getVMComponentDefnID();
//
-// createCreationAction(id, deployComponent );
-
-// try {
-// DeployedComponent newService = (DeployedComponent)
deployComponent.clone();
-// targetConfig.addDeployedComponent(newService);
- if (result == null){
- result = new ArrayList();
- }
- result.add(deployComponent);
-
-
- if (psc.getServiceComponentDefnIDs() == null) {
- addServiceComponentDefn(psc, serviceDefnID);
-
- } else {
- if (!psc.getServiceComponentDefnIDs().contains(serviceDefnID))
{
- addServiceComponentDefn(psc, serviceDefnID);
- }
- }
-
-// } catch (CloneNotSupportedException e) {
-// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0078,
-// new Object[] {DeployedComponent.class.getName(),
e.getMessage()}));
-// }
- }
- }
- }
+//
+// DeployedComponentID id = new
DeployedComponentID(serviceDefnID.getName(), configID, hostID, vmID, serviceDefnID);
+// if (!deployedIDs.contains(id)){
+// deployedIDs.add(id);
+//
+// DeployedComponent deployComponent =
this.createDeployedServiceComponent(serviceDefnID.getName(), configuration, hostID, vmID,
basicService, aPscID);
+//// BasicDeployedComponent deployComponent = new
BasicDeployedComponent(id,
+////
configID,
+//// hostID,
+//// vmID,
+////
serviceDefnID,
+//// pscID,
+////
basicService.getComponentTypeID());
+////
+//// createCreationAction(id, deployComponent );
+//
+//// try {
+//// DeployedComponent newService = (DeployedComponent)
deployComponent.clone();
+//// targetConfig.addDeployedComponent(newService);
+// if (result == null){
+// result = new ArrayList();
+// }
+// result.add(deployComponent);
+//
+//
+// if (psc.getServiceComponentDefnIDs() == null) {
+// addServiceComponentDefn(psc, serviceDefnID);
+//
+// } else {
+// if (!psc.getServiceComponentDefnIDs().contains(serviceDefnID))
{
+// addServiceComponentDefn(psc, serviceDefnID);
+// }
+// }
+//
+//// } catch (CloneNotSupportedException e) {
+//// throw new
RuntimeException(CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0078,
+//// new Object[] {DeployedComponent.class.getName(),
e.getMessage()}));
+//// }
+// }
+// }
+// }
//this will overwrite the service if it already is in the Configuration
targetConfig.addComponentDefn(basicService);
- if (result == null){
- result = Collections.EMPTY_LIST;
- }
- return result;
+
+ return deployComponent;
}
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -54,12 +54,12 @@
super(copy);
}
- public boolean isOfConnectorProductType() {
- if
(getParentComponentTypeID().getFullName().equalsIgnoreCase(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME))
{
- return true;
- }
- return false;
- }
+// public boolean isOfConnectorProductType() {
+// if
(getParentComponentTypeID().getFullName().equalsIgnoreCase(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME))
{
+// return true;
+// }
+// return false;
+// }
public boolean isOfTypeConnector() {
return true;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicDeployedComponent.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicDeployedComponent.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicDeployedComponent.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -73,9 +73,9 @@
* @clientCardinality 1
*/
private VMComponentDefnID vmComponentID;
+
+ private boolean isEnabled;
- private ProductServiceConfigID pscID;
-
/**
* Constructor takes a <code>ComponentID, HostID, </code> and
<code> Collection </code> of system components to declare a component as being
deployed.
* @param deployedID is the DeployedComponentID
@@ -85,11 +85,11 @@
* @param serviceComponentID is the ServiceComponentID (null if this is a deployed
VM)
*/
public BasicDeployedComponent(DeployedComponentID deployedId, ConfigurationID
configId, HostID hostId, VMComponentDefnID vmId, ComponentTypeID deployedTypeID) {
- this(deployedId, configId, hostId, vmId, null, null, deployedTypeID);
+ this(deployedId, configId, hostId, vmId, null, deployedTypeID);
}
- public BasicDeployedComponent(DeployedComponentID deployedId, ConfigurationID
configId, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID serviceId,
ProductServiceConfigID pscID, ComponentTypeID deployedTypeID) {
+ public BasicDeployedComponent(DeployedComponentID deployedId, ConfigurationID
configId, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID serviceId,
ComponentTypeID deployedTypeID) {
super(deployedId, deployedTypeID);
this.configurationID = configId;
this.hostID = hostId;
@@ -97,9 +97,6 @@
if (serviceId != null) {
this.componentID = serviceId;
}
- if (pscID != null){
- this.pscID = pscID;
- }
}
@@ -110,10 +107,17 @@
this.vmComponentID = deployedComponent.getVMComponentDefnID();
if (deployedComponent.getServiceComponentDefnID() != null) {
this.componentID = deployedComponent.getServiceComponentDefnID();
- this.pscID = deployedComponent.getProductServiceConfigID();
}
}
+ public boolean isEnabled() {
+ return this.isEnabled;
+ }
+
+ public void setIsEnabled(boolean enable) {
+ this.isEnabled = enable;
+ }
+
/**
* Indicates whether this object represents a deployed
* service component definition (returns true) or
@@ -149,16 +153,6 @@
}
- /**
- * Returns the <code>ProductServiceConfigID</code> of the
ServiceComponentDefn that is
- * deployed. Null will be returned if this
<code>DeployedComponent</code>
- * is a deployed VM.
- * @return the component id, null when this is a deployed VM
- */
- public ProductServiceConfigID getProductServiceConfigID(){
- return pscID;
- }
-
public ServiceComponentDefnID getServiceComponentDefnID() {
return componentID;
}
@@ -200,14 +194,8 @@
}
return componentID.equals(componentObjectId);
- } else if (componentObjectId instanceof ProductServiceConfigID) {
- if (pscID == null) {
- return false;
- }
+ }
- return pscID.equals(componentObjectId);
- }
-
return false;
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductServiceConfig.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductServiceConfig.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductServiceConfig.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -30,6 +30,7 @@
import com.metamatrix.common.config.api.ConfigurationID;
import com.metamatrix.common.config.api.ProductServiceConfig;
import com.metamatrix.common.config.api.ProductServiceConfigID;
+import com.metamatrix.common.config.api.ProductType;
import com.metamatrix.common.config.api.ProductTypeID;
import com.metamatrix.common.config.api.ServiceComponentDefnID;
@@ -41,8 +42,8 @@
private HashMap serviceComponentDefnIDs;
- public BasicProductServiceConfig(ConfigurationID configurationID,
ProductServiceConfigID componentID, ProductTypeID productTypeID) {
- super(configurationID, componentID, productTypeID);
+ public BasicProductServiceConfig(ConfigurationID configurationID,
ProductServiceConfigID componentID) {
+ super(configurationID, componentID, ProductType.PRODUCT_TYPE_ID);
serviceComponentDefnIDs = new HashMap();
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductType.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicProductType.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -28,8 +28,10 @@
import com.metamatrix.common.config.api.ComponentTypeID;
import com.metamatrix.common.config.api.ProductType;
+import com.metamatrix.common.config.api.ProductTypeID;
public class BasicProductType extends BasicComponentType implements ProductType,
Serializable {
+ public static final ProductType PRODUCT_TYPE = new
BasicProductType(ProductTypeID.PRODUCT_TYPE_ID, null, ProductType.PRODUCT_SUPER_TYPE_ID,
false, false, false);
private HashSet componentTypeIDs;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicUtil.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicUtil.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicUtil.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -128,20 +128,20 @@
* @param defnName is the name of the component defn
* @return BasicComponentDefn
*/
- public static final BasicComponentDefn createComponentDefn(int defnTypeCode,
ConfigurationID configID, ProductTypeID typeID, String defnName) {
-
- BasicComponentDefn defn = null;
-
- if (defnTypeCode == ComponentDefn.PSC_COMPONENT_CODE) {
- ProductServiceConfigID pscID = new ProductServiceConfigID(configID,
defnName);
- defn = new BasicProductServiceConfig(configID, pscID, typeID);
-
- } else {
- Assertion.assertTrue(true, "DefnTypeCode:" + defnTypeCode + "
is not defined in BasicUtil.createComponentDefn"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return defn;
- }
+// public static final BasicComponentDefn createComponentDefn(int defnTypeCode,
ConfigurationID configID, String defnName) {
+//
+// BasicComponentDefn defn = null;
+//
+// if (defnTypeCode == ComponentDefn.PSC_COMPONENT_CODE) {
+// ProductServiceConfigID pscID = new ProductServiceConfigID(configID,
defnName);
+// defn = new BasicProductServiceConfig(configID, pscID);
+//
+// } else {
+// Assertion.assertTrue(true, "DefnTypeCode:" + defnTypeCode + "
is not defined in BasicUtil.createComponentDefn"); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+//
+// return defn;
+// }
@@ -171,7 +171,8 @@
return defn;
}
-
+
+
/**
* static method that is used to create the specified instance type of
BasicComponentType.
@@ -199,9 +200,9 @@
type = new BasicComponentType(typeID, parentID, superID, deployable, false,
monitored);
classTypeCode = ComponentType.CONFIGURATION_COMPONENT_TYPE_CODE;
- } else if
(name.equalsIgnoreCase(ProductServiceConfigComponentType.COMPONENT_TYPE_NAME)) {
- type = new BasicProductServiceConfigType(typeID, parentID, superID,
deployable, false, monitored);
- classTypeCode = ComponentType.PSC_COMPONENT_TYPE_CODE;
+// } else if
(name.equalsIgnoreCase(ProductServiceConfigComponentType.COMPONENT_TYPE_NAME)) {
+// type = new BasicProductServiceConfigType(typeID, parentID, superID,
deployable, false, monitored);
+// classTypeCode = ComponentType.PSC_COMPONENT_TYPE_CODE;
} else if (name.equalsIgnoreCase("DeployedComponent")) { //$NON-NLS-1$
// type = new BasicDeployedComponentType(typeID, parentID, superID,
deployable, false, monitored);
@@ -210,22 +211,21 @@
classTypeCode = ComponentType.DEPLOYED_COMPONENT_TYPE_CODE;
+// } else //if (name.equalsIgnoreCase(ProductType.COMPONENT_TYPE_NAME) ||
+// if ( classTypeCode ==
ComponentType.PRODUCT_COMPONENT_TYPE_CODE ) {
+// ProductTypeID prodtypeID = new ProductTypeID(name);
+// classTypeCode = ComponentType.PRODUCT_COMPONENT_TYPE_CODE;
+//
+// type = new BasicProductType(prodtypeID, parentID, superID, deployable,
false, monitored);
- } else //if (name.equalsIgnoreCase(ProductType.COMPONENT_TYPE_NAME) ||
- if ( classTypeCode ==
ComponentType.PRODUCT_COMPONENT_TYPE_CODE ) {
- ProductTypeID prodtypeID = new ProductTypeID(name);
- classTypeCode = ComponentType.PRODUCT_COMPONENT_TYPE_CODE;
-
- type = new BasicProductType(prodtypeID, parentID, superID, deployable, false,
monitored);
-
} else if (classTypeCode == ComponentType.CONNECTOR_COMPONENT_TYPE_CODE) {
type = new BasicConnectorBindingType(typeID, parentID, superID, deployable,
false, monitored);
} else if (classTypeCode == ComponentType.AUTHPROVIDER_COMPONENT_TYPE_CODE) {
type = new BasicAuthenticationProviderType(typeID, parentID, superID,
deployable, false, monitored);
} else if (classTypeCode == ComponentType.SERVICE_COMPONENT_TYPE_CODE) {
type = new BasicServiceComponentType(typeID, parentID, superID, deployable,
false, monitored);
- } else if (classTypeCode == ComponentType.PSC_COMPONENT_TYPE_CODE) {
- type = new BasicProductServiceConfigType(typeID, parentID, superID,
deployable, false, monitored);
+// } else if (classTypeCode == ComponentType.PSC_COMPONENT_TYPE_CODE) {
+// type = new BasicProductServiceConfigType(typeID, parentID, superID,
deployable, false, monitored);
// } else if (classTypeCode == ComponentDefn.VM_COMPONENT_TYPE_CODE) {
// type = new BasicVMComponentDefnType(typeID, parentID, superID, deployable,
false, monitored);
@@ -252,16 +252,15 @@
return type;
}
- public static BasicDeployedComponent createDeployedComponent(String name,
ConfigurationID configID, HostID hostID, VMComponentDefnID vmID, ServiceComponentDefnID
svcID, ProductServiceConfigID pscID, ComponentTypeID typeID) {
+ public static BasicDeployedComponent createDeployedComponent(String name,
ConfigurationID configID, HostID hostID, VMComponentDefnID vmID, ServiceComponentDefnID
svcID, ComponentTypeID typeID) {
- DeployedComponentID id = new DeployedComponentID(name, configID, hostID, vmID,
pscID, svcID);
+ DeployedComponentID id = new DeployedComponentID(name, configID, hostID, vmID,
svcID);
BasicDeployedComponent deployComponent = new BasicDeployedComponent(id,
configID,
hostID,
vmID,
- svcID,
- pscID,
+ svcID,
typeID);
return deployComponent;
}
@@ -284,8 +283,6 @@
public static int getComponentType(BaseObject defn) {
if (defn instanceof Host) {
return ComponentType.HOST_COMPONENT_TYPE_CODE;
- } else if (defn instanceof ProductServiceConfig) {
- return ComponentType.PSC_COMPONENT_TYPE_CODE;
}else if(defn instanceof VMComponentDefn) {
return ComponentType.VM_COMPONENT_TYPE_CODE;
}else if(defn instanceof ConnectorBinding) {
@@ -311,9 +308,7 @@
static int getComponentType(BaseID defnID) {
if (defnID instanceof HostID) {
return ComponentType.HOST_COMPONENT_TYPE_CODE;
- } else if (defnID instanceof ProductServiceConfigID) {
- return ComponentType.PSC_COMPONENT_TYPE_CODE;
- }else if(defnID instanceof VMComponentDefnID) {
+ }else if(defnID instanceof VMComponentDefnID) {
return ComponentType.VM_COMPONENT_TYPE_CODE;
}else if(defnID instanceof ResourceDescriptorID) {
return ComponentType.RESOURCE_COMPONENT_TYPE_CODE;
@@ -346,8 +341,6 @@
public static int getComponentDefnType(BaseObject defn) {
if (defn instanceof Host) {
return ComponentDefn.HOST_COMPONENT_CODE;
- } else if (defn instanceof ProductServiceConfig) {
- return ComponentDefn.PSC_COMPONENT_CODE;
}else if(defn instanceof VMComponentDefn) {
return ComponentDefn.VM_COMPONENT_CODE;
}else if(defn instanceof ConnectorBinding) {
@@ -364,8 +357,7 @@
return ComponentDefn.DEPLOYED_COMPONENT_CODE;
} else if (defn instanceof SharedResource) {
return ComponentDefn.SHARED_RESOURCE_COMPONENT_CODE;
- } else if (defn instanceof ProductType) {
- return ComponentDefn.PRODUCT_COMPONENT_CODE;
+
} else {
Assertion.assertTrue(false, "Process Error: component defn object of type
" + defn.getClass().getName() + " not accounted for."); //$NON-NLS-1$
//$NON-NLS-2$
@@ -373,39 +365,6 @@
return -1;
}
-
-public static int getComponentDefnType(BaseID id) {
- if (id instanceof HostID) {
- return ComponentDefn.HOST_COMPONENT_CODE;
- } else if (id instanceof ProductServiceConfigID) {
- return ComponentDefn.PSC_COMPONENT_CODE;
- }else if(id instanceof VMComponentDefnID) {
- return ComponentDefn.VM_COMPONENT_CODE;
- }else if(id instanceof ConnectorBindingID) {
- return ComponentDefn.CONNECTOR_COMPONENT_CODE;
- }else if(id instanceof ResourceDescriptorID) {
- return ComponentDefn.RESOURCE_DESCRIPTOR_COMPONENT_CODE;
- }else if(id instanceof ServiceComponentDefnID) {
- return ComponentDefn.SERVICE_COMPONENT_CODE;
- }else if(id instanceof AuthenticationProviderID) {
- return ComponentDefn.AUTHPROVIDER_COMPONENT_CODE;
- }else if (id instanceof ConfigurationID) {
- return ComponentDefn.CONFIGURATION_COMPONENT_CODE;
- } else if (id instanceof DeployedComponentID) {
- return ComponentDefn.DEPLOYED_COMPONENT_CODE;
- } else if (id instanceof SharedResourceID) {
- return ComponentDefn.SHARED_RESOURCE_COMPONENT_CODE;
- } else if (id instanceof ProductTypeID) {
- return ComponentDefn.PRODUCT_COMPONENT_CODE;
-
- } else {
- Assertion.assertTrue(false, "Process Error: component defn object of type
" + id.getClass().getName() + " not accounted for."); //$NON-NLS-1$
//$NON-NLS-2$
- }
-
- return -1;
-}
-
-
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerImpl.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerImpl.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationModelContainerImpl.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -67,16 +67,16 @@
private Map compTypes = Collections.synchronizedMap(new HashMap(45));
- private Map prodTypes = Collections.synchronizedMap(new HashMap(10));
-
-
private Map resources = Collections.synchronizedMap(new HashMap(25));
public ConfigurationModelContainerImpl() {
}
-
- public ConfigurationModelContainerImpl(ArrayList configObjects) throws
ConfigurationException {
+
+
+
+
+ public ConfigurationModelContainerImpl(ArrayList configObjects) throws
ConfigurationException {
this.setConfigurationObjects(configObjects);
}
@@ -128,8 +128,6 @@
configObjects.addAll(getConfiguration().getDeployedComponents());
- configObjects.addAll(getConfiguration().getPSCs());
-
// Add the objects that are not configuration based, meaning they
// are not added,updated,delete within the context of a configuration
configObjects.addAll(getHosts());
@@ -366,15 +364,15 @@
}
public ProductType getProductType(String name) {
- if (prodTypes.containsKey(name)) {
- return (ProductType) prodTypes.get(name);
- }
+ if (BasicProductType.PRODUCT_TYPE.getName().equalsIgnoreCase(name)) {
+ return BasicProductType.PRODUCT_TYPE;
+ }
return null;
}
- public Collection getProductTypes() {
- Collection pts = new ArrayList(this.prodTypes.size());
- pts.addAll(this.prodTypes.values());
+ public Collection<ProductType> getProductTypes() {
+ Collection<ProductType> pts = new ArrayList<ProductType>(1);
+ pts.add(BasicProductType.PRODUCT_TYPE);
return pts;
}
@@ -392,22 +390,22 @@
return result;
}
- public ConfigurationModelContainer copyAs(ConfigurationID configID) throws
ConfigurationException {
- BasicConfigurationObjectEditor ceditor = new BasicConfigurationObjectEditor(false);
+// public ConfigurationModelContainer copyAs(ConfigurationID configID) throws
ConfigurationException {
+// BasicConfigurationObjectEditor ceditor = new
BasicConfigurationObjectEditor(false);
+//
+//
+// Configuration newConfig = ceditor.createConfiguration(configuration,
configID.getFullName());
+// ConfigurationModelContainerImpl newConfigModel = new
ConfigurationModelContainerImpl(newConfig);
+//
+// newConfigModel.setComponentTypes(this.compTypes);
+//// newConfigModel.setProductTypes(this.prodTypes.values());
+//
+// newConfigModel.setResources(this.resources);
+//
+// return newConfigModel;
+// }
- Configuration newConfig = ceditor.createConfiguration(configuration,
configID.getFullName());
- ConfigurationModelContainerImpl newConfigModel = new
ConfigurationModelContainerImpl(newConfig);
-
- newConfigModel.setComponentTypes(this.compTypes);
- newConfigModel.setProductTypes(this.prodTypes.values());
-
- newConfigModel.setResources(this.resources);
-
- return newConfigModel;
- }
-
-
public void setComponentTypes(Map newCompTypes) {
this.compTypes = Collections.synchronizedMap(new HashMap(newCompTypes.size()));
@@ -417,16 +415,16 @@
}
}
- public void setProductTypes(Collection newProdTypes) {
- this.prodTypes = Collections.synchronizedMap(new HashMap(newProdTypes.size()));
+// public void setProductTypes(Collection newProdTypes) {
+// this.prodTypes = Collections.synchronizedMap(new
HashMap(newProdTypes.size()));
+//
+// Iterator it = newProdTypes.iterator();
+// while (it.hasNext()) {
+// addProductType((ProductType)it.next());
+// }
+// }
- Iterator it = newProdTypes.iterator();
- while (it.hasNext()) {
- addProductType((ProductType)it.next());
- }
- }
-
public void setResources(Map theResources) {
this.resources = Collections.synchronizedMap(new HashMap(theResources.size()));
this.resources.putAll(theResources);
@@ -457,9 +455,9 @@
}
- public void addProductType(ProductType type) {
- prodTypes.put(type.getFullName(), type);
- }
+// public void addProductType(ProductType type) {
+// prodTypes.put(type.getFullName(), type);
+// }
@@ -510,16 +508,16 @@
ConfigurationObjectEditorHelper.addConfigurationHostComponent(configuration, host);
- } else if (obj instanceof ProductServiceConfig) {
- ProductServiceConfig psc = (ProductServiceConfig) obj;
+// } else if (obj instanceof ProductServiceConfig) {
+// ProductServiceConfig psc = (ProductServiceConfig) obj;
+//
+//
+// if (configuration == null) {
+// throw new ConfigurationException(ErrorMessageKeys.CONFIG_0001,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_0001));
+// }
+//
+// ConfigurationObjectEditorHelper.addConfigurationComponentDefn(configuration, psc);
-
- if (configuration == null) {
- throw new ConfigurationException(ErrorMessageKeys.CONFIG_0001,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_0001));
- }
-
- ConfigurationObjectEditorHelper.addConfigurationComponentDefn(configuration, psc);
-
} else if (obj instanceof SharedResource) {
SharedResource rd = (SharedResource) obj;
@@ -551,8 +549,8 @@
throw new ConfigurationException(ErrorMessageKeys.CONFIG_0002,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_0002));
}
- } else if (obj instanceof ProductType) {
- addProductType((ProductType) obj);
+// } else if (obj instanceof ProductType) {
+// addProductType((ProductType) obj);
} else if (obj instanceof ComponentType) {
@@ -626,8 +624,8 @@
} else if (objID instanceof HostID) {
remove((HostID) objID);
- } else if (objID instanceof ProductServiceConfigID) {
- remove((ProductServiceConfigID) objID);
+// } else if (objID instanceof ProductServiceConfigID) {
+// remove((ProductServiceConfigID) objID);
} else if (objID instanceof SharedResourceID) {
removeSharedResource((SharedResourceID) objID);
@@ -635,8 +633,6 @@
} else if (objID instanceof ResourceDescriptorID) {
remove((ResourceDescriptorID) objID);
- } else if (objID instanceof ProductTypeID) {
- removeProductType((ProductTypeID) objID);
} else if (objID instanceof ComponentTypeID) {
removeComponentType((ComponentTypeID) objID);
@@ -654,18 +650,14 @@
compTypes.remove(typeID.getFullName());
}
- Collection c = getProductTypes();
- for (final Iterator i = c.iterator(); i.hasNext();) {
- final BasicProductType type = (BasicProductType)i.next();
- type.removeServiceTypeID(typeID);
- } // for
+// Collection c = getProductTypes();
+// for (final Iterator i = c.iterator(); i.hasNext();) {
+// final BasicProductType type = (BasicProductType)i.next();
+// type.removeServiceTypeID(typeID);
+// } // for
}
- private void removeProductType(ProductTypeID typeID) {
- if (prodTypes.containsKey(typeID.getFullName())) {
- prodTypes.remove(typeID.getFullName());
- }
- }
+
private void removeSharedResource(SharedResourceID rdID) {
if (resources.containsKey(rdID.getFullName())) {
@@ -719,15 +711,15 @@
ConfigurationObjectEditorHelper.delete(hostID, configuration);
}
- private void remove(ProductServiceConfigID pscID) throws ConfigurationException {
+// private void remove(ProductServiceConfigID pscID) throws ConfigurationException {
+//
+// if (configuration == null) {
+// throw new ConfigurationException(ErrorMessageKeys.CONFIG_0001,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_0001));
+// }
+//
+// ConfigurationObjectEditorHelper.delete(pscID, configuration);
+// }
- if (configuration == null) {
- throw new ConfigurationException(ErrorMessageKeys.CONFIG_0001,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_0001));
- }
-
- ConfigurationObjectEditorHelper.delete(pscID, configuration);
- }
-
private void remove(ResourceDescriptorID rdID) throws ConfigurationException {
if (configuration == null) {
@@ -744,7 +736,7 @@
ConfigurationModelContainerImpl newConfig = new
ConfigurationModelContainerImpl(config);
newConfig.setComponentTypes(this.compTypes);
- newConfig.setProductTypes(this.prodTypes.values());
+// newConfig.setProductTypes(this.prodTypes.values());
newConfig.setResources(this.resources);
return newConfig;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationObjectEditorHelper.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationObjectEditorHelper.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/ConfigurationObjectEditorHelper.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -351,17 +351,17 @@
* @param serviceComponentType ComponentType to be added to the
* ProductType
*/
- public static ProductType addServiceComponentType(ProductType productType,
ComponentType serviceComponentType){
- BasicProductType basicProdType = (BasicProductType)productType;
+// public static ProductType addServiceComponentType(ProductType productType,
ComponentType serviceComponentType){
+// BasicProductType basicProdType = (BasicProductType)productType;
+//
+// ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
+// setParentComponentTypeID(serviceComponentType, productTypeID);
+// //add the service ComponentTypeID to the BasicProductType
+// basicProdType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
+//
+// return basicProdType;
+// }
- ComponentTypeID productTypeID = (ComponentTypeID)basicProdType.getID();
- setParentComponentTypeID(serviceComponentType, productTypeID);
- //add the service ComponentTypeID to the BasicProductType
- basicProdType.addServiceTypeID((ComponentTypeID)serviceComponentType.getID());
-
- return basicProdType;
- }
-
protected static ComponentType setParentComponentTypeID(ComponentType t,
ComponentTypeID parentID) {
BasicComponentType target = (BasicComponentType)
verifyTargetClass(t,BasicComponentType.class);
@@ -386,16 +386,16 @@
* @param serviceComponentType ComponentType to be taken from the
* ProductType
*/
- public static ProductType removeServiceComponentType(ProductType productType,
ComponentType serviceComponentType){
- BasicProductType basicProdType = (BasicProductType)productType;
+// public static ProductType removeServiceComponentType(ProductType productType,
ComponentType serviceComponentType){
+// BasicProductType basicProdType = (BasicProductType)productType;
+//
+// //add the service ComponentTypeID to the BasicProductType
+//
basicProdType.removeServiceTypeID((ComponentTypeID)serviceComponentType.getID());
+//
+// return basicProdType;
+// }
- //add the service ComponentTypeID to the BasicProductType
-
basicProdType.removeServiceTypeID((ComponentTypeID)serviceComponentType.getID());
- return basicProdType;
- }
-
-
// public static void renameHostAndDeployedComponents(ConfigurationModelContainer cmc,
String oldHostName, String newHostName, String newPortNumber) throws
ConfigurationException {
//
// /**
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigUtil.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigUtil.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigUtil.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -84,24 +84,24 @@
}
-public static ProductServiceConfig
getFirstDeployedConnectorProductTypePSC(ConfigurationModelContainer cmc) throws Exception
{
+//public static ProductServiceConfig
getFirstDeployedConnectorProductTypePSC(ConfigurationModelContainer cmc) throws Exception
{
+//
+// ProductTypeID prodType = ProductTypeID.PRODUCT_TYPE_ID;
+// Iterator it = cmc.getConfiguration().getDeployedComponents().iterator();
+// while(it.hasNext()) {
+// final DeployedComponent dc = (DeployedComponent) it.next();
+// if (dc.isDeployedConnector()) {
+// ProductServiceConfigID pscID = dc.getProductServiceConfigID();
+//
+// ProductServiceConfig psc = cmc.getConfiguration().getPSC(pscID);
+// if (psc.getComponentTypeID().equals(prodType)) {
+// return psc;
+// }
+// }
+//
+// }
+// return null;
+//}
- ProductTypeID prodType = new
ProductTypeID(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME);
- Iterator it = cmc.getConfiguration().getDeployedComponents().iterator();
- while(it.hasNext()) {
- final DeployedComponent dc = (DeployedComponent) it.next();
- if (dc.isDeployedConnector()) {
- ProductServiceConfigID pscID = dc.getProductServiceConfigID();
-
- ProductServiceConfig psc = cmc.getConfiguration().getPSC(pscID);
- if (psc.getComponentTypeID().equals(prodType)) {
- return psc;
- }
- }
-
- }
- return null;
-}
-
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_HelperImpl.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_HelperImpl.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_HelperImpl.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -65,6 +65,7 @@
import com.metamatrix.common.config.model.BasicComponentObject;
import com.metamatrix.common.config.model.BasicComponentType;
import com.metamatrix.common.config.model.BasicConfigurationObjectEditor;
+import com.metamatrix.common.config.model.BasicVMComponentDefn;
import com.metamatrix.common.config.util.ConfigurationPropertyNames;
import com.metamatrix.common.config.util.InvalidConfigurationElementException;
import com.metamatrix.common.log.LogConfiguration;
@@ -94,19 +95,20 @@
*/
public class XMLConfig_42_HelperImpl implements XMLHelper, ConfigurationPropertyNames
{
- /**
+
+
+ /**
* @see
com.metamatrix.common.config.xml.XMLHelper#createDeployedComponent(org.jdom.Element,
com.metamatrix.common.config.api.ConfigurationID, com.metamatrix.common.config.api.HostID,
com.metamatrix.common.config.api.VMComponentDefnID,
com.metamatrix.common.config.api.ProductServiceConfigID, java.util.Map,
com.metamatrix.common.config.api.ConfigurationObjectEditor)
* @since 4.1
*/
- public DeployedComponent createDeployedComponent(Element element,
- ConfigurationID configID,
- HostID hostID,
- VMComponentDefnID vmID,
- ProductServiceConfigID pscID,
- Map componentTypeMap,
- ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException {
- return null;
- }
+// public DeployedComponent createDeployedComponent(Element element,
+// ConfigurationID configID,
+// HostID hostID,
+// VMComponentDefnID vmID,
+// Map componentTypeMap,
+// ConfigurationObjectEditor editor)
throws InvalidConfigurationElementException {
+// return null;
+// }
/**
* This method is used to create a Configuration JDOM Element from a
* Configuration object.
@@ -306,19 +308,19 @@
// return serviceComponentDefnElement;
// }
- public Element createDeployedProductServiceConfigElement(ProductServiceConfig config)
{
- Assertion.isNotNull(config);
-
- Element productServiceConfigElement =
createComponentObjectElement(XMLConfig_42_ElementNames.Configuration.ProductServiceConfig.ELEMENT,
config);
-
- return productServiceConfigElement;
- }
+// public Element createDeployedProductServiceConfigElement(ProductServiceConfig
config) {
+// Assertion.isNotNull(config);
+//
+// Element productServiceConfigElement =
createComponentObjectElement(XMLConfig_42_ElementNames.Configuration.ProductServiceConfig.ELEMENT,
config);
+//
+// return productServiceConfigElement;
+// }
+//
+// public Element createProductServiceConfigsElement() {
+// return new Element(XMLConfig_42_ElementNames.ProductServiceConfigs.ELEMENT);
+//
+// }
- public Element createProductServiceConfigsElement() {
- return new Element(XMLConfig_42_ElementNames.ProductServiceConfigs.ELEMENT);
-
- }
-
@@ -329,25 +331,25 @@
* @param config the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductServiceConfigElement(ProductServiceConfig config) {
- Assertion.isNotNull(config);
+// public Element createProductServiceConfigElement(ProductServiceConfig config) {
+// Assertion.isNotNull(config);
+//
+// Element productServiceConfigElement =
createComponentObjectElement(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT,
config);
+//
+// Iterator iterator = config.getServiceComponentDefnIDs().iterator();
+// while (iterator.hasNext()) {
+// ServiceComponentDefnID id = (ServiceComponentDefnID)iterator.next();
+// boolean isEnabled = config.isServiceEnabled(id);
+//
+// Element idElement =
createIDElement(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.ELEMENT,
id.getName());
+//
+// idElement.setAttribute(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED,
(Boolean.valueOf(isEnabled)).toString());
+//
+// productServiceConfigElement.addContent(idElement);
+// }
+// return productServiceConfigElement;
+// }
- Element productServiceConfigElement =
createComponentObjectElement(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT,
config);
-
- Iterator iterator = config.getServiceComponentDefnIDs().iterator();
- while (iterator.hasNext()) {
- ServiceComponentDefnID id = (ServiceComponentDefnID)iterator.next();
- boolean isEnabled = config.isServiceEnabled(id);
-
- Element idElement =
createIDElement(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.ELEMENT,
id.getName());
-
- idElement.setAttribute(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED,
(Boolean.valueOf(isEnabled)).toString());
-
- productServiceConfigElement.addContent(idElement);
- }
- return productServiceConfigElement;
- }
-
/**
* This method is used to create a ComponentType JDOM Element from a
* ComponentType object.
@@ -545,41 +547,41 @@
* @param type the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductTypeElement(ProductType type) {
- Assertion.isNotNull(type);
+// public Element createProductTypeElement(ProductType type) {
+// Assertion.isNotNull(type);
+//
+// Element productTypeElement = new
Element(XMLConfig_42_ElementNames.ProductTypes.ProductType.ELEMENT);
+//
+// Iterator iterator = type.getComponentTypeIDs().iterator();
+// while (iterator.hasNext()) {
+// ComponentTypeID id = (ComponentTypeID)iterator.next();
+// Element componentTypeIDElement =
createIDElement(XMLConfig_42_ElementNames.ComponentTypeID.ELEMENT, id.getName());
+// productTypeElement.addContent(componentTypeIDElement);
+// }
+//
+//
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.NAME,
type.getName());
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.COMPONENT_TYPE_CODE,
new Integer(type.getComponentTypeCode()).toString());
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.DEPLOYABLE,
(Boolean.valueOf(type.isDeployable())).toString());
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.DEPRECATED,
(Boolean.valueOf(type.isDeprecated())).toString());
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.MONITORABLE,
(Boolean.valueOf(type.isMonitored())).toString());
+//
+// // we only add these if they are not null
+// BaseID superID = type.getSuperComponentTypeID();
+// String superIDString;
+// if (superID != null) {
+// superIDString = superID.getName();
+//
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.SUPER_COMPONENT_TYPE,
superIDString);
+//
+// }
+//
+// addChangeHistoryElement(type, productTypeElement);
+//
+//
+// return productTypeElement;
+//
+// }
- Element productTypeElement = new
Element(XMLConfig_42_ElementNames.ProductTypes.ProductType.ELEMENT);
-
- Iterator iterator = type.getComponentTypeIDs().iterator();
- while (iterator.hasNext()) {
- ComponentTypeID id = (ComponentTypeID)iterator.next();
- Element componentTypeIDElement =
createIDElement(XMLConfig_42_ElementNames.ComponentTypeID.ELEMENT, id.getName());
- productTypeElement.addContent(componentTypeIDElement);
- }
-
-
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.NAME,
type.getName());
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.COMPONENT_TYPE_CODE,
new Integer(type.getComponentTypeCode()).toString());
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.DEPLOYABLE,
(Boolean.valueOf(type.isDeployable())).toString());
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.DEPRECATED,
(Boolean.valueOf(type.isDeprecated())).toString());
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.MONITORABLE,
(Boolean.valueOf(type.isMonitored())).toString());
-
- // we only add these if they are not null
- BaseID superID = type.getSuperComponentTypeID();
- String superIDString;
- if (superID != null) {
- superIDString = superID.getName();
-
productTypeElement.setAttribute(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.Attributes.SUPER_COMPONENT_TYPE,
superIDString);
-
- }
-
- addChangeHistoryElement(type, productTypeElement);
-
-
- return productTypeElement;
-
- }
-
/**
* This method is used to create a Host JDOM Element from a
* Host object.
@@ -1093,9 +1095,9 @@
return new Element(XMLConfig_42_ElementNames.ComponentTypes.ELEMENT);
}
- public Element createProductTypesElement() {
- return new Element(XMLConfig_42_ElementNames.ProductTypes.ELEMENT);
- }
+// public Element createProductTypesElement() {
+// return new Element(XMLConfig_42_ElementNames.ProductTypes.ELEMENT);
+// }
public Element createConnectorBindingsElement() {
return new Element(XMLConfig_42_ElementNames.ConnectorComponents.ELEMENT);
@@ -1494,52 +1496,52 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLConfig_42_ElementNames class.
*/
- public ProductType createProductType(Element element, ConfigurationObjectEditor
editor, Map componentTypeMap, String name)throws InvalidConfigurationElementException{
- Assertion.isNotNull(element);
- Assertion.isNotNull(editor);
-
- if
(!element.getName().equals(XMLConfig_42_ElementNames.ProductTypes.ProductType.ELEMENT)) {
- throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0036,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0036, element.getName()),
element);
- }
-
- // retreive the attributes of this ComponentType from the JDOM element
- String deployable =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.DEPLOYABLE);
-// String monitorable =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.MONITORABLE);
-
- // we will use the passed in name unless it is null...
- if (name == null) {
- name =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.NAME);
- }
-
- boolean isDeployable = (Boolean.valueOf(deployable)).booleanValue();
- // boolean isMonitorable = (Boolean.valueOf(monitorable)).booleanValue();
-
- List componentTypeIDs =
element.getChildren(XMLConfig_42_ElementNames.ComponentTypeID.ELEMENT);
- List componentTypes = new ArrayList();
- Iterator iter = componentTypeIDs.iterator();
- while (iter.hasNext()) {
- Element componentTypeIDElement = (Element)iter.next();
- String componentTypeIDName =
componentTypeIDElement.getAttributeValue(XMLConfig_42_ElementNames.ComponentTypeID.Attributes.NAME);
- ComponentTypeID componentTypeID = new ComponentTypeID(componentTypeIDName);
- ComponentType componentType =
(ComponentType)componentTypeMap.get(componentTypeID);
- if (componentType == null) {
- throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0037,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0037, new Object[]
{componentTypeID, name}), element);
- }
- componentTypes.add(componentType);
- }
-
- // create the ComponentTypeObject
- ProductType type = editor.createProductType(name, componentTypes, isDeployable,
false);
-
- return type;
-// // get the ComponentTypeDefn sub-Elements of this ComponentType
-// // and create them also.
-// Collection componentTypeDefnElements =
element.getChildren(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.ComponentTypeDefn.ELEMENT);
+// public ProductType createProductType(Element element, ConfigurationObjectEditor
editor, Map componentTypeMap, String name)throws InvalidConfigurationElementException{
+// Assertion.isNotNull(element);
+// Assertion.isNotNull(editor);
//
-// type = (ProductType) setDateHistory(type, element, editor);
+// if
(!element.getName().equals(XMLConfig_42_ElementNames.ProductTypes.ProductType.ELEMENT)) {
+// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0036,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0036, element.getName()),
element);
+// }
//
-// return (ProductType)addComponentTypeDefns(componentTypeDefnElements, type,
editor);
- }
+// // retreive the attributes of this ComponentType from the JDOM element
+// String deployable =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.DEPLOYABLE);
+//// String monitorable =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.MONITORABLE);
+//
+// // we will use the passed in name unless it is null...
+// if (name == null) {
+// name =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductTypes.ProductType.Attributes.NAME);
+// }
+//
+// boolean isDeployable = (Boolean.valueOf(deployable)).booleanValue();
+// // boolean isMonitorable = (Boolean.valueOf(monitorable)).booleanValue();
+//
+// List componentTypeIDs =
element.getChildren(XMLConfig_42_ElementNames.ComponentTypeID.ELEMENT);
+// List componentTypes = new ArrayList();
+// Iterator iter = componentTypeIDs.iterator();
+// while (iter.hasNext()) {
+// Element componentTypeIDElement = (Element)iter.next();
+// String componentTypeIDName =
componentTypeIDElement.getAttributeValue(XMLConfig_42_ElementNames.ComponentTypeID.Attributes.NAME);
+// ComponentTypeID componentTypeID = new
ComponentTypeID(componentTypeIDName);
+// ComponentType componentType =
(ComponentType)componentTypeMap.get(componentTypeID);
+// if (componentType == null) {
+// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0037,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0037, new Object[]
{componentTypeID, name}), element);
+// }
+// componentTypes.add(componentType);
+// }
+//
+// // create the ComponentTypeObject
+// ProductType type = editor.createProductType(name, componentTypes, isDeployable,
false);
+//
+// return type;
+//// // get the ComponentTypeDefn sub-Elements of this ComponentType
+//// // and create them also.
+//// Collection componentTypeDefnElements =
element.getChildren(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.ComponentTypeDefn.ELEMENT);
+////
+//// type = (ProductType) setDateHistory(type, element, editor);
+////
+//// return (ProductType)addComponentTypeDefns(componentTypeDefnElements, type,
editor);
+// }
/**
* This method will create a Configuration configuration object from an XML element
@@ -1571,17 +1573,10 @@
Configuration config = editor.createConfiguration(name);
-// Element propertiesElement =
element.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
-
config = (Configuration) setDateHistory(config, element, editor);
-// if (propertiesElement != null) {
- // now we add the system properties to the configuration object
- config = (Configuration)addProperties(element, config, editor);
+ config = (Configuration)addProperties(element, config, editor);
-// return config;
-// }
-
return config;
}
@@ -1834,98 +1829,97 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLConfig_42_ElementNames class.
*/
- public ProductServiceConfig createProductServiceConfig(Element element,
ConfigurationID configID, ConfigurationObjectEditor editor, String name)throws
InvalidConfigurationElementException {
- Assertion.isNotNull(element);
- Assertion.isNotNull(editor);
- Assertion.isNotNull(configID);
+// public ProductServiceConfig createProductServiceConfig(Element element,
ConfigurationID configID, ConfigurationObjectEditor editor, String name)throws
InvalidConfigurationElementException {
+// Assertion.isNotNull(element);
+// Assertion.isNotNull(editor);
+// Assertion.isNotNull(configID);
+//
+// if
(!element.getName().equals(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT))
{
+// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0043,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0043,element.getName()),
element);
+// }
+//
+// if (name==null) {
+// name =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Attributes.NAME);
+// }
+//
+// String componentType =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Attributes.COMPONENT_TYPE);
+// checkElementValue(componentType, name, ErrorMessageKeys.CONFIG_ERR_0059);
+//
+//
+// // ConfigurationID configID = (ConfigurationID)config.getID();
+// ProductTypeID id = new ProductTypeID(componentType);
+//
+//
+// // ConfigurationID configID = (ConfigurationID)config.getID();
+//
+// // this new editor is used only as a way to create a product service config
+// // the passed in editor is then used to add the PSC to the configuration
+// // as passed in.
+// // we dont want to add the actions again to the passed in editor.
+// ProductServiceConfig productServiceConfig =
editor.createProductServiceConfig(configID, id, name);
+//
+// Collection serviceComponentDefnIDs =
element.getChildren(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.ELEMENT);
+//
+// if
(id.getFullName().equals(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME)) {
+// Iterator iterator = serviceComponentDefnIDs.iterator();
+// while (iterator.hasNext()) {
+// Element serviceComponentDefnIDElement = (Element)iterator.next();
+// String serviceComponentDefnName =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ID.Attributes.NAME);
+//
+// String enabled =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED);
+//
+// if (enabled == null) {
+// enabled = Boolean.TRUE.toString();
+// }
+//
+// ConnectorBindingID serviceComponentDefnID = new
ConnectorBindingID(configID, serviceComponentDefnName);
+// productServiceConfig =
editor.addServiceComponentDefn(productServiceConfig, serviceComponentDefnID);
+// editor.setEnabled(serviceComponentDefnID, productServiceConfig,
Boolean.valueOf(enabled).booleanValue());
+//
+// }
+//
+//
+// } else {
+//
+// Iterator iterator = serviceComponentDefnIDs.iterator();
+// while (iterator.hasNext()) {
+// Element serviceComponentDefnIDElement = (Element)iterator.next();
+// String serviceComponentDefnName =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ID.Attributes.NAME);
+//
+// String enabled =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED);
+//
+// if (enabled == null) {
+// enabled = Boolean.TRUE.toString();
+// }
+//
+// ServiceComponentDefnID serviceComponentDefnID = new
ServiceComponentDefnID(configID, serviceComponentDefnName);
+// productServiceConfig =
editor.addServiceComponentDefn(productServiceConfig, serviceComponentDefnID);
+//
+// editor.setEnabled(serviceComponentDefnID, productServiceConfig,
Boolean.valueOf(enabled).booleanValue());
+//
+// }
+//
+// }
+//
+// productServiceConfig = (ProductServiceConfig)
setDateHistory(productServiceConfig, element, editor);
+//
+// // add the properties to this ComponentObject...
+// Element propertiesElement =
element.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
+// if (propertiesElement != null) {
+// // now we add the system properties to the configuration object
+// productServiceConfig =
(ProductServiceConfig)addProperties(propertiesElement, productServiceConfig, editor);
+// return productServiceConfig;
+// }
+//
+// return productServiceConfig;
+// }
- if
(!element.getName().equals(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT))
{
- throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0043,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0043,element.getName()),
element);
- }
- if (name==null) {
- name =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Attributes.NAME);
- }
- String componentType =
element.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Attributes.COMPONENT_TYPE);
- checkElementValue(componentType, name, ErrorMessageKeys.CONFIG_ERR_0059);
-
-
- // ConfigurationID configID = (ConfigurationID)config.getID();
- ProductTypeID id = new ProductTypeID(componentType);
-
-
- // ConfigurationID configID = (ConfigurationID)config.getID();
-
- // this new editor is used only as a way to create a product service config
- // the passed in editor is then used to add the PSC to the configuration
- // as passed in.
- // we dont want to add the actions again to the passed in editor.
- ProductServiceConfig productServiceConfig =
editor.createProductServiceConfig(configID, id, name);
-
- Collection serviceComponentDefnIDs =
element.getChildren(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.ELEMENT);
-
- if
(id.getFullName().equals(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME)) {
- Iterator iterator = serviceComponentDefnIDs.iterator();
- while (iterator.hasNext()) {
- Element serviceComponentDefnIDElement = (Element)iterator.next();
- String serviceComponentDefnName =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ID.Attributes.NAME);
-
- String enabled =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED);
-
- if (enabled == null) {
- enabled = Boolean.TRUE.toString();
- }
-
- ConnectorBindingID serviceComponentDefnID = new ConnectorBindingID(configID,
serviceComponentDefnName);
- productServiceConfig = editor.addServiceComponentDefn(productServiceConfig,
serviceComponentDefnID);
- editor.setEnabled(serviceComponentDefnID, productServiceConfig,
Boolean.valueOf(enabled).booleanValue());
-
- }
-
-
- } else {
-
- Iterator iterator = serviceComponentDefnIDs.iterator();
- while (iterator.hasNext()) {
- Element serviceComponentDefnIDElement = (Element)iterator.next();
- String serviceComponentDefnName =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ID.Attributes.NAME);
-
- String enabled =
serviceComponentDefnIDElement.getAttributeValue(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.Service.Attributes.IS_ENABLED);
-
- if (enabled == null) {
- enabled = Boolean.TRUE.toString();
- }
-
- ServiceComponentDefnID serviceComponentDefnID = new
ServiceComponentDefnID(configID, serviceComponentDefnName);
- productServiceConfig = editor.addServiceComponentDefn(productServiceConfig,
serviceComponentDefnID);
-
- editor.setEnabled(serviceComponentDefnID, productServiceConfig,
Boolean.valueOf(enabled).booleanValue());
-
- }
-
- }
-
- productServiceConfig = (ProductServiceConfig)
setDateHistory(productServiceConfig, element, editor);
-
- // add the properties to this ComponentObject...
- Element propertiesElement =
element.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
- if (propertiesElement != null) {
- // now we add the system properties to the configuration object
- productServiceConfig = (ProductServiceConfig)addProperties(propertiesElement,
productServiceConfig, editor);
- return productServiceConfig;
- }
-
- return productServiceConfig;
- }
-
-
-
public DeployedComponent createDeployedServiceComponent(Element element,
ConfigurationID configID,
HostID hostID,
VMComponentDefnID vmID,
- ProductServiceConfigID pscID,
Map componentTypeMap,
ConfigurationObjectEditor editor)
throws
InvalidConfigurationElementException{
@@ -1977,7 +1971,7 @@
}
- component = editor.createDeployedServiceComponent(name, configID, hostID,vmID,
svcid, pscID, (ComponentTypeID) type.getID());
+ component = editor.createDeployedServiceComponent(name, configID, hostID,vmID,
svcid, (ComponentTypeID) type.getID());
component = (DeployedComponent) setDateHistory(component, element, editor);
@@ -1987,56 +1981,56 @@
}
- public DeployedComponent createDeployedVMComponentDefnx(Element element,
- ConfigurationID configID,
- HostID hostID,
- // VMComponentDefnID vmID,
- // ProductServiceConfigID
pscID,
- ComponentTypeID typeID,
- ConfigurationObjectEditor
editor)
- throws
InvalidConfigurationElementException{
- Assertion.isNotNull(element);
- Assertion.isNotNull(editor);
- Assertion.isNotNull(configID);
- Assertion.isNotNull(hostID);
- // Assertion.isNotNull(vmID);
-
- DeployedComponent component=null;
-
- if
(!element.getName().equals(XMLConfig_42_ElementNames.Configuration.Process.ELEMENT)) {
- throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()),
element);
- }
-
- String name =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.Process.Attributes.NAME);
-// checkElementValue(name, "NAME",
ErrorMessageKeys.CONFIG_ERR_0048);
-
- String componentTypeIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.Process.Attributes.COMPONENT_TYPE);
-
- checkElementValue(componentTypeIDString, name,
ErrorMessageKeys.CONFIG_ERR_0049);
-
-
-// ComponentType type = null;
-// Iterator it = componentTypeMap.keySet().iterator();
-// while (it.hasNext() ) {
-// ComponentTypeID id = (ComponentTypeID) it.next();
-// if (id.getFullName().equals(componentTypeIDString)) {
-// type = (ComponentType) componentTypeMap.get(id);
-// break;
-// }
+// public DeployedComponent createDeployedVMComponentDefnx(Element element,
+// ConfigurationID configID,
+// HostID hostID,
+// // VMComponentDefnID vmID,
+// // ProductServiceConfigID
pscID,
+// ComponentTypeID typeID,
+// ConfigurationObjectEditor
editor)
+// throws
InvalidConfigurationElementException{
+// Assertion.isNotNull(element);
+// Assertion.isNotNull(editor);
+// Assertion.isNotNull(configID);
+// Assertion.isNotNull(hostID);
+// // Assertion.isNotNull(vmID);
+//
+// DeployedComponent component=null;
+//
+// if
(!element.getName().equals(XMLConfig_42_ElementNames.Configuration.Process.ELEMENT)) {
+// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()),
element);
// }
+//
+// String name =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.Process.Attributes.NAME);
+//// checkElementValue(name, "NAME",
ErrorMessageKeys.CONFIG_ERR_0048);
+//
+// String componentTypeIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.Process.Attributes.COMPONENT_TYPE);
+//
+// checkElementValue(componentTypeIDString, name,
ErrorMessageKeys.CONFIG_ERR_0049);
+//
+//
+//// ComponentType type = null;
+//// Iterator it = componentTypeMap.keySet().iterator();
+//// while (it.hasNext() ) {
+//// ComponentTypeID id = (ComponentTypeID) it.next();
+//// if (id.getFullName().equals(componentTypeIDString)) {
+//// type = (ComponentType) componentTypeMap.get(id);
+//// break;
+//// }
+//// }
+//
+//// if (type == null) {
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[]
{componentTypeIDString, name} ), element);
+//// }
+//
+// // VMComponentDefnID vmID = new VMComponentDefnID(configID, hostID,
name);
+/////// component = editor.createDeployedVMComponent(name, configID,
hostID, vmID, typeID);
+// // createDeployedServiceComponent(name, configID, hostID,vmID, svcid,
pscID, (ComponentTypeID) type.getID());
+//
+//
+// return component;
+// }
-// if (type == null) {
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[]
{componentTypeIDString, name} ), element);
-// }
-
- // VMComponentDefnID vmID = new VMComponentDefnID(configID, hostID, name);
-///// component = editor.createDeployedVMComponent(name, configID, hostID,
vmID, typeID);
- // createDeployedServiceComponent(name, configID, hostID,vmID, svcid,
pscID, (ComponentTypeID) type.getID());
-
-
- return component;
- }
-
/**
@@ -2064,109 +2058,109 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLConfig_42_ElementNames class.
*/
- public DeployedComponent createDeployedComponent(Element element,
- Configuration config, ConfigurationObjectEditor editor,
- Map serviceComponentDefnMap, Map vmComponentDefnMap, Map componentTypeMap,
String name)
- throws InvalidConfigurationElementException{
- throw new UnsupportedOperationException("Method createDeployedComponent is
unsupported in 4.2"); //$NON-NLS-1$
-
-//
-// Assertion.isNotNull(element);
-// Assertion.isNotNull(editor);
-// Assertion.isNotNull(config);
+// public DeployedComponent createDeployedComponent(Element element,
+// Configuration config, ConfigurationObjectEditor editor,
+// Map serviceComponentDefnMap, Map vmComponentDefnMap, Map componentTypeMap,
String name)
+// throws InvalidConfigurationElementException{
+// throw new UnsupportedOperationException("Method createDeployedComponent is
unsupported in 4.2"); //$NON-NLS-1$
//
-// DeployedComponent component;
-//
-// if
(!element.getName().equals(XMLConfig_42_ElementNames.Configuration.DeployedComponent.ELEMENT))
{
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()),
element);
-// }
-//
-// if (name == null) {
-// name =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.NAME);
-// }
-//
-// String productServiceConfigIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.PRODUCT_SERVICE_CONFIG_ID);
-// String vmComponentDefnIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.VM_COMPONENT_DEFN_ID);
-// String serviceComponentDefnIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.SERVICE_COMPONENT_DEFN_ID);
-// String HostIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.HOST_ID);
-//
-// checkElementValue(vmComponentDefnIDString, name,
ErrorMessageKeys.CONFIG_ERR_0045);
-// checkElementValue(HostIDString, name, ErrorMessageKeys.CONFIG_ERR_0046);
-//
-// ConfigurationID configID = (ConfigurationID)config.getID();
-//
-// HostID hostID = new HostID(HostIDString);
-// VMComponentDefnID vmComponentDefnID = new VMComponentDefnID(configID,
vmComponentDefnIDString);
-//
-// // this will check to see if this is actually a DeployedVMServiceComponent
-// // these special deployed components dont have values for these ID's
-// String componentTypeIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.COMPONENT_TYPE);
-//
-// if (serviceComponentDefnIDString == null &&
productServiceConfigIDString == null) {
-// VMComponentDefn defn =
(VMComponentDefn)vmComponentDefnMap.get(vmComponentDefnID);
-// if (defn==null) {
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0047,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0047, new Object[] {name,
vmComponentDefnID} ), element);
-//
-// }
-// component = editor.createDeployedVMComponent(name, config, hostID, defn);
-//
-// // else this element represents a normal ServiceComponentDefn object
-// }else {
-// checkElementValue(productServiceConfigIDString, name,
ErrorMessageKeys.CONFIG_ERR_0048);
-// checkElementValue(serviceComponentDefnIDString, name,
ErrorMessageKeys.CONFIG_ERR_0049);
-//
-// ComponentType type = null;
-// Iterator it = componentTypeMap.keySet().iterator();
-// while (it.hasNext() ) {
-// ComponentTypeID id = (ComponentTypeID) it.next();
-// if (id.getFullName().equals(componentTypeIDString)) {
-// type = (ComponentType) componentTypeMap.get(id);
-// break;
-// }
-// }
-//
-// if (type == null) {
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[]
{componentTypeIDString, serviceComponentDefnIDString} ), element);
-// }
-// ProductServiceConfigID productServiceConfigID = null;
-// if (type instanceof ConnectorBindingType) {
-//
-// productServiceConfigID = new ProductServiceConfigID(configID,
productServiceConfigIDString);
-//
-// ConnectorBindingID bindingID = new ConnectorBindingID(configID,
serviceComponentDefnIDString);
-// ConnectorBinding bdefn =
(ConnectorBinding)serviceComponentDefnMap.get(bindingID);
-//
-// if (bdefn==null) {
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0051,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0051, new Object[] {name,
serviceComponentDefnIDString} ), element);
-// }
-// component = editor.createDeployedServiceComponent(name, config, hostID,
vmComponentDefnID, bdefn, productServiceConfigID);
-//
-// } else {
-//
-// productServiceConfigID = new ProductServiceConfigID(configID,
productServiceConfigIDString);
-//
-// ServiceComponentDefnID serviceComponentDefnID = new
ServiceComponentDefnID(configID, serviceComponentDefnIDString);
-// ServiceComponentDefn defn =
(ServiceComponentDefn)serviceComponentDefnMap.get(serviceComponentDefnID);
-//
-// if (defn==null) {
-// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0052,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0052, new Object[] {name,
serviceComponentDefnIDString} ), element);
-// }
-// component = editor.createDeployedServiceComponent(name, config, hostID,
vmComponentDefnID, defn, productServiceConfigID);
-//
-// }
-//
-// }
-//
-// component = (DeployedComponent) setDateHistory(component, element, editor);
-//
-// Element propertiesElement =
element.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
-// if (propertiesElement != null) {
-// // now we add the system properties to the configuration object
-// return (DeployedComponent)addProperties(propertiesElement, component,
editor);
-// }
-//
-// return component;
- }
+////
+//// Assertion.isNotNull(element);
+//// Assertion.isNotNull(editor);
+//// Assertion.isNotNull(config);
+////
+//// DeployedComponent component;
+////
+//// if
(!element.getName().equals(XMLConfig_42_ElementNames.Configuration.DeployedComponent.ELEMENT))
{
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0044,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0044,element.getName()),
element);
+//// }
+////
+//// if (name == null) {
+//// name =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.NAME);
+//// }
+////
+//// String productServiceConfigIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.PRODUCT_SERVICE_CONFIG_ID);
+//// String vmComponentDefnIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.VM_COMPONENT_DEFN_ID);
+//// String serviceComponentDefnIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.SERVICE_COMPONENT_DEFN_ID);
+//// String HostIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.HOST_ID);
+////
+//// checkElementValue(vmComponentDefnIDString, name,
ErrorMessageKeys.CONFIG_ERR_0045);
+//// checkElementValue(HostIDString, name, ErrorMessageKeys.CONFIG_ERR_0046);
+////
+//// ConfigurationID configID = (ConfigurationID)config.getID();
+////
+//// HostID hostID = new HostID(HostIDString);
+//// VMComponentDefnID vmComponentDefnID = new VMComponentDefnID(configID,
vmComponentDefnIDString);
+////
+//// // this will check to see if this is actually a DeployedVMServiceComponent
+//// // these special deployed components dont have values for these ID's
+//// String componentTypeIDString =
element.getAttributeValue(XMLConfig_42_ElementNames.Configuration.DeployedComponent.Attributes.COMPONENT_TYPE);
+////
+//// if (serviceComponentDefnIDString == null &&
productServiceConfigIDString == null) {
+//// VMComponentDefn defn =
(VMComponentDefn)vmComponentDefnMap.get(vmComponentDefnID);
+//// if (defn==null) {
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0047,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0047, new Object[] {name,
vmComponentDefnID} ), element);
+////
+//// }
+//// component = editor.createDeployedVMComponent(name, config, hostID,
defn);
+////
+//// // else this element represents a normal ServiceComponentDefn object
+//// }else {
+//// checkElementValue(productServiceConfigIDString, name,
ErrorMessageKeys.CONFIG_ERR_0048);
+//// checkElementValue(serviceComponentDefnIDString, name,
ErrorMessageKeys.CONFIG_ERR_0049);
+////
+//// ComponentType type = null;
+//// Iterator it = componentTypeMap.keySet().iterator();
+//// while (it.hasNext() ) {
+//// ComponentTypeID id = (ComponentTypeID) it.next();
+//// if (id.getFullName().equals(componentTypeIDString)) {
+//// type = (ComponentType) componentTypeMap.get(id);
+//// break;
+//// }
+//// }
+////
+//// if (type == null) {
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0050,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0050, new Object[]
{componentTypeIDString, serviceComponentDefnIDString} ), element);
+//// }
+//// ProductServiceConfigID productServiceConfigID = null;
+//// if (type instanceof ConnectorBindingType) {
+////
+//// productServiceConfigID = new ProductServiceConfigID(configID,
productServiceConfigIDString);
+////
+//// ConnectorBindingID bindingID = new ConnectorBindingID(configID,
serviceComponentDefnIDString);
+//// ConnectorBinding bdefn =
(ConnectorBinding)serviceComponentDefnMap.get(bindingID);
+////
+//// if (bdefn==null) {
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0051,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0051, new Object[] {name,
serviceComponentDefnIDString} ), element);
+//// }
+//// component = editor.createDeployedServiceComponent(name, config, hostID,
vmComponentDefnID, bdefn, productServiceConfigID);
+////
+//// } else {
+////
+//// productServiceConfigID = new ProductServiceConfigID(configID,
productServiceConfigIDString);
+////
+//// ServiceComponentDefnID serviceComponentDefnID = new
ServiceComponentDefnID(configID, serviceComponentDefnIDString);
+//// ServiceComponentDefn defn =
(ServiceComponentDefn)serviceComponentDefnMap.get(serviceComponentDefnID);
+////
+//// if (defn==null) {
+//// throw new
InvalidConfigurationElementException(ErrorMessageKeys.CONFIG_ERR_0052,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0052, new Object[] {name,
serviceComponentDefnIDString} ), element);
+//// }
+//// component = editor.createDeployedServiceComponent(name, config, hostID,
vmComponentDefnID, defn, productServiceConfigID);
+////
+//// }
+////
+//// }
+////
+//// component = (DeployedComponent) setDateHistory(component, element, editor);
+////
+//// Element propertiesElement =
element.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
+//// if (propertiesElement != null) {
+//// // now we add the system properties to the configuration object
+//// return (DeployedComponent)addProperties(propertiesElement, component,
editor);
+//// }
+////
+//// return component;
+// }
/**
* This method will create a VMComponentDefn configuration object from an XML element
@@ -2183,7 +2177,7 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLConfig_42_ElementNames class.
*/
- public VMComponentDefn createVMComponentDefn(Element element, ConfigurationID
configID, HostID hostID, ConfigurationObjectEditor editor, String name) throws
InvalidConfigurationElementException{
+ public BasicVMComponentDefn createVMComponentDefn(Element element, ConfigurationID
configID, HostID hostID, ConfigurationObjectEditor editor, String name) throws
InvalidConfigurationElementException{
Assertion.isNotNull(element);
Assertion.isNotNull(editor);
Assertion.isNotNull(configID);
@@ -2213,7 +2207,7 @@
defn = (VMComponentDefn)addProperties(element, defn, editor);
// }
- return defn;
+ return (BasicVMComponentDefn) defn;
}
/**
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_ImportExportUtility.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_ImportExportUtility.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_ImportExportUtility.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -48,9 +48,9 @@
import com.metamatrix.common.config.api.DeployedComponent;
import com.metamatrix.common.config.api.Host;
import com.metamatrix.common.config.api.HostID;
-import com.metamatrix.common.config.api.ProductServiceConfig;
-import com.metamatrix.common.config.api.ProductServiceConfigID;
-import com.metamatrix.common.config.api.ProductType;
+//import com.metamatrix.common.config.api.ProductServiceConfig;
+//import com.metamatrix.common.config.api.ProductServiceConfigID;
+//import com.metamatrix.common.config.api.ProductType;
import com.metamatrix.common.config.api.ResourceDescriptor;
import com.metamatrix.common.config.api.ServiceComponentDefn;
import com.metamatrix.common.config.api.SharedResource;
@@ -197,53 +197,68 @@
hostElement.addContent(vmElement);
Map pscSvcMap = new HashMap(10);
- Iterator depIt =
cmc.getConfiguration().getDeployedServicesForVM(vm).iterator();
- Collection svcs = null;
+ Collection depsvcs =
cmc.getConfiguration().getDeployedServicesForVM(vm);
+ Iterator svcIt = depsvcs.iterator();
+ while(svcIt.hasNext()) {
+ DeployedComponent dc = (DeployedComponent) svcIt.next();
+// ComponentDefn defn = null;
+// if (dc.isDeployedService()) {
+// defn =
cmc.getConfiguration().getServiceComponentDefn(dc.getServiceComponentDefnID());
+// } else {
+// defn =
cmc.getConfiguration().getConnectorBinding(dc.getServiceComponentDefnID());
+//
+// }
+// if (defn == null) {
+// throw new ConfigObjectsNotResolvableException(
"DeployedComponent " + dc.getID() + " could not find service " +
dc.getServiceComponentDefnID(), dc); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+ final Element svcElement = visitor.visitComponent(dc);
+ vmElement.addContent(svcElement);
+ }
// group the deployed services by pc for adding to the vm element
- while(depIt.hasNext()) {
-
- DeployedComponent dc = (DeployedComponent) depIt.next();
- if (!pscSvcMap.containsKey(dc.getProductServiceConfigID())) {
- svcs = new ArrayList();
- pscSvcMap.put(dc.getProductServiceConfigID(),svcs);
- } else {
- svcs = (Collection)
pscSvcMap.get(dc.getProductServiceConfigID());
- }
-
- svcs.add(dc);
- }
+// while(depIt.hasNext()) {
+//
+// DeployedComponent dc = (DeployedComponent) depIt.next();
+// if (!pscSvcMap.containsKey(dc.getProductServiceConfigID())) {
+// svcs = new ArrayList();
+// pscSvcMap.put(dc.getProductServiceConfigID(),svcs);
+// } else {
+// svcs = (Collection)
pscSvcMap.get(dc.getProductServiceConfigID());
+// }
+//
+// svcs.add(dc);
+// }
- Iterator pscIt = pscSvcMap.keySet().iterator();
- while(pscIt.hasNext()) {
- ProductServiceConfigID pscID = (ProductServiceConfigID)
pscIt.next();
- ProductServiceConfig psc =
cmc.getConfiguration().getPSC(pscID);
-
- final Element pscElement =
getXMLHelper().createDeployedProductServiceConfigElement(psc);
- vmElement.addContent(pscElement);
-
- Collection depsvcs = (Collection) pscSvcMap.get(pscID);
-
- Iterator svcIt = depsvcs.iterator();
- while(svcIt.hasNext()) {
- DeployedComponent dc = (DeployedComponent) svcIt.next();
-// ComponentDefn defn = null;
-// if (dc.isDeployedService()) {
-// defn =
cmc.getConfiguration().getServiceComponentDefn(dc.getServiceComponentDefnID());
-// } else {
-// defn =
cmc.getConfiguration().getConnectorBinding(dc.getServiceComponentDefnID());
-//
-// }
-// if (defn == null) {
-// throw new ConfigObjectsNotResolvableException(
"DeployedComponent " + dc.getID() + " could not find service " +
dc.getServiceComponentDefnID(), dc); //$NON-NLS-1$ //$NON-NLS-2$
-// }
- final Element svcElement = visitor.visitComponent(dc);
- pscElement.addContent(svcElement);
-
-
- } // end of svcs
-
- } // end of pscs
+// Iterator pscIt = pscSvcMap.keySet().iterator();
+// while(pscIt.hasNext()) {
+// ProductServiceConfigID pscID = (ProductServiceConfigID)
pscIt.next();
+// ProductServiceConfig psc =
cmc.getConfiguration().getPSC(pscID);
+//
+// final Element pscElement =
getXMLHelper().createDeployedProductServiceConfigElement(psc);
+// vmElement.addContent(pscElement);
+//
+// Collection depsvcs = (Collection) pscSvcMap.get(pscID);
+//
+// Iterator svcIt = depsvcs.iterator();
+// while(svcIt.hasNext()) {
+// DeployedComponent dc = (DeployedComponent) svcIt.next();
+//// ComponentDefn defn = null;
+//// if (dc.isDeployedService()) {
+//// defn =
cmc.getConfiguration().getServiceComponentDefn(dc.getServiceComponentDefnID());
+//// } else {
+//// defn =
cmc.getConfiguration().getConnectorBinding(dc.getServiceComponentDefnID());
+////
+//// }
+//// if (defn == null) {
+//// throw new ConfigObjectsNotResolvableException(
"DeployedComponent " + dc.getID() + " could not find service " +
dc.getServiceComponentDefnID(), dc); //$NON-NLS-1$ //$NON-NLS-2$
+//// }
+// final Element svcElement = visitor.visitComponent(dc);
+// pscElement.addContent(svcElement);
+//
+//
+// } // end of svcs
+//
+// } // end of pscs
// Iterator
svcIt=cmc.getConfiguration().getDeployedServicesForVM(vmDC.getVMComponentDefnID()).iterator();
// while(svcIt.hasNext()) {
@@ -269,36 +284,36 @@
// iterate through the psc objects, if there are any,
// and create elements for them.
- Element pscsElement = xmlHelper.createProductServiceConfigsElement();
- root.addContent(pscsElement);
-
- Collection pscs = cmc.getConfiguration().getPSCs();
- if (pscs != null && pscs.size() > 0) {
- Iterator iterator = pscs.iterator();
- while (iterator.hasNext()) {
- ProductServiceConfig type = (ProductServiceConfig)iterator.next();
-// LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ProductType named: " + type + " in list of configuration objects to
export.");
- Element productTypeElement = visitor.visitComponent(type);
- pscsElement.addContent(productTypeElement);
- }
- }
+// Element pscsElement = xmlHelper.createProductServiceConfigsElement();
+// root.addContent(pscsElement);
+//
+// Collection pscs = cmc.getConfiguration().getPSCs();
+// if (pscs != null && pscs.size() > 0) {
+// Iterator iterator = pscs.iterator();
+// while (iterator.hasNext()) {
+// ProductServiceConfig type = (ProductServiceConfig)iterator.next();
+//// LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ProductType named: " + type + " in list of configuration objects to
export.");
+// Element productTypeElement = visitor.visitComponent(type);
+// pscsElement.addContent(productTypeElement);
+// }
+// }
// iterate through the product type objects, if there are any,
// and create elements for them.
- Element productTypesElement = xmlHelper.createProductTypesElement();
- root.addContent(productTypesElement);
-
- Collection productTypes = cmc.getProductTypes();
- if (productTypes != null && productTypes.size() > 0) {
- Iterator iterator = productTypes.iterator();
- while (iterator.hasNext()) {
- ProductType type = (ProductType)iterator.next();
-// LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ProductType named: " + type + " in list of configuration objects to
export.");
- Element productTypeElement = visitor.visitComponent(type);
- productTypesElement.addContent(productTypeElement);
- }
- }
+// Element productTypesElement = xmlHelper.createProductTypesElement();
+// root.addContent(productTypesElement);
+//
+// Collection productTypes = cmc.getProductTypes();
+// if (productTypes != null && productTypes.size() > 0) {
+// Iterator iterator = productTypes.iterator();
+// while (iterator.hasNext()) {
+// ProductType type = (ProductType)iterator.next();
+//// LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ProductType named: " + type + " in list of configuration objects to
export.");
+// Element productTypeElement = visitor.visitComponent(type);
+// productTypesElement.addContent(productTypeElement);
+// }
+// }
Element resourcePoolsElement = xmlHelper.createResourcePoolsElement();
root.addContent(resourcePoolsElement);
@@ -455,15 +470,8 @@
throw new
ConfigObjectsNotResolvableException(ErrorMessageKeys.CONFIG_ERR_0004,
CommonPlugin.Util.getString(ErrorMessageKeys.CONFIG_ERR_0004));
}
- // add the system properties to the Configuration object
-// Element systemPropertiesElement =
-//
configurationElement.getChild(XMLConfig_42_ElementNames.Properties.ELEMENT);
-// if (systemPropertiesElement!=null) {
-// Collection propertyElements =
-//
systemPropertiesElement.getChildren(XMLConfig_42_ElementNames.Properties.Property.ELEMENT);
-// }
+
-
// NOTE the ordering of the following iterations is very important
// as the actions to create the configuration objects are being created
// within the ConfigurationObjectEditor. If these are created out of
@@ -491,53 +499,8 @@
}
}
- // Element componentTypesElement =
root.getChild(XMLConfig_42_ElementNames.ComponentTypes.ELEMENT);
-//
-// if (componentTypesElement != null) {
-// List componentTypes =
componentTypesElement.getChildren(XMLConfig_42_ElementNames.ComponentTypes.ComponentType.ELEMENT);
-//
-//
-// if (componentTypes != null && componentTypes.size() > 0) {
-//
-// // we must do this to make sure that the componentTypes are created
in
-// // the correct order.
-// xmlHelper.orderComponentTypeElementList(componentTypes);
-// Iterator iterator = componentTypes.iterator();
-// while (iterator.hasNext()) {
-// Element componentTypeElement = (Element)iterator.next();
-// ComponentType type =
-// xmlHelper.createComponentType(componentTypeElement, editor,
null, true);
-// // LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ComponentType named: " + type + " in XML file ComponentTypes element.");
-// configurationObjects.add(type);
-// componentTypeMap.put(type.getID(), type);
-// }
-// }
-// }
- Element productTypesElement =
root.getChild(XMLConfig_42_ElementNames.ProductTypes.ELEMENT);
-
- if (productTypesElement != null) {
-
- List productTypes =
productTypesElement.getChildren(XMLConfig_42_ElementNames.ProductTypes.ProductType.ELEMENT);
- if (productTypes != null && productTypes.size() > 0) {
- // Make a copy of the lists that we intend to change so that we
don't affect JDOM's list (which changes the underlying structure)
- productTypes = new ArrayList(productTypes);
- // we must do this to make sure that the productTypes are created in
- // the correct order.
- xmlHelper.orderComponentTypeElementList(productTypes);
- Iterator iterator = productTypes.iterator();
- while (iterator.hasNext()) {
- Element productTypeElement = (Element)iterator.next();
- ProductType type = xmlHelper.createProductType(productTypeElement,
editor, componentTypeMap, null);
- // LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ProductType named: " + type + " in XML file ProductTypes element.");
- configurationObjects.add(type);
- }
- }
- }
-
-
-
Element resourcesElement =
root.getChild(XMLConfig_42_ElementNames.Resources.ELEMENT);
List resources = null;
@@ -555,23 +518,23 @@
configurationObjects.add(resource);
}
- Map pscMap = new HashMap(1);
- Element productServiceConfigsElement =
- root.getChild(XMLConfig_42_ElementNames.ProductServiceConfigs.ELEMENT);
- if (productServiceConfigsElement!=null) {
- Collection productServiceConfigElements =
-
productServiceConfigsElement.getChildren(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT);
- pscMap = new HashMap(productServiceConfigElements.size());
- iterator = productServiceConfigElements.iterator();
- while (iterator.hasNext()) {
- Element productServiceConfigElement = (Element)iterator.next();
- ProductServiceConfig productServiceConfig =
- xmlHelper.createProductServiceConfig(productServiceConfigElement,
configID, editor, null);
- configurationObjects.add(productServiceConfig);
- pscMap.put(productServiceConfig.getName(), productServiceConfig);
-
- }
- }
+// Map pscMap = new HashMap(1);
+// Element productServiceConfigsElement =
+// root.getChild(XMLConfig_42_ElementNames.ProductServiceConfigs.ELEMENT);
+// if (productServiceConfigsElement!=null) {
+// Collection productServiceConfigElements =
+//
productServiceConfigsElement.getChildren(XMLConfig_42_ElementNames.ProductServiceConfigs.ProductServiceConfig.ELEMENT);
+// pscMap = new HashMap(productServiceConfigElements.size());
+// iterator = productServiceConfigElements.iterator();
+// while (iterator.hasNext()) {
+// Element productServiceConfigElement = (Element)iterator.next();
+// ProductServiceConfig productServiceConfig =
+// xmlHelper.createProductServiceConfig(productServiceConfigElement,
configID, editor, null);
+// configurationObjects.add(productServiceConfig);
+// pscMap.put(productServiceConfig.getName(), productServiceConfig);
+//
+// }
+// }
// else {
//
@@ -637,38 +600,15 @@
Element serviceComponentDefnElement = (Element)iterator.next();
ComponentDefn defn =
xmlHelper.createServiceComponentDefn(serviceComponentDefnElement,
config, editor, null);
-// LogManager.logTrace(LogCommonConstants.CTX_CONFIG, "Found
ServiceComponentDefn named: " + defn + " in XML file ServiceComponentDefns
element.");
- // don't include the ResourceDescriptors
-// if (defn instanceof ServiceComponentDefn) {
- serviceComponentDefnMap.put(defn.getID(), defn);
- // }
- configurationObjects.add(defn);
+ serviceComponentDefnMap.put(defn.getID(), defn);
+ configurationObjects.add(defn);
}
}
-
-
-
-
-// if (resources.isEmpty()) {
-// Assertion.assertTrue(false, "No Resources to import");
//$NON-NLS-1$
-// }
-// if (hosts.isEmpty()) {
-// Assertion.assertTrue(false, "No Hosts to import");
//$NON-NLS-1$
-// }
-// if (componentTypes.isEmpty()) {
-// Assertion.assertTrue(false, "No ComponentTypes to import");
//$NON-NLS-1$
-// }
-
// add the bindings to the map that is used by deployment
configurationObjects.addAll(bindings);
-
-
-
-
-
-
+
// retreive the host elements from the document.
List hostElements =
configurationElement.getChildren(XMLConfig_42_ElementNames.Configuration.Host.ELEMENT);
Iterator hostiterator = hostElements.iterator();
@@ -693,41 +633,20 @@
VMComponentDefnID vmID = (VMComponentDefnID) vm.getID();
configurationObjects.add(vm);
-// configurationObjects.add(vmdc);
-
- List pscElements =
vmElement.getChildren(XMLConfig_42_ElementNames.Configuration.ProductServiceConfig.ELEMENT);
- Iterator pscIt = pscElements.iterator();
- while (pscIt.hasNext()) {
- Element pscElement = (Element)pscIt.next();
- // create this only for use to create the deployed service
- String pscName =
pscElement.getAttributeValue(XMLConfig_42_ElementNames.Configuration.ProductServiceConfig.Attributes.NAME);
-
- ProductServiceConfig psc = (ProductServiceConfig)
pscMap.get(pscName);
- // ProductServiceConfigID pscID = new
ProductServiceConfigID(pscName);
-
-
- // ProductServiceConfig psc =
xmlHelper.createProductServiceConfig(pscElement, configID, editor, null);
-
- List svcElements =
pscElement.getChildren(XMLConfig_42_ElementNames.Configuration.DeployedService.ELEMENT);
+ List svcElements =
vmElement.getChildren(XMLConfig_42_ElementNames.Configuration.DeployedService.ELEMENT);
+
Iterator svcIt = svcElements.iterator();
while (svcIt.hasNext()) {
Element svcElement = (Element)svcIt.next();
// create this only for use to create the deployed service
- DeployedComponent dc =
xmlHelper.createDeployedServiceComponent(svcElement, configID, hostID, vmID,
(ProductServiceConfigID)psc.getID(), componentTypeMap, editor);
+ DeployedComponent dc =
xmlHelper.createDeployedServiceComponent(svcElement, configID, hostID, vmID,
componentTypeMap, editor);
configurationObjects.add(dc);
- }
-
- }
-
-
- }
-
-
-
-
- }
+ } // end services
+ } // end vm
+
+ } // end host
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_Visitor.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_Visitor.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_42_Visitor.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -90,47 +90,10 @@
return editor;
}
-// object visitDeployedElement(Element element,
-// int componentDefnType,
-// ConfigurationID configID,
-// HostID hostID,
-// VMComponentDefnID vmID,
-// ProductServiceConfigID pscID,
-// ) throws Exception {)
-//
-// // @see ComponentDefn for the various types
-// Object visitElement(Element element, int componentDefnType, ConfigurationID configID)
throws Exception {
-// Object result = null;
-//
-// switch(componentDefnType){
-// case ComponentDefn.VM_COMPONENT_CODE:
-// return helper.createVMComponentDefn(element, configID, editor, null);
-// case ComponentDefn.PSC_COMPONENT_CODE:
-// return helper.createProductServiceConfig(element, configID, getEditor(),
null);
-// case ComponentDefn.CONNECTOR_COMPONENT_CODE:
-// return helper.createConnectorBinding(element, getEditor(), null, true);
-// case ComponentDefn.SERVICE_COMPONENT_CODE:
-// return helper.createServiceComponentDefn(element, configID, getEditor(),
null);
-// case ComponentDefn.RESOURCE_DESCRIPTOR_COMPONENT_CODE:
-// return helper.createResourcePool(element, configID, getEditor());
-// case ComponentDefn.HOST_COMPONENT_CODE:
-// return helper.createHost(element,configID, editor, null);
-// case ComponentDefn.CONFIGURATION_COMPONENT_CODE:
-// return helper.createConfiguration(element, getEditor(), null);
-// case ComponentDefn.DEPLOYED_COMPONENT_CODE:
-// return helper.createDeployedComponent(element, null, result, null, null,
null, null)
-//
-// }
-//
-//
-// return result;
-//
-// }
-
Element visitComponent(ComponentType component) {
- if (component instanceof ProductType) {
- return helper.createProductTypeElement((ProductType) component);
- }
+// if (component instanceof ProductType) {
+// return helper.createProductTypeElement((ProductType) component);
+// }
return helper.createComponentTypeElement(component);
}
@@ -142,8 +105,8 @@
switch(BasicUtil.getComponentDefnType(component)){
case ComponentDefn.VM_COMPONENT_CODE:
return helper.createVMComponentDefnElement((VMComponentDefn) component);
- case ComponentDefn.PSC_COMPONENT_CODE:
- return helper.createProductServiceConfigElement((ProductServiceConfig)
component);
+// case ComponentDefn.PSC_COMPONENT_CODE:
+// return helper.createProductServiceConfigElement((ProductServiceConfig)
component);
case ComponentDefn.CONNECTOR_COMPONENT_CODE:
return helper.createServiceComponentDefnElement((ServiceComponentDefn)
component);
@@ -164,8 +127,8 @@
return helper.createDeployedComponentElement((DeployedComponent)
component);
case ComponentDefn.SHARED_RESOURCE_COMPONENT_CODE:
return helper.createSharedResourceElement((SharedResource) component);
- case ComponentDefn.PRODUCT_COMPONENT_CODE:
- return helper.createProductTypeElement((ProductType) component);
+// case ComponentDefn.PRODUCT_COMPONENT_CODE:
+// return helper.createProductTypeElement((ProductType) component);
}
return null;
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_Base_ImportExportUtility.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_Base_ImportExportUtility.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLConfig_Base_ImportExportUtility.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -49,7 +49,7 @@
import com.metamatrix.common.config.api.ConnectorBinding;
import com.metamatrix.common.config.api.DeployedComponent;
import com.metamatrix.common.config.api.Host;
-import com.metamatrix.common.config.api.ProductServiceConfig;
+//import com.metamatrix.common.config.api.ProductServiceConfig;
//import com.metamatrix.common.config.api.ProductType;
import com.metamatrix.common.config.api.ResourceDescriptor;
import com.metamatrix.common.config.api.ServiceComponentDefn;
@@ -1136,7 +1136,7 @@
List serviceComponentDefns = lists[SERVICE_COMPONENT_DEFNS_INDEX];
List vmComponentDefns = lists[VM_COMPONENT_DEFNS_INDEX];
List componentTypes = lists[COMPONENT_TYPES_INDEX];
- List productServiceConfigs = lists[PRODUCT_SERVICE_CONFIGS_INDEX];
+ // List productServiceConfigs = lists[PRODUCT_SERVICE_CONFIGS_INDEX];
List connectionPools = lists[CONNECTION_POOL_CONFIGS_INDEX];
@@ -1150,7 +1150,7 @@
List serviceComponentDefnIDs = lists[SERVICE_COMPONENT_DEFN_IDS_INDEX];
List vmComponentDefnIDs = lists[VM_COMPONENT_DEFN_IDS_INDEX];
List componentTypeIDs = lists[COMPONENT_TYPE_IDS_INDEX];
- List productServiceConfigIDs = lists[PRODUCT_SERVICE_CONFIG_IDS_INDEX];
+ // List productServiceConfigIDs = lists[PRODUCT_SERVICE_CONFIG_IDS_INDEX];
List connectorBindingsIDs = lists[CONNECTORS_IDS_INDEX];
@@ -1161,7 +1161,7 @@
// to return true if the ID is null instead of throwing a bogus exception
serviceComponentDefnIDs.add(null);
connectorBindingsIDs.add(null);
- productServiceConfigIDs.add(null);
+ // productServiceConfigIDs.add(null);
// productTypeIDs.add(null);
componentTypeIDs.add(null);
@@ -1187,9 +1187,9 @@
throwObjectsNotResolvable(deployedComponent,
deployedComponent.getHostID(), "host"); //$NON-NLS-1$
}
- if
(!productServiceConfigIDs.contains(deployedComponent.getProductServiceConfigID())) {
- throwObjectsNotResolvable(deployedComponent,
deployedComponent.getProductServiceConfigID(), "psc"); //$NON-NLS-1$
- }
+// if
(!productServiceConfigIDs.contains(deployedComponent.getProductServiceConfigID())) {
+// throwObjectsNotResolvable(deployedComponent,
deployedComponent.getProductServiceConfigID(), "psc"); //$NON-NLS-1$
+// }
checkComponentTypeID(deployedComponent, componentTypeIDs);
}
@@ -1228,39 +1228,41 @@
VMComponentDefn defn = (VMComponentDefn)iterator.next();
checkComponentTypeID(defn, componentTypeIDs);
checkConfigurationID(defn, configurationIDs);
- }
-
-
- iterator = productServiceConfigs.iterator();
- while (iterator.hasNext()) {
- ProductServiceConfig config = (ProductServiceConfig)iterator.next();
- // psc's component types are based on products, not actual component
types
-// checkPSCProductTypeID(config);
-
-// checkComponentTypeID(config, componentTypeIDs, productTypeIDs);
- checkConfigurationID(config, configurationIDs);
- Iterator iter = config.getServiceComponentDefnIDs().iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- // ComponentDefnID id = (ComponentDefnID) obj;
-// System.out.println("PSC ID: " + id.getFullName() + " class
" + id.getClass().getName());
-
- if (serviceComponentDefnIDs.contains(obj) ||
- connectorBindingsIDs.contains(obj) ) {
- } else {
- throwObjectsNotResolvable(obj, config, "service
component"); //$NON-NLS-1$
- }
- }
+
}
- iterator = componentTypes.iterator();
- while (iterator.hasNext()) {
- ComponentType type = (ComponentType)iterator.next();
- // checkForComponentTypeID(type.getSuperComponentTypeID(), componentTypeIDs);
- // checkForProductTypeID(type, type.getParentComponentTypeID(),
productTypeIDs, componentTypeIDs);
- }
+// iterator = productServiceConfigs.iterator();
+// while (iterator.hasNext()) {
+// ProductServiceConfig config = (ProductServiceConfig)iterator.next();
+//
+// // psc's component types are based on products, not actual component
types
+//// checkPSCProductTypeID(config);
+//
+//// checkComponentTypeID(config, componentTypeIDs, productTypeIDs);
+// checkConfigurationID(config, configurationIDs);
+// Iterator iter = config.getServiceComponentDefnIDs().iterator();
+// while (iter.hasNext()) {
+// Object obj = iter.next();
+// // ComponentDefnID id = (ComponentDefnID) obj;
+//// System.out.println("PSC ID: " + id.getFullName() + " class
" + id.getClass().getName());
+//
+// if (serviceComponentDefnIDs.contains(obj) ||
+// connectorBindingsIDs.contains(obj) ) {
+// } else {
+// throwObjectsNotResolvable(obj, config, "service
component"); //$NON-NLS-1$
+// }
+// }
+// }
+//
+// iterator = componentTypes.iterator();
+// while (iterator.hasNext()) {
+// ComponentType type = (ComponentType)iterator.next();
+// // checkForComponentTypeID(type.getSuperComponentTypeID(),
componentTypeIDs);
+// // checkForProductTypeID(type, type.getParentComponentTypeID(),
productTypeIDs, componentTypeIDs);
+// }
+
// iterator = productTypes.iterator();
// while (iterator.hasNext()) {
// ProductType type = (ProductType)iterator.next();
@@ -1404,9 +1406,9 @@
ArrayList deployedComponents = new ArrayList();
ArrayList serviceComponentDefns = new ArrayList();
ArrayList vmComponentDefns = new ArrayList();
- ArrayList productServiceConfigs = new ArrayList();
+ // ArrayList productServiceConfigs = new ArrayList();
ArrayList configurations = new ArrayList();
- ArrayList productTypes = new ArrayList();
+// ArrayList productTypes = new ArrayList();
ArrayList connPools = new ArrayList();
ArrayList resources = new ArrayList();
ArrayList bindings = new ArrayList();
@@ -1417,9 +1419,9 @@
ArrayList deployedComponentIDs = new ArrayList();
ArrayList serviceComponentDefnIDs = new ArrayList();
ArrayList vmComponentDefnIDs = new ArrayList();
- ArrayList productServiceConfigIDs = new ArrayList();
+ // ArrayList productServiceConfigIDs = new ArrayList();
ArrayList configurationIDs = new ArrayList();
- ArrayList productTypeIDs = new ArrayList();
+ // ArrayList productTypeIDs = new ArrayList();
ArrayList bindingIDs = new ArrayList();
@@ -1456,10 +1458,11 @@
bindingIDs.add(((BaseObject)obj).getID());
}else if(obj instanceof ComponentDefn) {
- if (obj instanceof ProductServiceConfig) {
- productServiceConfigs.add(obj);
- productServiceConfigIDs.add(((BaseObject)obj).getID());
- }else if(obj instanceof ServiceComponentDefn) {
+// if (obj instanceof ProductServiceConfig) {
+// productServiceConfigs.add(obj);
+// productServiceConfigIDs.add(((BaseObject)obj).getID());
+// }else
+ if(obj instanceof ServiceComponentDefn) {
serviceComponentDefns.add(obj);
serviceComponentDefnIDs.add(((BaseObject)obj).getID());
}else if(obj instanceof VMComponentDefn) {
@@ -1479,22 +1482,22 @@
lists[CONFIGURATIONS_INDEX] = configurations;
- lists[PRODUCT_TYPES_INDEX] = productTypes;
+// lists[PRODUCT_TYPES_INDEX] = productTypes;
lists[HOSTS_INDEX] = hosts;
lists[DEPLOYED_COMPONENTS_INDEX] = deployedComponents;
lists[SERVICE_COMPONENT_DEFNS_INDEX] = serviceComponentDefns;
lists[VM_COMPONENT_DEFNS_INDEX] = vmComponentDefns;
lists[COMPONENT_TYPES_INDEX] = componentTypes;
- lists[PRODUCT_SERVICE_CONFIGS_INDEX] = productServiceConfigs;
+// lists[PRODUCT_SERVICE_CONFIGS_INDEX] = productServiceConfigs;
lists[CONFIGURATION_IDS_INDEX] = configurationIDs;
- lists[PRODUCT_TYPE_IDS_INDEX] = productTypeIDs;
+// lists[PRODUCT_TYPE_IDS_INDEX] = productTypeIDs;
lists[HOST_IDS_INDEX] = hostIDs;
lists[DEPLOYED_COMPONENT_IDS_INDEX] = deployedComponentIDs;
lists[SERVICE_COMPONENT_DEFN_IDS_INDEX] = serviceComponentDefnIDs;
lists[VM_COMPONENT_DEFN_IDS_INDEX] = vmComponentDefnIDs;
lists[COMPONENT_TYPE_IDS_INDEX] = componentTypeIDs;
- lists[PRODUCT_SERVICE_CONFIG_IDS_INDEX] = productServiceConfigIDs;
+// lists[PRODUCT_SERVICE_CONFIG_IDS_INDEX] = productServiceConfigIDs;
lists[CONNECTION_POOL_CONFIGS_INDEX] = connPools;
@@ -1515,26 +1518,4 @@
protected abstract XMLHelper getXMLHelper();
-// protected abstract Properties createHeaderProperties(Properties props) ;
-
-// {
-// Properties defaultProperties = new Properties();
-////
defaultProperties.setProperty(ConfigurationPropertyNames.DOCUMENT_TYPE_VERSION,
XML_DOCUMENT_TYPE_VERSION);
-// defaultProperties.setProperty(ConfigurationPropertyNames.USER_CREATED_BY,
DEFAULT_USER_CREATED_BY);
-// // the properties passed in by the user override those put in by this
-// // method.
-// if (props!=null) {
-// defaultProperties.putAll(props);
-// }
-//
-//
defaultProperties.setProperty(ConfigurationPropertyNames.METAMATRIX_SYSTEM_VERSION,
MetaMatrixProductNames.VERSION_NUMBER);
-// defaultProperties.setProperty(ConfigurationPropertyNames.TIME,
DateUtil.getCurrentDateAsString());
-// defaultProperties.setProperty(ConfigurationPropertyNames.,
DEFAULT_USER_CREATED_BY);
-//
-//
-// return defaultProperties;
-// }
-
-
-
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelper.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelper.java 2009-04-09
20:56:48 UTC (rev 741)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/xml/XMLHelper.java 2009-04-09
21:30:19 UTC (rev 742)
@@ -41,9 +41,6 @@
import com.metamatrix.common.config.api.DeployedComponent;
import com.metamatrix.common.config.api.Host;
import com.metamatrix.common.config.api.HostID;
-import com.metamatrix.common.config.api.ProductServiceConfig;
-import com.metamatrix.common.config.api.ProductServiceConfigID;
-import com.metamatrix.common.config.api.ProductType;
import com.metamatrix.common.config.api.ResourceDescriptor;
import com.metamatrix.common.config.api.ServiceComponentDefn;
import com.metamatrix.common.config.api.SharedResource;
@@ -139,7 +136,7 @@
* @param config the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductServiceConfigElement(ProductServiceConfig config);
+ // public Element createProductServiceConfigElement(ProductServiceConfig config);
/**
* This method is used to create a ComponentType JDOM Element from a
@@ -175,7 +172,7 @@
* @param type the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductTypesElement() ;
+ // public Element createProductTypesElement() ;
/**
* This method is used to create a ProductServiceConfig JDOM Element from a
@@ -184,7 +181,7 @@
* @param type the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductServiceConfigsElement() ;
+ // public Element createProductServiceConfigsElement() ;
/**
@@ -194,7 +191,7 @@
* @param type the Object to be converted to a JDOM XML Element
* @return a JDOM XML Element
*/
- public Element createProductTypeElement(ProductType type);
+ // public Element createProductTypeElement(ProductType type);
/**
* This method is used to create a Host JDOM Element from a
@@ -408,7 +405,7 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLElementNames class.
*/
- public ProductType createProductType(Element element, ConfigurationObjectEditor
editor,Map ComponentTypeMap, String name)throws InvalidConfigurationElementException;
+ // public ProductType createProductType(Element element, ConfigurationObjectEditor
editor,Map ComponentTypeMap, String name)throws InvalidConfigurationElementException;
/**
@@ -579,20 +576,19 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLElementNames class.
*/
- public DeployedComponent createDeployedComponent(Element element, Configuration
config, ConfigurationObjectEditor editor, Map serviceComponentDefnMap, Map
vmComponentDefnMap, Map componentTypeMap, String name)throws
InvalidConfigurationElementException;
+// public DeployedComponent createDeployedComponent(Element element, Configuration
config, ConfigurationObjectEditor editor, Map serviceComponentDefnMap, Map
vmComponentDefnMap, Map componentTypeMap, String name)throws
InvalidConfigurationElementException;
- public DeployedComponent createDeployedComponent(Element element,
- ConfigurationID configID,
- HostID hostID,
- VMComponentDefnID vmID,
- ProductServiceConfigID pscID,
- Map componentTypeMap,
- ConfigurationObjectEditor editor)
- throws
InvalidConfigurationElementException;
+// public DeployedComponent createDeployedComponent(Element element,
+// ConfigurationID configID,
+// HostID hostID,
+// VMComponentDefnID vmID,
+// Map componentTypeMap,
+// ConfigurationObjectEditor editor)
+// throws
InvalidConfigurationElementException;
- public Element createDeployedProductServiceConfigElement(ProductServiceConfig
config);
+ // public Element createDeployedProductServiceConfigElement(ProductServiceConfig
config);
/**
* This method will create a VMComponentDefn configuration object from an XML element
@@ -643,7 +639,7 @@
* or its XML structure do not conform to the XML structure specfied in
* the XMLElementNames class.
*/
- public ProductServiceConfig createProductServiceConfig(Element element,
ConfigurationID configID, ConfigurationObjectEditor editor, String name)throws
InvalidConfigurationElementException;
+// public ProductServiceConfig createProductServiceConfig(Element element,
ConfigurationID configID, ConfigurationObjectEditor editor, String name)throws
InvalidConfigurationElementException;
/**
* This method will create a ComponentObject configuration object from an XML element