[teiid-commits] teiid SVN: r1417 - in trunk: runtime/src/main/java/com/metamatrix/dqp/embedded/admin and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Sep 18 19:20:08 EDT 2009


Author: rareddy
Date: 2009-09-18 19:20:08 -0400 (Fri, 18 Sep 2009)
New Revision: 1417

Modified:
   trunk/build/kit-runtime/deploy.properties
   trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
Log:
TEIID-842:  Adding "dqp.config" property back. Fixed minor issue with connector type updating, as it was being updated when it is not required to.

Modified: trunk/build/kit-runtime/deploy.properties
===================================================================
--- trunk/build/kit-runtime/deploy.properties	2009-09-18 23:19:43 UTC (rev 1416)
+++ trunk/build/kit-runtime/deploy.properties	2009-09-18 23:20:08 UTC (rev 1417)
@@ -15,6 +15,9 @@
 #Path to instance specific temporary information for caching, buffering, and transactions
 dqp.workdir=./work
 
+#Path to the Teiid Configuration file (manages connector types and shared connector bindings)
+dqp.configFile=./deploy/configuration.xml
+
 #Jars to load, which will be available to all services: UDFs, command logging, etc.
 #dqp.extension.CommonClasspath=extensionjar:x.jar,extensionjar:y.jar
 

Modified: trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
===================================================================
--- trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java	2009-09-18 23:19:43 UTC (rev 1416)
+++ trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java	2009-09-18 23:20:08 UTC (rev 1417)
@@ -208,7 +208,7 @@
             }
             
             // now that all of the input parameters validated, add the connector binding
-            binding = addConnectorBinding(deployName, binding, ctype, true);
+            binding = addConnectorBinding(deployName, binding, ctype, false);
             
         } catch (MetaMatrixComponentException e) {
         	throw new AdminComponentException(e);
@@ -266,10 +266,14 @@
             ConnectorBindingType type = ConnectorConfigurationReader.loadConnectorType(xmlFile);
             
             // Check if the binding type exists already, if does take action based on user
-            // preferences in the admin options, same rules apply as binding.            
+            // preferences in the admin options, same rules apply as binding. 
+            boolean addType = true;
             if (bindingTypeExists(type.getName())) {
                 if (options.containsOption(AdminOptions.OnConflict.EXCEPTION)) {
                     throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.addBinding_type_exists", deployName, type.getName())); //$NON-NLS-1$
+                }
+                else if (options.containsOption(AdminOptions.OnConflict.IGNORE)) {
+                	addType = false;
                 }                
             }
             
@@ -285,7 +289,7 @@
             }
 
             // now that all of the input parameters validated, add the connector binding
-            binding = addConnectorBinding(deployName, binding, type, true);
+            binding = addConnectorBinding(deployName, binding, type, addType);
                                 
         } catch (MetaMatrixComponentException e) {
         	throw new AdminComponentException(e);
@@ -302,7 +306,7 @@
      * @param options
      * @throws AdminException
      */
-    ConnectorBinding addConnectorBinding(String deployName, ConnectorBinding binding, ConnectorBindingType type, boolean replace) 
+    ConnectorBinding addConnectorBinding(String deployName, ConnectorBinding binding, ConnectorBindingType type, boolean addType) 
         throws AdminException {
         // Make sure we have both correctly configured
         if (type != null && binding != null) {
@@ -310,11 +314,11 @@
                 try {
                     
                     // First add the connector type if one is not already in here.
-                    if (getConfigurationService().getConnectorType(type.getName()) == null || replace) {
+                    if (getConfigurationService().getConnectorType(type.getName()) == null || addType) {
                         saveConnectorType(type);
                     }
                     // Now add the connector binding.
-                    binding = getConfigurationService().addConnectorBinding(deployName, binding, replace);
+                    binding = getConfigurationService().addConnectorBinding(deployName, binding, true);
                     return binding;
                 } catch (MetaMatrixComponentException e) {
                 	throw new AdminComponentException(e);



More information about the teiid-commits mailing list