Author: shawkins
Date: 2010-10-29 14:14:44 -0400 (Fri, 29 Oct 2010)
New Revision: 2691
Modified:
trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
Log:
forward merge of 7.1.1
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-10-29 17:30:50
UTC (rev 2690)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-10-29 18:14:44
UTC (rev 2691)
@@ -28,7 +28,6 @@
import java.lang.reflect.Proxy;
import java.util.Properties;
-import org.teiid.client.util.ExceptionUtil;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.jdbc.JDBCPlugin;
import org.teiid.net.CommunicationException;
@@ -75,9 +74,6 @@
try {
return method.invoke(getTarget(), args);
} catch (InvocationTargetException e) {
- if (ExceptionUtil.getExceptionOfType(e, CommunicationException.class) != null) {
- this.admin = null;
- }
throw e.getTargetException();
}
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-10-29
17:30:50 UTC (rev 2690)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-10-29
18:14:44 UTC (rev 2691)
@@ -227,13 +227,22 @@
return list;
}
- public void addError(String severity, String message) {
+ public ValidationError addError(String severity, String message) {
if (this.errors == null) {
this.errors = new ArrayList<ValidationError>();
}
- this.errors.add(new ValidationError(severity, message));
+ ValidationError ve = new ValidationError(severity, message);
+ this.errors.add(ve);
+ return ve;
}
+ public boolean removeError(ValidationError remove) {
+ if (this.errors == null) {
+ return false;
+ }
+ return this.errors.remove(remove);
+ }
+
public void clearErrors() {
this.errors.clear();
}
@@ -290,5 +299,27 @@
public void setPath(String path) {
this.path = path;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ValidationError other = (ValidationError) obj;
+ if (severity == null) {
+ if (other.severity != null)
+ return false;
+ } else if (!severity.equals(other.severity))
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2010-10-29
17:30:50 UTC (rev 2690)
+++ trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2010-10-29
18:14:44 UTC (rev 2691)
@@ -22,6 +22,7 @@
package org.teiid.deployers;
import java.io.IOException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
@@ -42,7 +43,9 @@
if (url == null) {
throw new
TeiidRuntimeException(RuntimeMetadataPlugin.Util.getString("system_vdb_not_found"));
//$NON-NLS-1$
}
- this.vdbRepository.setSystemStore(new
IndexMetadataFactory(url).getMetadataStore(null));
+ // uri conversion is only to remove the spaces in URL, note this only with above kind
situation
+ URI uri = new URI(url.getProtocol(), url.getPath(), null);
+ this.vdbRepository.setSystemStore(new
IndexMetadataFactory(uri.toURL()).getMetadataStore(null));
} catch (URISyntaxException e) {
throw new TeiidRuntimeException(e,
RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
} catch (IOException e) {
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-10-29 17:30:50
UTC (rev 2690)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-10-29 18:14:44
UTC (rev 2691)
@@ -42,6 +42,7 @@
import org.teiid.adminapi.impl.SourceMappingMetadata;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
import org.teiid.core.util.FileUtils;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
@@ -284,19 +285,19 @@
if (!loaded) {
String msg = RuntimePlugin.Util.getString("model_metadata_loading",
vdb.getName()+"-"+vdb.getVersion(), model.getName(),
SimpleDateFormat.getInstance().format(new Date())); //$NON-NLS-1$ //$NON-NLS-2$
- model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(), msg);
+ final ValidationError addedError =
model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(), msg);
LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
threadPool.run(new Runnable() {
@Override
public void run() {
- loadMetadata(vdb, model, cache, cacheFile, vdbStore, cmr);
+ loadMetadata(vdb, model, cache, cacheFile, vdbStore, cmr, addedError);
}
});
}
}
}
- private void loadMetadata(VDBMetaData vdb, ModelMetaData model, boolean cache, File
cacheFile, MetadataStoreGroup vdbStore, ConnectorManagerRepository cmr) {
+ private void loadMetadata(VDBMetaData vdb, ModelMetaData model, boolean cache, File
cacheFile, MetadataStoreGroup vdbStore, ConnectorManagerRepository cmr, ValidationError
addedError) {
Exception exception = null;
boolean loaded = false;
@@ -311,7 +312,7 @@
this.serializer.saveAttachment(cacheFile, store);
}
vdbStore.addStore(store);
- model.clearErrors();
+ model.removeError(addedError);
loaded = true;
break;
} catch (TranslatorException e) {