Author: shawkins
Date: 2010-09-27 13:46:50 -0400 (Mon, 27 Sep 2010)
New Revision: 2613
Modified:
branches/7.1.x/client/src/main/java/org/teiid/adminapi/Translator.java
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java
branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
branches/7.1.x/client/src/main/resources/vdb-deployer.xsd
branches/7.1.x/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
Log:
TEIID-1278 fixing translator description output for vdb metadata and reducing the level of
some exceptions
Modified: branches/7.1.x/client/src/main/java/org/teiid/adminapi/Translator.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/adminapi/Translator.java 2010-09-27
15:41:57 UTC (rev 2612)
+++ branches/7.1.x/client/src/main/java/org/teiid/adminapi/Translator.java 2010-09-27
17:46:50 UTC (rev 2613)
@@ -31,4 +31,10 @@
* @return
*/
public String getType();
+
+ /**
+ * Get the Translator description
+ * @return
+ */
+ public String getDescription();
}
Modified:
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java
===================================================================
---
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java 2010-09-27
15:41:57 UTC (rev 2612)
+++
branches/7.1.x/client/src/main/java/org/teiid/adminapi/impl/VDBTranslatorMetaData.java 2010-09-27
17:46:50 UTC (rev 2613)
@@ -41,7 +41,7 @@
public class VDBTranslatorMetaData extends AdminObjectImpl implements Translator {
private static final long serialVersionUID = -3454161477587996138L;
private String type;
- private Class executionClass;
+ private Class<?> executionClass;
private String description;
@Override
@@ -83,7 +83,7 @@
return this.executionClass;
}
- public void setExecutionFactoryClass(Class clazz) {
+ public void setExecutionFactoryClass(Class<?> clazz) {
this.executionClass = clazz;
addProperty(EXECUTION_FACTORY_CLASS, clazz.getName());
}
@@ -93,7 +93,7 @@
return this.description;
}
- @XmlAttribute(name = "description", required = true)
+ @XmlAttribute(name = "description")
public void setDescription(String desc) {
this.description = desc;
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-09-27
15:41:57 UTC (rev 2612)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-09-27
17:46:50 UTC (rev 2613)
@@ -478,8 +478,8 @@
try {
resultsMsg = sendRequestMessageAndWait(reqMessage);
} catch ( Throwable ex ) {
- String msg =
JDBCPlugin.Util.getString("MMStatement.Error_executing_stmt",
reqMessage.getCommandString()); //$NON-NLS-1$
- logger.log(Level.SEVERE, msg, ex);
+ String msg =
JDBCPlugin.Util.getString("MMStatement.Error_executing_stmt",
reqMessage.getCommandString()); //$NON-NLS-1$
+ logger.log(ex instanceof SQLException?Level.WARNING:Level.SEVERE, msg, ex);
throw TeiidSQLException.create(ex, msg);
}
@@ -881,7 +881,7 @@
* Send out request message with necessary states.
*/
protected ResultsMessage sendRequestMessageAndWait(RequestMessage reqMsg)
- throws SQLException, InterruptedException, TimeoutException {
+ throws SQLException, InterruptedException {
this.currentRequestID = this.driverConnection.nextRequestID();
// Create a request message
reqMsg.setExecutionPayload(this.payload);
@@ -925,7 +925,7 @@
}
if (commandStatus == TIMED_OUT) {
- throw new
TimeoutException(JDBCPlugin.Util.getString("MMStatement.Timeout_before_complete"));
//$NON-NLS-1$
+ throw new
TeiidSQLException(JDBCPlugin.Util.getString("MMStatement.Timeout_before_complete"));
//$NON-NLS-1$
}
return result;
}
Modified: branches/7.1.x/client/src/main/resources/vdb-deployer.xsd
===================================================================
--- branches/7.1.x/client/src/main/resources/vdb-deployer.xsd 2010-09-27 15:41:57 UTC (rev
2612)
+++ branches/7.1.x/client/src/main/resources/vdb-deployer.xsd 2010-09-27 17:46:50 UTC (rev
2613)
@@ -71,6 +71,7 @@
</xs:sequence>
<xs:attribute name="name" type="xs:string"
use="required"/>
<xs:attribute name="type" type="xs:string"
use="required"/>
+ <xs:attribute name="description"
type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="data-role" minOccurs="0"
maxOccurs="unbounded">
Modified:
branches/7.1.x/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
---
branches/7.1.x/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-09-27
15:41:57 UTC (rev 2612)
+++
branches/7.1.x/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-09-27
17:46:50 UTC (rev 2613)
@@ -85,6 +85,7 @@
TranslatorMetaData t1 = new TranslatorMetaData();
t1.setName("oracleOverride");
t1.setType("oracle");
+ t1.setDescription("hello world");
t1.addProperty("my-property", "my-value");
List<Translator> list = new ArrayList<Translator>();
list.add(t1);
@@ -160,7 +161,7 @@
assertEquals("oracleOverride", translator.getName());
assertEquals("oracle", translator.getType());
assertEquals("my-value",
translator.getPropertyValue("my-property"));
-
+ assertEquals("hello world", translator.getDescription());
List<DataPolicy> roles = vdb.getDataPolicies();
assertTrue(roles.size() == 1);