Author: rareddy
Date: 2009-07-21 21:23:58 -0400 (Tue, 21 Jul 2009)
New Revision: 1165
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
trunk/embedded/src/test/resources/dqp/dqp.properties
Log:
TEIID-652: Corrected issue such that if the default properties for the connector type are
not found in the configuration.xml, then the default properties from the connector type
object instantiated will be taken. Also, stream lined the loading of VDB during the
initialization of the embedded configuration service similar to that of adding VDB through
admin api, so that there is only one way to load a VDB.
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java 2009-07-21
23:33:56 UTC (rev 1164)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java 2009-07-22
01:23:58 UTC (rev 1165)
@@ -173,7 +173,11 @@
// Load connector bindings, do we ever need connector types?
Collection<ConnectorBinding> bindings =
configuration.getConfiguration().getConnectorBindings();
for(ConnectorBinding binding:bindings) {
- if (binding.getFullName().equalsIgnoreCase(name)) {
+ String deployedName = binding.getDeployedName();
+ if (deployedName == null) {
+ deployedName = binding.getFullName();
+ }
+ if (deployedName.equalsIgnoreCase(name)) {
return true;
}
}
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
---
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-07-21
23:33:56 UTC (rev 1164)
+++
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-07-22
01:23:58 UTC (rev 1165)
@@ -728,7 +728,7 @@
}
private boolean isGlobalConnectorBinding(ConnectorBinding binding) {
- return ServerConfigFileReader.containsBinding(this.configurationModel,
binding.getFullName());
+ return ServerConfigFileReader.containsBinding(this.configurationModel,
binding.getDeployedName());
}
/**
@@ -755,9 +755,11 @@
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connector_delete", new
Object[] {binding.getDeployedName()}); //$NON-NLS-1$
loadedConnectorBindings.remove(binding.getDeployedName());
- // only save to the configuration xml only if the shared tag is set to true
- this.configurationModel =
ServerConfigFileWriter.deleteConnectorBinding(configurationModel, binding);
- saveSystemConfiguration(this.configurationModel);
+ if (isGlobalConnectorBinding(binding)) {
+ // only save to the configuration xml only if the shared tag is set to true
+ this.configurationModel =
ServerConfigFileWriter.deleteConnectorBinding(configurationModel, binding);
+ saveSystemConfiguration(this.configurationModel);
+ }
}
else {
throw new
MetaMatrixComponentException(DQPEmbeddedPlugin.Util.getString("EmbeddedConfigurationService.connector_binding_delete_failed",
deployedConnectorBindingName)); //$NON-NLS-1$
Modified:
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
===================================================================
---
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java 2009-07-21
23:33:56 UTC (rev 1164)
+++
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java 2009-07-22
01:23:58 UTC (rev 1165)
@@ -140,7 +140,7 @@
public void testGetDirectoryToStoreVDBS() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
service.setUserPreferences(p);
-
assertTrue(service.getVDBSaveLocation().toString().endsWith("dqp/config/"));
//$NON-NLS-1$
+
assertTrue(service.getVDBSaveLocation().toString().endsWith("dqp/config/QT_Ora9DS.vdb"));
//$NON-NLS-1$
}
public void testGetDirectoryToStoreVDBSByVDBName() throws Exception {
Modified: trunk/embedded/src/test/resources/dqp/dqp.properties
===================================================================
--- trunk/embedded/src/test/resources/dqp/dqp.properties 2009-07-21 23:33:56 UTC (rev
1164)
+++ trunk/embedded/src/test/resources/dqp/dqp.properties 2009-07-22 01:23:58 UTC (rev
1165)
@@ -20,7 +20,7 @@
# 02110-1301 USA.
#
-vdb.definition=./config
+vdb.definition=./config/QT_Ora9DS.vdb;./config/Admin.vdb
#dqp.metadata.systemURL=file://${system-vdb-path}/System.vdb
dqp.configFile=./config/ServerConfig.xml
dqp.classpath=./lib