Author: rareddy
Date: 2010-05-13 10:30:43 -0400 (Thu, 13 May 2010)
New Revision: 2123
Added:
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
Removed:
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java
Modified:
trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java
trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
trunk/connector-api/src/main/java/org/teiid/translator/Execution.java
trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java
trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java
trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java
trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java
trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1089, TEIID-1075: renaming the capabilities and connector exception classes to
TranslatorCapabilities and TranslatorException. Also, remove the use of
TranslatorException from the connection layer
Modified: trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.connector.DataPlugin;
import org.teiid.core.id.UUIDFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TypeFacility;
@@ -73,9 +73,9 @@
* Add a table with the given name to the model.
* @param name
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Table addTable(String name) throws ConnectorException {
+ public Table addTable(String name) throws TranslatorException {
Table table = new Table();
table.setTableType(Table.Type.Table);
table.setName(name);
@@ -90,11 +90,11 @@
* @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Column addColumn(String name, String type, ColumnSet<?> table) throws
ConnectorException {
+ public Column addColumn(String name, String type, ColumnSet<?> table) throws
TranslatorException {
if (name.indexOf(AbstractMetadataRecord.NAME_DELIM_CHAR) != -1) {
- throw new
ConnectorException(DataPlugin.Util.getString("MetadataFactory.invalid_name",
name)); //$NON-NLS-1$
+ throw new
TranslatorException(DataPlugin.Util.getString("MetadataFactory.invalid_name",
name)); //$NON-NLS-1$
}
Column column = new Column();
column.setName(name);
@@ -109,10 +109,10 @@
}
private Datatype setColumnType(String type,
- BaseColumn column) throws ConnectorException {
+ BaseColumn column) throws TranslatorException {
Datatype datatype = dataTypes.get(type);
if (datatype == null) {
- throw new
ConnectorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype",
type)); //$NON-NLS-1$
+ throw new
TranslatorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype",
type)); //$NON-NLS-1$
}
column.setDatatype(datatype);
column.setDatatypeUUID(datatype.getUUID());
@@ -129,9 +129,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table)
throws ConnectorException {
+ public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table)
throws TranslatorException {
KeyRecord primaryKey = new KeyRecord(KeyRecord.Type.Primary);
primaryKey.setParent(table);
primaryKey.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -148,9 +148,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addAccessPattern(String name, List<String> columnNames, Table
table) throws ConnectorException {
+ public KeyRecord addAccessPattern(String name, List<String> columnNames, Table
table) throws TranslatorException {
KeyRecord ap = new KeyRecord(KeyRecord.Type.AccessPattern);
ap.setParent(table);
ap.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -168,9 +168,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addIndex(String name, boolean nonUnique, List<String>
columnNames, Table table) throws ConnectorException {
+ public KeyRecord addIndex(String name, boolean nonUnique, List<String>
columnNames, Table table) throws TranslatorException {
KeyRecord index = new
KeyRecord(nonUnique?KeyRecord.Type.NonUnique:KeyRecord.Type.Index);
index.setParent(table);
index.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -188,16 +188,16 @@
* @param pkTable
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public ForeignKey addForiegnKey(String name, List<String> columnNames, Table
pkTable, Table table) throws ConnectorException {
+ public ForeignKey addForiegnKey(String name, List<String> columnNames, Table
pkTable, Table table) throws TranslatorException {
ForeignKey foreignKey = new ForeignKey();
foreignKey.setParent(table);
foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
foreignKey.setName(name);
setUUID(foreignKey);
if (pkTable.getPrimaryKey() == null) {
- throw new ConnectorException("No primary key defined for table " + pkTable);
//$NON-NLS-1$
+ throw new TranslatorException("No primary key defined for table " +
pkTable); //$NON-NLS-1$
}
foreignKey.setPrimaryKey(pkTable.getPrimaryKey());
foreignKey.setUniqueKeyID(pkTable.getPrimaryKey().getUUID());
@@ -210,9 +210,9 @@
* Add a procedure with the given name to the model.
* @param name
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Procedure addProcedure(String name) throws ConnectorException {
+ public Procedure addProcedure(String name) throws TranslatorException {
Procedure procedure = new Procedure();
procedure.setName(name);
setUUID(procedure);
@@ -228,9 +228,9 @@
* @param parameterType should be one of {@link ProcedureParameter.Type}
* @param procedure
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public ProcedureParameter addProcedureParameter(String name, String type,
ProcedureParameter.Type parameterType, Procedure procedure) throws ConnectorException {
+ public ProcedureParameter addProcedureParameter(String name, String type,
ProcedureParameter.Type parameterType, Procedure procedure) throws TranslatorException {
ProcedureParameter param = new ProcedureParameter();
param.setName(name);
setUUID(param);
@@ -248,9 +248,9 @@
* @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
* @param procedure
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Column addProcedureResultSetColumn(String name, String type, Procedure procedure)
throws ConnectorException {
+ public Column addProcedureResultSetColumn(String name, String type, Procedure procedure)
throws TranslatorException {
if (procedure.getResultSet() == null) {
ColumnSet<Procedure> resultSet = new ColumnSet<Procedure>();
resultSet.setParent(procedure);
@@ -262,7 +262,7 @@
}
private void assignColumns(List<String> columnNames, Table table,
- ColumnSet<?> columns) throws ConnectorException {
+ ColumnSet<?> columns) throws TranslatorException {
for (String columnName : columnNames) {
boolean match = false;
for (Column column : table.getColumns()) {
@@ -273,7 +273,7 @@
}
}
if (!match) {
- throw new
ConnectorException(DataPlugin.Util.getString("MetadataFactory.no_column_found",
columnName)); //$NON-NLS-1$
+ throw new
TranslatorException(DataPlugin.Util.getString("MetadataFactory.no_column_found",
columnName)); //$NON-NLS-1$
}
}
}
Modified: trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -22,7 +22,7 @@
package org.teiid.metadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
* Helper methods that can be used to access runtime metadata.
@@ -34,45 +34,45 @@
* @param fullName
* @return The object
*/
- Table getTable(String fullName) throws ConnectorException;
+ Table getTable(String fullName) throws TranslatorException;
/**
* Look up an object by identifier
* @param fullName
* @return The object
*/
- Column getColumn(String fullName) throws ConnectorException;
+ Column getColumn(String fullName) throws TranslatorException;
/**
* Look up an object by identifier
* @param fullName
* @return The object
*/
- Procedure getProcedure(String fullName) throws ConnectorException;
+ Procedure getProcedure(String fullName) throws TranslatorException;
/**
* Gets the contents of a VDB resource in binary form.
* @param resourcePath a path returned by getVDBResourcePaths()
* @return the binary contents of the resource in a byte[]
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public byte[] getBinaryVDBResource(String resourcePath) throws ConnectorException;
+ public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException;
/**
* Gets the contents of a VDB resource as a String.
* @param resourcePath a path returned by getVDBResourcePaths()
* @return the contents of the resource as a String of characters
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public String getCharacterVDBResource(String resourcePath) throws
ConnectorException;
+ public String getCharacterVDBResource(String resourcePath) throws
TranslatorException;
/**
* Gets the resource paths of all the resources in the VDB.
* @return an array of resource paths of the resources in the VDB
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public String[] getVDBResourcePaths() throws ConnectorException;
+ public String[] getVDBResourcePaths() throws TranslatorException;
}
Modified:
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,8 +38,6 @@
import javax.security.auth.Subject;
import javax.transaction.xa.XAResource;
-import org.teiid.translator.ConnectorException;
-
public class BasicManagedConnection implements ManagedConnection {
protected PrintWriter log;
protected final Collection<ConnectionEventListener> listeners = new
ArrayList<ConnectionEventListener>();
@@ -88,7 +86,7 @@
@Override
public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws
ResourceException {
if(!(arg1 instanceof ConnectionRequestInfoWrapper)) {
- throw new ConnectorException("Un-recognized Connection Request Info object
received"); //$NON-NLS-1$
+ throw new ResourceException("Un-recognized Connection Request Info object
received"); //$NON-NLS-1$
}
ConnectionContext.setSubject(arg0);
@@ -153,9 +151,9 @@
}
}
- Connection getConnection() throws ConnectorException {
+ Connection getConnection() throws ResourceException {
if (this.physicalConnection == null)
- throw new ConnectorException("Connection has been destroyed!!!");
//$NON-NLS-1$
+ throw new ResourceException("Connection has been destroyed!!!");
//$NON-NLS-1$
return this.physicalConnection;
}
Modified:
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,7 +38,6 @@
import org.teiid.core.TeiidException;
import org.teiid.core.util.ReflectionHelper;
-import org.teiid.translator.ConnectorException;
public abstract class BasicManagedConnectionFactory implements ManagedConnectionFactory,
ResourceAdapterAssociation, ValidatingManagedConnectionFactory {
@@ -86,21 +85,21 @@
this.ra = (BasicResourceAdapter)arg0;
}
- public static <T> T getInstance(Class<T> expectedType, String className,
Collection ctorObjs, Class defaultClass) throws ConnectorException {
+ public static <T> T getInstance(Class<T> expectedType, String className,
Collection ctorObjs, Class defaultClass) throws ResourceException {
try {
if (className == null) {
if (defaultClass == null) {
- throw new ConnectorException("Neither class name or default class specified
to create an instance"); //$NON-NLS-1$
+ throw new ResourceException("Neither class name or default class specified
to create an instance"); //$NON-NLS-1$
}
return expectedType.cast(defaultClass.newInstance());
}
return expectedType.cast(ReflectionHelper.create(className, ctorObjs,
Thread.currentThread().getContextClassLoader()));
} catch (TeiidException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
} catch (IllegalAccessException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
} catch(InstantiationException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
}
}
Deleted:
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -1,394 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.SetQuery;
-
-
-/**
- * Allows a connector to specify the capabilities that a connector
- * supports.
- */
-public interface ConnectorCapabilities {
-
- public enum SupportedJoinCriteria {
- /**
- * Indicates that any supported criteria is allowed.
- */
- ANY,
- /**
- * Indicates that any simple comparison of elements is allowed.
- */
- THETA,
- /**
- * Indicates that only equality predicates of elements are allowed.
- */
- EQUI,
- /**
- * Indicates that only equality predicates between
- * exactly one primary and foreign key is allowed per join.
- */
- KEY
- }
-
- /**
- * Support indicates connector can accept queries with SELECT DISTINCT
- * @since 3.1 SP2
- */
- boolean supportsSelectDistinct();
-
- /**
- * Support indicates connector can accept expressions other than element
- * symbols in the SELECT clause. Specific supports for the expression
- * type are still checked.
- * @since 6.1.0
- */
- boolean supportsSelectExpression();
-
- /**
- * Support indicates connector can accept groups with aliases
- * @since 3.1 SP2
- */
- boolean supportsAliasedGroup();
-
- /**
- * Get the supported join criteria. A null return value will be treated
- * as {@link SupportedJoinCriteria#ANY}
- * @since 6.1.0
- */
- SupportedJoinCriteria getSupportedJoinCriteria();
-
- /**
- * Support indicates connector can accept inner or cross joins
- * @since 6.1.0
- */
- boolean supportsInnerJoins();
-
- /**
- * Support indicates connector can accept self-joins where a
- * group is joined to itself with aliases. Connector must also support
- * {@link #supportsAliasedGroup()}.
- * @since 3.1 SP2
- */
- boolean supportsSelfJoins();
-
- /**
- * Support indicates connector can accept left outer joins
- * @since 3.1 SP2
- */
- boolean supportsOuterJoins();
-
- /**
- * Support indicates connector can accept full outer joins
- * @since 3.1 SP2
- */
- boolean supportsFullOuterJoins();
-
- /**
- * Support indicates connector can accept inline views (subqueries
- * in the FROM clause).
- * @since 4.1
- */
- boolean supportsInlineViews();
-
- /**
- * Support indicates connector accepts criteria of form (element BETWEEN constant AND
constant)
- * <br>NOT CURRENTLY USED - between is rewritten as compound compare criteria
- * @since 4.0
- */
- boolean supportsBetweenCriteria();
-
- /**
- * Support indicates connector accepts criteria of form (element = constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaEquals();
-
- /**
- * Support indicates connector accepts criteria of form (element <=|>=
constant)
- * <br>The query engine will may pushdown queries containing < or
> if NOT is also
- * supported.
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaOrdered();
-
- /**
- * Support indicates connector accepts criteria of form (element LIKE constant)
- * @since 3.1 SP2
- */
- boolean supportsLikeCriteria();
-
- /**
- * Support indicates connector accepts criteria of form (element LIKE constant ESCAPE
char)
- * @since 3.1 SP2
- */
- boolean supportsLikeCriteriaEscapeCharacter();
-
- /**
- * Support indicates connector accepts criteria of form (element IN set)
- * @since 3.1 SP2
- */
- boolean supportsInCriteria();
-
- /**
- * Support indicates connector accepts IN criteria with a subquery on the right side
- * @since 4.0
- */
- boolean supportsInCriteriaSubquery();
-
- /**
- * Support indicates connector accepts criteria of form (element IS NULL)
- * @since 3.1 SP2
- */
- boolean supportsIsNullCriteria();
-
- /**
- * Support indicates connector accepts logical criteria connected by OR
- * @since 3.1 SP2
- */
- boolean supportsOrCriteria();
-
- /**
- * Support indicates connector accepts logical criteria NOT
- * @since 3.1 SP2
- */
- boolean supportsNotCriteria();
-
- /**
- * Support indicates connector accepts the EXISTS criteria
- * @since 4.0
- */
- boolean supportsExistsCriteria();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use SOME
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaSome();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use ALL
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaAll();
-
- /**
- * Support indicates connector accepts ORDER BY clause, including multiple elements
- * and ascending and descending sorts.
- * @since 3.1 SP2
- */
- boolean supportsOrderBy();
-
- /**
- * Support indicates connector accepts ORDER BY clause with columns not from the
select
- * @since 6.2
- * @return
- */
- boolean supportsOrderByUnrelated();
-
- /**
- * Whether the source supports an explicit GROUP BY clause
- * @since 6.1
- */
- boolean supportsGroupBy();
-
- /**
- * Whether the source supports the HAVING clause
- * @since 6.1
- */
- boolean supportsHaving();
-
- /**
- * Support indicates connector can accept the SUM aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesSum();
-
- /**
- * Support indicates connector can accept the AVG aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesAvg();
-
- /**
- * Support indicates connector can accept the MIN aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMin();
-
- /**
- * Support indicates connector can accept the MAX aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMax();
-
- /**
- * Support indicates connector can accept the COUNT aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCount();
-
- /**
- * Support indicates connector can accept the COUNT(*) aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCountStar();
-
- /**
- * Support indicates connector can accept DISTINCT within aggregate functions
- * @since 3.1 SP2
- */
- boolean supportsAggregatesDistinct();
-
- /**
- * Support indicates connector can accept scalar subqueries in the SELECT, WHERE,
and
- * HAVING clauses
- * @since 4.0
- */
- boolean supportsScalarSubqueries();
-
- /**
- * Support indicates connector can accept correlated subqueries wherever subqueries
- * are accepted
- * @since 4.0
- */
- boolean supportsCorrelatedSubqueries();
-
- /**
- * Support indicates connector can accept queries with non-searched
- * CASE <expression> WHEN <expression> ... END
- * <br>NOT CURRENTLY USED - case is pushed down as searched case
- * @since 4.0
- */
- boolean supportsCaseExpressions();
-
- /**
- * Support indicates connector can accept queries with searched CASE WHEN
<criteria> ... END
- * @since 4.0
- */
- boolean supportsSearchedCaseExpressions();
-
- /**
- * Support indicates that the connector supports the UNION of two queries.
- * @since 4.2
- */
- boolean supportsUnions();
-
- /**
- * Support indicates that the connector supports an ORDER BY on a SetQuery.
- * @since 5.6
- */
- boolean supportsSetQueryOrderBy();
-
- /**
- * Support indicates that the connector supports the INTERSECT of two queries.
- * @since 5.6
- */
- boolean supportsIntersect();
-
- /**
- * Support indicates that the connector supports the EXCEPT of two queries.
- * @since 5.6
- */
- boolean supportsExcept();
-
- /**
- * Get list of all supported function names. Arithmetic functions have names like
- * "+".
- * @since 3.1 SP3
- */
- List<String> getSupportedFunctions();
-
- /**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
- */
- int getMaxInCriteriaSize();
-
- /**
- * <p>Support indicates that the connector supports functions in GROUP BY, such
as:
- * <code>SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY
dayofmonth(theDate)</code></p>
- *
- * <br>NOT CURRENTLY USED - group by expressions create an inline view for
pushdown
- * @since 5.0
- */
- boolean supportsFunctionsInGroupBy();
-
- /**
- * Gets whether the connector can limit the number of rows returned by a query.
- * @since 5.0 SP1
- */
- boolean supportsRowLimit();
-
- /**
- * Gets whether the connector supports a SQL clause (similar to the LIMIT with an
offset) that can return
- * result sets that start in the middle of the resulting rows returned by a query
- * @since 5.0 SP1
- */
- boolean supportsRowOffset();
-
- /**
- * The number of groups supported in the from clause. Added for a Sybase limitation.
- * @since 5.6
- * @return the number of groups supported in the from clause, or -1 if there is no
limit
- */
- int getMaxFromGroups();
-
- /**
- * Whether the source prefers to use ANSI style joins.
- * @since 6.0
- */
- boolean useAnsiJoin();
-
- /**
- * Whether the source supports queries without criteria.
- * @since 6.0
- */
- boolean requiresCriteria();
-
- /**
- * Whether the source supports {@link BatchedUpdates}
- * @since 6.0
- */
- boolean supportsBatchedUpdates();
-
- /**
- * Whether the source supports updates with multiple value sets
- * @since 6.0
- */
- boolean supportsBulkUpdate();
-
- /**
- * Support indicates that the connector can accept INSERTs with
- * values specified by an {@link SetQuery}.
- * @since 6.1
- */
- boolean supportsInsertWithQueryExpression();
-
-}
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import javax.resource.ResourceException;
-
-/**
- * An exception the connector writer can return in case of an
- * error while using the connector.
- */
-public class ConnectorException extends ResourceException{
-
- private static final long serialVersionUID = -5980862789340592219L;
-
- /**
- * No-arg constructor required by Externalizable semantics.
- */
- public ConnectorException() {
- super();
- }
-
- /**
- * Construct an instance with the message specified.
- *
- * @param message A message describing the exception
- */
- public ConnectorException( String message ) {
- super( message );
- }
-
- public ConnectorException( String errorCode, String message ) {
- super( message, errorCode);
- }
-
- public ConnectorException( int errorCode, String message ) {
- super(message, Integer.toString(errorCode));
- }
-
-
- /**
- * Construct an instance from a message and an exception to chain to this one.
- *
- * @param code A code denoting the exception
- * @param e An exception to nest within this one
- */
- public ConnectorException( Throwable e, String message ) {
- super(message,e);
- }
-
- /**
- * Construct an instance with a linked exception specified.
- *
- * @param e An exception to chain to this exception
- */
- public ConnectorException( Throwable e ) {
- super( e );
- }
-
-}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/Execution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/Execution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/Execution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -36,19 +36,19 @@
/**
* Terminates the execution normally.
*/
- void close() throws ConnectorException;
+ void close() throws TranslatorException;
/**
* Cancels the execution abnormally. This will happen via
* a different thread from the one performing the execution, so
* should be expected to happen in a multi-threaded scenario.
*/
- void cancel() throws ConnectorException;
+ void cancel() throws TranslatorException;
/**
* Execute the associated command. Results will be retrieved through a specific
sub-interface call.
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- void execute() throws ConnectorException;
+ void execute() throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
* The deployer instantiates this class through reflection. So it is important to have
no-arg constructor. Once constructed
* the "start" method is called. This class represents the basic capabilities
of the translator.
*/
-public class ExecutionFactory implements ConnectorCapabilities{
+public class ExecutionFactory implements TranslatorCapabilities{
public static final int DEFAULT_MAX_FROM_GROUPS = -1;
@@ -53,7 +53,7 @@
/**
* Initialize the connector with supplied configuration
*/
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
}
/**
@@ -146,7 +146,7 @@
* @param connection connection factory object to the data source
* @return An execution object that can use to execute the command
*/
- public Execution createExecution(Command command, ExecutionContext executionContext,
RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
+ public Execution createExecution(Command command, ExecutionContext executionContext,
RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
if (command instanceof QueryExpression) {
return createResultSetExecution((QueryExpression)command, executionContext, metadata,
connectionFactory);
}
@@ -156,16 +156,16 @@
return createUpdateExecution(command, executionContext, metadata, connectionFactory);
}
- public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws
ConnectorException {
- throw new ConnectorException("Unsupported Execution"); //$NON-NLS-1$
+ public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws
TranslatorException {
+ throw new TranslatorException("Unsupported Execution"); //$NON-NLS-1$
}
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException
{
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException
{
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException
{
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException
{
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
@Override
Modified: trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -26,6 +26,6 @@
public interface MetadataProvider {
- void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory)
throws ConnectorException;
+ void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory)
throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -37,8 +37,8 @@
* Get the output parameter values. Results should place the return parameter
* first if it is present, then the IN/OUT and OUT parameters should follow in
* the order they appeared in the command.
- * @throws ConnectorException If an error occurs while retrieving the output value
+ * @throws TranslatorException If an error occurs while retrieving the output value
*/
- List<?> getOutputParameterValues() throws ConnectorException;
+ List<?> getOutputParameterValues() throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -37,9 +37,9 @@
/**
* Retrieves the next row of the resultset.
* @return the next row or null indicating that there are no more results
- * @throws ConnectorException
+ * @throws TranslatorException
* @throws DataNotAvailableException
*/
- List<?> next() throws ConnectorException, DataNotAvailableException;
+ List<?> next() throws TranslatorException, DataNotAvailableException;
}
Copied: trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
(from rev 2121,
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
(rev 0)
+++
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -0,0 +1,394 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.BatchedUpdates;
+import org.teiid.language.SetQuery;
+
+
+/**
+ * Allows a connector to specify the capabilities that a connector
+ * supports.
+ */
+public interface TranslatorCapabilities {
+
+ public enum SupportedJoinCriteria {
+ /**
+ * Indicates that any supported criteria is allowed.
+ */
+ ANY,
+ /**
+ * Indicates that any simple comparison of elements is allowed.
+ */
+ THETA,
+ /**
+ * Indicates that only equality predicates of elements are allowed.
+ */
+ EQUI,
+ /**
+ * Indicates that only equality predicates between
+ * exactly one primary and foreign key is allowed per join.
+ */
+ KEY
+ }
+
+ /**
+ * Support indicates connector can accept queries with SELECT DISTINCT
+ * @since 3.1 SP2
+ */
+ boolean supportsSelectDistinct();
+
+ /**
+ * Support indicates connector can accept expressions other than element
+ * symbols in the SELECT clause. Specific supports for the expression
+ * type are still checked.
+ * @since 6.1.0
+ */
+ boolean supportsSelectExpression();
+
+ /**
+ * Support indicates connector can accept groups with aliases
+ * @since 3.1 SP2
+ */
+ boolean supportsAliasedGroup();
+
+ /**
+ * Get the supported join criteria. A null return value will be treated
+ * as {@link SupportedJoinCriteria#ANY}
+ * @since 6.1.0
+ */
+ SupportedJoinCriteria getSupportedJoinCriteria();
+
+ /**
+ * Support indicates connector can accept inner or cross joins
+ * @since 6.1.0
+ */
+ boolean supportsInnerJoins();
+
+ /**
+ * Support indicates connector can accept self-joins where a
+ * group is joined to itself with aliases. Connector must also support
+ * {@link #supportsAliasedGroup()}.
+ * @since 3.1 SP2
+ */
+ boolean supportsSelfJoins();
+
+ /**
+ * Support indicates connector can accept left outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsOuterJoins();
+
+ /**
+ * Support indicates connector can accept full outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsFullOuterJoins();
+
+ /**
+ * Support indicates connector can accept inline views (subqueries
+ * in the FROM clause).
+ * @since 4.1
+ */
+ boolean supportsInlineViews();
+
+ /**
+ * Support indicates connector accepts criteria of form (element BETWEEN constant AND
constant)
+ * <br>NOT CURRENTLY USED - between is rewritten as compound compare criteria
+ * @since 4.0
+ */
+ boolean supportsBetweenCriteria();
+
+ /**
+ * Support indicates connector accepts criteria of form (element = constant)
+ * @since 3.1 SP2
+ */
+ boolean supportsCompareCriteriaEquals();
+
+ /**
+ * Support indicates connector accepts criteria of form (element <=|>=
constant)
+ * <br>The query engine will may pushdown queries containing < or
> if NOT is also
+ * supported.
+ * @since 3.1 SP2
+ */
+ boolean supportsCompareCriteriaOrdered();
+
+ /**
+ * Support indicates connector accepts criteria of form (element LIKE constant)
+ * @since 3.1 SP2
+ */
+ boolean supportsLikeCriteria();
+
+ /**
+ * Support indicates connector accepts criteria of form (element LIKE constant ESCAPE
char)
+ * @since 3.1 SP2
+ */
+ boolean supportsLikeCriteriaEscapeCharacter();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IN set)
+ * @since 3.1 SP2
+ */
+ boolean supportsInCriteria();
+
+ /**
+ * Support indicates connector accepts IN criteria with a subquery on the right side
+ * @since 4.0
+ */
+ boolean supportsInCriteriaSubquery();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IS NULL)
+ * @since 3.1 SP2
+ */
+ boolean supportsIsNullCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria connected by OR
+ * @since 3.1 SP2
+ */
+ boolean supportsOrCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria NOT
+ * @since 3.1 SP2
+ */
+ boolean supportsNotCriteria();
+
+ /**
+ * Support indicates connector accepts the EXISTS criteria
+ * @since 4.0
+ */
+ boolean supportsExistsCriteria();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use SOME
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaSome();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use ALL
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaAll();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause, including multiple elements
+ * and ascending and descending sorts.
+ * @since 3.1 SP2
+ */
+ boolean supportsOrderBy();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause with columns not from the
select
+ * @since 6.2
+ * @return
+ */
+ boolean supportsOrderByUnrelated();
+
+ /**
+ * Whether the source supports an explicit GROUP BY clause
+ * @since 6.1
+ */
+ boolean supportsGroupBy();
+
+ /**
+ * Whether the source supports the HAVING clause
+ * @since 6.1
+ */
+ boolean supportsHaving();
+
+ /**
+ * Support indicates connector can accept the SUM aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesSum();
+
+ /**
+ * Support indicates connector can accept the AVG aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesAvg();
+
+ /**
+ * Support indicates connector can accept the MIN aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMin();
+
+ /**
+ * Support indicates connector can accept the MAX aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMax();
+
+ /**
+ * Support indicates connector can accept the COUNT aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCount();
+
+ /**
+ * Support indicates connector can accept the COUNT(*) aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCountStar();
+
+ /**
+ * Support indicates connector can accept DISTINCT within aggregate functions
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesDistinct();
+
+ /**
+ * Support indicates connector can accept scalar subqueries in the SELECT, WHERE,
and
+ * HAVING clauses
+ * @since 4.0
+ */
+ boolean supportsScalarSubqueries();
+
+ /**
+ * Support indicates connector can accept correlated subqueries wherever subqueries
+ * are accepted
+ * @since 4.0
+ */
+ boolean supportsCorrelatedSubqueries();
+
+ /**
+ * Support indicates connector can accept queries with non-searched
+ * CASE <expression> WHEN <expression> ... END
+ * <br>NOT CURRENTLY USED - case is pushed down as searched case
+ * @since 4.0
+ */
+ boolean supportsCaseExpressions();
+
+ /**
+ * Support indicates connector can accept queries with searched CASE WHEN
<criteria> ... END
+ * @since 4.0
+ */
+ boolean supportsSearchedCaseExpressions();
+
+ /**
+ * Support indicates that the connector supports the UNION of two queries.
+ * @since 4.2
+ */
+ boolean supportsUnions();
+
+ /**
+ * Support indicates that the connector supports an ORDER BY on a SetQuery.
+ * @since 5.6
+ */
+ boolean supportsSetQueryOrderBy();
+
+ /**
+ * Support indicates that the connector supports the INTERSECT of two queries.
+ * @since 5.6
+ */
+ boolean supportsIntersect();
+
+ /**
+ * Support indicates that the connector supports the EXCEPT of two queries.
+ * @since 5.6
+ */
+ boolean supportsExcept();
+
+ /**
+ * Get list of all supported function names. Arithmetic functions have names like
+ * "+".
+ * @since 3.1 SP3
+ */
+ List<String> getSupportedFunctions();
+
+ /**
+ * Get the integer value representing the number of values allowed in an IN criteria
+ * in the WHERE clause of a query
+ * @since 5.0
+ */
+ int getMaxInCriteriaSize();
+
+ /**
+ * <p>Support indicates that the connector supports functions in GROUP BY, such
as:
+ * <code>SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY
dayofmonth(theDate)</code></p>
+ *
+ * <br>NOT CURRENTLY USED - group by expressions create an inline view for
pushdown
+ * @since 5.0
+ */
+ boolean supportsFunctionsInGroupBy();
+
+ /**
+ * Gets whether the connector can limit the number of rows returned by a query.
+ * @since 5.0 SP1
+ */
+ boolean supportsRowLimit();
+
+ /**
+ * Gets whether the connector supports a SQL clause (similar to the LIMIT with an
offset) that can return
+ * result sets that start in the middle of the resulting rows returned by a query
+ * @since 5.0 SP1
+ */
+ boolean supportsRowOffset();
+
+ /**
+ * The number of groups supported in the from clause. Added for a Sybase limitation.
+ * @since 5.6
+ * @return the number of groups supported in the from clause, or -1 if there is no
limit
+ */
+ int getMaxFromGroups();
+
+ /**
+ * Whether the source prefers to use ANSI style joins.
+ * @since 6.0
+ */
+ boolean useAnsiJoin();
+
+ /**
+ * Whether the source supports queries without criteria.
+ * @since 6.0
+ */
+ boolean requiresCriteria();
+
+ /**
+ * Whether the source supports {@link BatchedUpdates}
+ * @since 6.0
+ */
+ boolean supportsBatchedUpdates();
+
+ /**
+ * Whether the source supports updates with multiple value sets
+ * @since 6.0
+ */
+ boolean supportsBulkUpdate();
+
+ /**
+ * Support indicates that the connector can accept INSERTs with
+ * values specified by an {@link SetQuery}.
+ * @since 6.1
+ */
+ boolean supportsInsertWithQueryExpression();
+
+}
Copied: trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
(from rev 2121,
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
(rev 0)
+++
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import org.teiid.core.TeiidException;
+
+/**
+ * An exception the connector writer can return in case of an
+ * error while using the connector.
+ */
+public class TranslatorException extends TeiidException{
+
+ private static final long serialVersionUID = -5980862789340592219L;
+
+ /**
+ * No-arg constructor required by Externalizable semantics.
+ */
+ public TranslatorException() {
+ super();
+ }
+
+ /**
+ * Construct an instance with the message specified.
+ *
+ * @param message A message describing the exception
+ */
+ public TranslatorException( String message ) {
+ super( message );
+ }
+
+ public TranslatorException( String errorCode, String message ) {
+ super( message, errorCode);
+ }
+
+ public TranslatorException( int errorCode, String message ) {
+ super(message, Integer.toString(errorCode));
+ }
+
+
+ /**
+ * Construct an instance from a message and an exception to chain to this one.
+ *
+ * @param code A code denoting the exception
+ * @param e An exception to nest within this one
+ */
+ public TranslatorException( Throwable e, String message ) {
+ super(e, message);
+ }
+
+ /**
+ * Construct an instance with a linked exception specified.
+ *
+ * @param e An exception to chain to this exception
+ */
+ public TranslatorException( Throwable e ) {
+ super( e );
+ }
+
+}
Property changes on:
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,8 +38,8 @@
* Returns the update counts for the execution.
* @return the update counts corresponding to the command executed
* @throws DataNotAvailableException
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- int[] getUpdateCounts() throws DataNotAvailableException, ConnectorException;
+ int[] getUpdateCounts() throws DataNotAvailableException, TranslatorException;
}
Modified:
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
===================================================================
---
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -41,11 +41,11 @@
import javax.naming.ldap.ExtendedResponse;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
+import javax.resource.ResourceException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.ConnectorException;
@@ -64,19 +64,13 @@
public static final String LDAP_USER_OBJECT_TYPE = "person"; //$NON-NLS-1$
public static final String LDAP_REFERRAL_MODE = "follow"; //$NON-NLS-1$
- public LDAPConnectionImpl(LDAPManagedConnectionFactory config) throws ConnectorException
{
+ public LDAPConnectionImpl(LDAPManagedConnectionFactory config) throws ResourceException
{
this.config = config;
checkProperties();
// Create initial LDAP connection.
- try {
- this.initCtx = initializeLDAPContext();
- } catch(ConnectorException ce) {
- final String msg =
LDAPPlugin.Util.getString("LDAPConnection.contextInitFailed"); //$NON-NLS-1$
- throw new ConnectorException(ce, msg);
- }
-
+ this.initCtx = initializeLDAPContext();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "LDAP Connection has been newly
created."); //$NON-NLS-1$
}
@@ -85,21 +79,21 @@
* a ConnectorException is thrown.
* @param props
*/
- private void checkProperties() throws ConnectorException {
+ private void checkProperties() throws ResourceException {
// LDAP URL
if(this.config.getLdapUrl() == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPConnection.urlPropNotFound"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
// LDAP Admin User DN
if(this.config.getLdapAdminUserDN() == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPConnection.adminUserDNPropNotFound");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
// LDAP Admin User Password
if(this.config.getLdapAdminUserPassword() == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPConnection.adminUserPassPropNotFound");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
}
@@ -109,7 +103,7 @@
* contexts, in order to support the different paging implementations they provide.
* @return the initial LDAP Context
*/
- private InitialLdapContext initializeLDAPContext() throws ConnectorException {
+ private InitialLdapContext initializeLDAPContext() throws ResourceException {
// Create the root context.
InitialLdapContext initContext;
@@ -141,11 +135,8 @@
initContext = new InitialLdapContext(connenv, null);
} catch(NamingException ne){
final String msg =
LDAPPlugin.Util.getString("LDAPConnection.directoryNamingError",ne.getExplanation());
//$NON-NLS-1$
- throw new ConnectorException(msg);
- } catch(Exception e) {
- final String msg =
LDAPPlugin.Util.getString("LDAPConnection.directoryInitError"); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
- }
+ throw new ResourceException(msg);
+ }
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Successfully obtained initial
LDAP context."); //$NON-NLS-1$
return initContext;
}
Modified:
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
---
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -33,7 +33,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.ConnectorException;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.DataPayload;
@@ -74,15 +73,15 @@
PackageVersionHeader pvHeader = partnerFactory.createPackageVersionHeader();
- public SalesforceConnectionImpl(String username, String password, URL url, long
pingInterval, int timeout) throws ConnectorException {
+ public SalesforceConnectionImpl(String username, String password, URL url, long
pingInterval, int timeout) throws ResourceException {
login(username, password, url, timeout);
}
- String getUserName() throws ConnectorException {
+ String getUserName() throws ResourceException {
try {
return sfSoap.getUserInfo(sh).getUserName();
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getMessage());
+ throw new ResourceException(e.getMessage());
}
}
@@ -90,8 +89,7 @@
return sfSoap;
}
- private void login(String username, String password, URL url, int timeout)
- throws ConnectorException {
+ private void login(String username, String password, URL url, int timeout) throws
ResourceException {
if (!isAlive()) {
LoginResult loginResult = null;
sfSoap = null;
@@ -111,11 +109,11 @@
//}
loginResult = sfSoap.login(username, password);
} catch (LoginFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
} catch (InvalidIdFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
}
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for
username " + username);
@@ -133,7 +131,7 @@
try {
sfSoap.getUserInfo(sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getMessage());
+ throw new ResourceException(e.getMessage());
}
}
}
@@ -154,7 +152,7 @@
return result;
}
- public QueryResult query(String queryString, int batchSize, Boolean queryAll) throws
ConnectorException {
+ public QueryResult query(String queryString, int batchSize, Boolean queryAll) throws
ResourceException {
if(batchSize > 2000) {
batchSize = 2000;
@@ -174,42 +172,42 @@
qr = sfSoap.query(queryString, sh);
}
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (MalformedQueryFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidQueryLocatorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
return qr;
}
- public QueryResult queryMore(String queryLocator, int batchSize) throws
ConnectorException {
+ public QueryResult queryMore(String queryLocator, int batchSize) throws
ResourceException {
QueryOptions qo = partnerFactory.createQueryOptions();
qo.setBatchSize(batchSize);
try {
return sfSoap.queryMore(queryLocator, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidQueryLocatorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
}
- public int delete(String[] ids) throws ConnectorException {
+ public int delete(String[] ids) throws ResourceException {
List<DeleteResult> results = null;
try {
results = sfSoap.delete(Arrays.asList(ids), sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
boolean allGood = true;
@@ -232,12 +230,12 @@
}
}
if(!allGood) {
- throw new ConnectorException(errorMessages.toString());
+ throw new ResourceException(errorMessages.toString());
}
return results.size();
}
- public int create(DataPayload data) throws ConnectorException {
+ public int create(DataPayload data) throws ResourceException {
SObject toCreate = new SObject();
toCreate.setType(data.getType());
toCreate.getAny().addAll(data.getMessageElements());
@@ -247,18 +245,18 @@
try {
result = sfSoap.create(objects, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
return analyzeResult(result);
}
- public int update(List<DataPayload> updateDataList) throws ConnectorException {
+ public int update(List<DataPayload> updateDataList) throws ResourceException {
List<SObject> params = new ArrayList<SObject>(updateDataList.size());
for(int i = 0; i < updateDataList.size(); i++) {
DataPayload data = updateDataList.get(i);
@@ -272,34 +270,34 @@
try {
result = sfSoap.update(params, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
}
return analyzeResult(result);
}
- private int analyzeResult(List<SaveResult> results) throws ConnectorException {
+ private int analyzeResult(List<SaveResult> results) throws ResourceException {
for (SaveResult result : results) {
if(!result.isSuccess()) {
- throw new ConnectorException(result.getErrors().get(0).getMessage());
+ throw new ResourceException(result.getErrors().get(0).getMessage());
}
}
return results.size();
}
- public UpdatedResult getUpdated(String objectType, XMLGregorianCalendar startDate,
XMLGregorianCalendar endDate) throws ConnectorException {
+ public UpdatedResult getUpdated(String objectType, XMLGregorianCalendar startDate,
XMLGregorianCalendar endDate) throws ResourceException {
GetUpdatedResult updated;
try {
updated = sfSoap.getUpdated(objectType, startDate, endDate, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
UpdatedResult result = new UpdatedResult();
result.setLatestDateCovered(updated.getLatestDateCovered().toGregorianCalendar());
@@ -308,14 +306,14 @@
}
public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar,
- XMLGregorianCalendar endCalendar) throws ConnectorException {
+ XMLGregorianCalendar endCalendar) throws ResourceException {
GetDeletedResult deleted;
try {
deleted = sfSoap.getDeleted(objectName, startCalendar, endCalendar, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
DeletedResult result = new DeletedResult();
result.setLatestDateCovered(deleted.getLatestDateCovered().toGregorianCalendar());
@@ -335,7 +333,7 @@
return result;
}
- public QueryResult retrieve(String fieldList, String sObjectType, List<String>
ids) throws ConnectorException {
+ public QueryResult retrieve(String fieldList, String sObjectType, List<String>
ids) throws ResourceException {
try {
List<SObject> objects = sfSoap.retrieve(fieldList, sObjectType, ids, sh);
QueryResult result = new QueryResult();
@@ -343,36 +341,36 @@
result.setSize(objects.size());
return result;
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (MalformedQueryFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
}
}
- public DescribeGlobalResult getObjects() throws ConnectorException {
+ public DescribeGlobalResult getObjects() throws ResourceException {
try {
return sfSoap.describeGlobal(sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- ConnectorException ce = new ConnectorException(e.getCause().getMessage());
+ ResourceException ce = new ResourceException(e.getCause().getMessage());
ce.initCause(e.getCause());
throw ce;
}
}
- public DescribeSObjectResult getObjectMetaData(String objectName) throws
ConnectorException {
+ public DescribeSObjectResult getObjectMetaData(String objectName) throws
ResourceException {
try {
return sfSoap.describeSObject(objectName, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
}
Modified:
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
===================================================================
---
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
@WebServiceClient(name = "SforceService", wsdlLocation =
SforceService.PARTNER_WSDL,targetNamespace = "urn:partner.soap.sforce.com")
public class SforceService extends Service {
- private static final String PARTNER_WSDL = "partner_17.wsdl";
//$NON-NLS-1$
+ public static final String PARTNER_WSDL = "partner_17.wsdl"; //$NON-NLS-1$
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new
QName("urn:partner.soap.sforce.com", "SforceService"); //$NON-NLS-1$
//$NON-NLS-2$
public final static QName Soap = new QName("urn:partner.soap.sforce.com",
"Soap");//$NON-NLS-1$ //$NON-NLS-2$
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import org.teiid.language.*;
import org.teiid.language.visitor.HierarchyVisitor;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -34,7 +34,7 @@
public class TickerCollectorVisitor extends HierarchyVisitor {
private Set tickers = new HashSet();
- private ConnectorException exception;
+ private TranslatorException exception;
/**
*
@@ -51,7 +51,7 @@
return this.tickers;
}
- public ConnectorException getException() {
+ public TranslatorException getException() {
return this.exception;
}
@@ -82,16 +82,16 @@
String ticker = (String) literal.getValue();
this.tickers.add(ticker.toUpperCase());
} else {
- this.exception = new
ConnectorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_type",
literal.getType().getName())); //$NON-NLS-1$
+ this.exception = new
TranslatorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_type",
literal.getType().getName())); //$NON-NLS-1$
}
} else {
- this.exception = new
ConnectorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_expression",
expr)); //$NON-NLS-1$
+ this.exception = new
TranslatorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_expression",
expr)); //$NON-NLS-1$
}
}
- public static Set getTickers(Condition crit) throws ConnectorException {
+ public static Set getTickers(Condition crit) throws TranslatorException {
TickerCollectorVisitor visitor = new TickerCollectorVisitor();
crit.acceptVisitor(visitor);
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
@@ -85,7 +85,7 @@
* @see
com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Log our command
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Yahoo executing command:
" + command); //$NON-NLS-1$
@@ -99,13 +99,13 @@
this.neededColumns = getNeededColumns(query.getDerivedColumns(), this.metadata);
}
- static String translateIntoUrl(Select query) throws ConnectorException {
+ static String translateIntoUrl(Select query) throws TranslatorException {
StringBuffer url = new StringBuffer();
url.append(YahooPlugin.Util.getString("YahooExecution.URL_BEGIN"));
//$NON-NLS-1$
Set tickers = getTickers(query);
if(tickers.size() == 0) {
- throw new
ConnectorException(YahooPlugin.Util.getString("YahooExecution.No_tickers"));
//$NON-NLS-1$
+ throw new
TranslatorException(YahooPlugin.Util.getString("YahooExecution.No_tickers"));
//$NON-NLS-1$
}
String urlAppendChar =
YahooPlugin.Util.getString("YahooExecution.URL_APPEND_CHAR"); //$NON-NLS-1$
Iterator tickerIter = tickers.iterator();
@@ -122,10 +122,10 @@
/**
* @return
*/
- static Set getTickers(Select query) throws ConnectorException {
+ static Set getTickers(Select query) throws TranslatorException {
Condition crit = query.getWhere();
if(crit == null) {
- throw new
ConnectorException(YahooPlugin.Util.getString("YahooExecution.Must_have_criteria"));
//$NON-NLS-1$
+ throw new
TranslatorException(YahooPlugin.Util.getString("YahooExecution.Must_have_criteria"));
//$NON-NLS-1$
}
return TickerCollectorVisitor.getTickers(crit);
}
@@ -134,7 +134,7 @@
* @param yahooUrl
* @return
*/
- protected List executeUrl(String yahooUrl) throws ConnectorException {
+ protected List executeUrl(String yahooUrl) throws TranslatorException {
List rows = new ArrayList();
InputStreamReader inSR = null;
BufferedReader buffReader = null;
@@ -166,9 +166,9 @@
inSR.close();
} catch(MalformedURLException mue){
- throw new ConnectorException(mue, mue.getMessage());
+ throw new TranslatorException(mue, mue.getMessage());
} catch(IOException e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new TranslatorException(e, e.getMessage());
} finally {
buffReader = null;
inSR = null;
@@ -235,7 +235,7 @@
* @param select
* @return
*/
- static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata
metadata) throws ConnectorException {
+ static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata
metadata) throws TranslatorException {
int[] cols = new int[select.size()];
Iterator iter = select.iterator();
for(int i=0; iter.hasNext(); i++) {
@@ -245,7 +245,7 @@
Column element = ((ColumnReference)expr).getMetadataObject();
cols[i] = element.getPosition();
} else {
- throw new
ConnectorException(YahooPlugin.Util.getString("YahooExecution.Invalid_select_symbol",
expr)); //$NON-NLS-1$
+ throw new
TranslatorException(YahooPlugin.Util.getString("YahooExecution.Invalid_select_symbol",
expr)); //$NON-NLS-1$
}
}
@@ -253,7 +253,7 @@
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (returnIndex < results.size()) {
List row = (List) results.get(returnIndex++);
return projectRow(row, neededColumns);
@@ -281,7 +281,7 @@
* @see com.metamatrix.data.Execution#close()
*/
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
// nothing to do
}
@@ -289,7 +289,7 @@
* @see com.metamatrix.data.Execution#cancel()
*/
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
}
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
@@ -38,12 +38,12 @@
public static final int YAHOO_MAX_SET_SIZE = 100;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
}
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new YahooExecution((Select)command, metadata);
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -110,7 +110,7 @@
// Methods
//
===========================================================================================================================
- protected TranslatedCommand translateCommand(Command command) throws
ConnectorException {
+ protected TranslatedCommand translateCommand(Command command) throws
TranslatorException {
TranslatedCommand translatedCommand = new TranslatedCommand(context,
this.executionFactory);
translatedCommand.translateCommand(command);
@@ -124,7 +124,7 @@
/*
* @see com.metamatrix.data.Execution#close()
*/
- public synchronized void close() throws ConnectorException {
+ public synchronized void close() throws TranslatorException {
try {
if (statement != null) {
statement.close();
@@ -133,14 +133,14 @@
connection.close();
}
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
/*
* @see com.metamatrix.data.Execution#cancel()
*/
- public synchronized void cancel() throws ConnectorException {
+ public synchronized void cancel() throws TranslatorException {
// if both the DBMS and driver support aborting an SQL
try {
if (statement != null) {
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -25,10 +25,10 @@
import java.sql.SQLException;
import java.util.Arrays;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
-public class JDBCExecutionException extends ConnectorException {
+public class JDBCExecutionException extends TranslatorException {
private static final long serialVersionUID = 1758087499488916573L;
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -60,7 +60,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -147,7 +147,7 @@
boolean initialConnection = true;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
String timeZone = getDatabaseTimeZone();
@@ -212,7 +212,7 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -220,13 +220,13 @@
afterConnectionCreation(conn);
return new JDBCQueryExecution(command, conn, executionContext, this);
} catch(SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -234,13 +234,13 @@
afterConnectionCreation(conn);
return new JDBCProcedureExecution(command, conn, executionContext, this);
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public UpdateExecution createUpdateExecution(Command command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -249,12 +249,12 @@
afterConnectionCreation(conn);
return new JDBCUpdateExecution(command, conn, executionContext, this);
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws TranslatorException {
try {
Connection conn = null;
try {
@@ -270,7 +270,7 @@
}
}
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -44,7 +44,7 @@
import org.teiid.metadata.Table;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.ProcedureParameter.Type;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TypeFacility;
@@ -88,7 +88,7 @@
private String quoteString;
public void getConnectorMetadata(Connection conn, MetadataFactory metadataFactory)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
DatabaseMetaData metadata = conn.getMetaData();
quoteString = metadata.getIdentifierQuoteString();
@@ -126,7 +126,7 @@
}
private void getProcedures(MetadataFactory metadataFactory,
- DatabaseMetaData metadata) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing procedures");
//$NON-NLS-1$
ResultSet procedures = metadata.getProcedures(catalog, schemaPattern,
procedureNamePattern);
while (procedures.next()) {
@@ -183,7 +183,7 @@
}
private Map<String, TableInfo> getTables(MetadataFactory metadataFactory,
- DatabaseMetaData metadata) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing tables");
//$NON-NLS-1$
ResultSet tables = metadata.getTables(catalog, schemaPattern, tableNamePattern,
tableTypes);
Map<String, TableInfo> tableMap = new HashMap<String, TableInfo>();
@@ -208,7 +208,7 @@
private void getColumns(MetadataFactory metadataFactory,
DatabaseMetaData metadata, Map<String, TableInfo> tableMap)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing columns");
//$NON-NLS-1$
ResultSet columns = metadata.getColumns(catalog, schemaPattern, tableNamePattern,
null);
int rsColumns = columns.getMetaData().getColumnCount();
@@ -254,7 +254,7 @@
private void getPrimaryKeys(MetadataFactory metadataFactory,
DatabaseMetaData metadata, Map<String, TableInfo> tableMap)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing primary keys");
//$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet pks = metadata.getPrimaryKeys(tableInfo.catalog, tableInfo.schema,
tableInfo.name);
@@ -282,7 +282,7 @@
}
private void getForeignKeys(MetadataFactory metadataFactory,
- DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException,
ConnectorException {
+ DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException,
TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing foreign keys");
//$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet fks = metadata.getImportedKeys(tableInfo.catalog, tableInfo.schema,
tableInfo.name);
@@ -309,7 +309,7 @@
String fullTableName = getFullyQualifiedName(tableCatalog, tableSchema, tableName);
pkTable = tableMap.get(fullTableName);
if (pkTable == null) {
- throw new
ConnectorException(JDBCPlugin.Util.getString("JDBCMetadataProcessor.cannot_find_primary",
fullTableName)); //$NON-NLS-1$
+ throw new
TranslatorException(JDBCPlugin.Util.getString("JDBCMetadataProcessor.cannot_find_primary",
fullTableName)); //$NON-NLS-1$
}
fkName = fks.getString(12);
if (fkName == null) {
@@ -325,7 +325,7 @@
}
private void getIndexes(MetadataFactory metadataFactory,
- DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException,
ConnectorException {
+ DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException,
TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing index info");
//$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet indexInfo = metadata.getIndexInfo(tableInfo.catalog, tableInfo.schema,
tableInfo.name, false, importApproximateIndexes);
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.Argument;
import org.teiid.language.Call;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ProcedureExecution;
@@ -52,7 +52,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
Call procedure = (Call)command;
columnDataTypes = procedure.getResultSetColumnTypes();
@@ -67,13 +67,13 @@
this.results = this.executionFactory.executeStoredProcedure(cstmt,
translatedComm, procedure.getReturnType());
addStatementWarnings();
}catch(SQLException e){
- throw new ConnectorException(e,
JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql));
//$NON-NLS-1$
+ throw new TranslatorException(e,
JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql));
//$NON-NLS-1$
}
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
if (results == null) {
return null;
}
@@ -81,7 +81,7 @@
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
try {
Call proc = (Call)this.command;
List<Object> result = new ArrayList<Object>();
@@ -102,7 +102,7 @@
}
return result;
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
@@ -63,7 +63,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// get column types
columnDataTypes = ((QueryExpression)command).getColumnTypes();
@@ -88,7 +88,7 @@
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
try {
if (results.next()) {
// New row for result set
@@ -103,7 +103,7 @@
return vals;
}
} catch (SQLException e) {
- throw new ConnectorException(e,
+ throw new TranslatorException(e,
JDBCPlugin.Util.getString("JDBCTranslator.Unexpected_exception_translating_results___8",
e.getMessage())); //$NON-NLS-1$
}
@@ -113,7 +113,7 @@
/**
* @see org.teiid.translator.jdbc.JDBCBaseExecution#close()
*/
- public synchronized void close() throws ConnectorException {
+ public synchronized void close() throws TranslatorException {
// first we would need to close the result set here then we can close
// the statement, using the base class.
if (results != null) {
@@ -121,7 +121,7 @@
results.close();
results = null;
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
super.close();
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.BatchedUpdates;
import org.teiid.language.Command;
import org.teiid.language.Literal;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.UpdateExecution;
@@ -61,7 +61,7 @@
//
===========================================================================================================================
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
if (command instanceof BatchedUpdates) {
result = execute(((BatchedUpdates)command));
} else {
@@ -76,7 +76,7 @@
* @see
com.metamatrix.data.api.BatchedUpdatesExecution#execute(org.teiid.language.Command[])
* @since 4.2
*/
- public int[] execute(BatchedUpdates batchedCommand) throws ConnectorException {
+ public int[] execute(BatchedUpdates batchedCommand) throws TranslatorException {
boolean succeeded = false;
boolean commitType = getAutoCommit(null);
@@ -140,7 +140,7 @@
private void executeBatch(int commandCount,
int[] results,
- List<TranslatedCommand> commands) throws
ConnectorException {
+ List<TranslatedCommand> commands) throws
TranslatorException {
try {
int[] batchResults = statement.executeBatch();
addStatementWarnings();
@@ -155,10 +155,10 @@
/**
* @param translatedComm
- * @throws ConnectorException
+ * @throws TranslatorException
* @since 4.3
*/
- private int[] executeTranslatedCommand(TranslatedCommand translatedComm) throws
ConnectorException {
+ private int[] executeTranslatedCommand(TranslatedCommand translatedComm) throws
TranslatorException {
// create statement or PreparedStatement and execute
String sql = translatedComm.getSql();
boolean commitType = false;
@@ -209,9 +209,9 @@
/**
* @param command
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private boolean getAutoCommit(TranslatedCommand tCommand) throws ConnectorException
{
+ private boolean getAutoCommit(TranslatedCommand tCommand) throws TranslatorException
{
if (this.context.isTransactional()) {
return false;
}
@@ -227,10 +227,10 @@
*
* @param exceptionOccurred
* @param command
- * @throws ConnectorException
+ * @throws TranslatorException
*/
private void restoreAutoCommit(boolean exceptionOccurred,
- TranslatedCommand tCommand) throws ConnectorException
{
+ TranslatedCommand tCommand) throws TranslatorException
{
try {
if (exceptionOccurred) {
connection.rollback();
@@ -249,7 +249,7 @@
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return result;
}
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.teiid.language.Command;
import org.teiid.language.Literal;
import org.teiid.language.visitor.CollectorVisitor;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.TypeFacility;
@@ -62,9 +62,9 @@
* be called right after the constructor; afterward, all of the getter methods
* can be called to retrieve results.
* @param command ICommand to be translated
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public void translateCommand(Command command) throws ConnectorException {
+ public void translateCommand(Command command) throws TranslatorException {
SQLConversionVisitor sqlConversionVisitor =
executionFactory.getSQLConversionVisitor();
sqlConversionVisitor.setExecutionContext(context);
if (executionFactory.usePreparedStatements() || hasBindValue(command)) {
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.language.Literal;
import org.teiid.language.Comparison.Operator;
import org.teiid.language.Join.JoinType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
@@ -66,7 +66,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new
AliasModifier("chr")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new
AliasModifier("day")); //$NON-NLS-1$
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.jdbc.EscapeSyntaxModifier;
@@ -47,7 +47,7 @@
private String version = TEN_1;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
//additional derby functions
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new
EscapeSyntaxModifier());
@@ -176,7 +176,6 @@
/**
* Derby supports only SearchedCaseExpression, not CaseExpression.
- * @see org.teiid.translator.ConnectorCapabilities#supportsCaseExpressions()
* @since 5.0
*/
@Override
@@ -186,7 +185,6 @@
/**
* Derby supports only left and right outer joins.
- * @see org.teiid.translator.ConnectorCapabilities#supportsFullOuterJoins()
* @since 5.0
*/
@Override
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.AliasModifier;
import org.teiid.translator.jdbc.ConvertModifier;
@@ -41,7 +41,7 @@
public class H2ExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.PARSETIMESTAMP, new
AliasModifier("parsedatetime")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.FORMATTIMESTAMP, new
AliasModifier("formatdatetime")); //$NON-NLS-1$
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.ConvertModifier;
import org.teiid.translator.jdbc.FunctionModifier;
@@ -37,7 +37,7 @@
public class HsqlExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true,
getLanguageFactory()));
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new
AddDiffModifier(false, getLanguageFactory()));
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.ConvertModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
@@ -38,7 +38,7 @@
public class InformixExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CONVERT, new ConvertModifier());
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -27,14 +27,14 @@
import java.util.List;
import org.teiid.language.Function;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.FunctionModifier;
public class MySQL5ExecutionFactory extends MySQLExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new FunctionModifier() {
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.language.Function;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
import org.teiid.translator.jdbc.ConvertModifier;
@@ -63,7 +63,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.BITAND, new
BitFunctionModifier("&", getLanguageFactory())); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.BITNOT, new
BitFunctionModifier("~", getLanguageFactory())); //$NON-NLS-1$
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -53,7 +53,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
@@ -83,7 +83,7 @@
public final static String ROWNUM = "ROWNUM"; //$NON-NLS-1$
public final static String SEQUENCE = ":SEQUENCE="; //$NON-NLS-1$
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new
AliasModifier("chr")); //$NON-NLS-1$
@@ -182,7 +182,7 @@
registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
}
- public void handleInsertSequences(Insert insert) throws ConnectorException {
+ public void handleInsertSequences(Insert insert) throws TranslatorException {
/*
* If a missing auto_increment column is modeled with name in source indicating
that an Oracle Sequence
* then pull the Sequence name out of the name in source of the column.
@@ -224,7 +224,7 @@
int delimiterIndex = sequence.indexOf(Tokens.DOT);
if (delimiterIndex == -1) {
- throw new ConnectorException("Invalid name in source sequence format.
Expected <element name>" + SEQUENCE + "<sequence name>.<sequence
value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException("Invalid name in source sequence format.
Expected <element name>" + SEQUENCE + "<sequence name>.<sequence
value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
}
String sequenceGroupName = sequence.substring(0, delimiterIndex);
String sequenceElementName = sequence.substring(delimiterIndex + 1);
@@ -241,7 +241,7 @@
if (command instanceof Insert) {
try {
handleInsertSequences((Insert)command);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
}
@@ -514,10 +514,6 @@
return true;
}
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
@Override
public boolean supportsFunctionsInGroupBy() {
return true;
@@ -531,17 +527,11 @@
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
@Override
public boolean supportsExcept() {
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
@Override
public boolean supportsIntersect() {
return true;
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.language.Limit;
import org.teiid.language.Literal;
import org.teiid.language.SQLReservedWords;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TranslatorProperty;
@@ -67,7 +67,7 @@
private String version = EIGHT_0;
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
//TODO: all of the functions (except for convert) can be handled through just the
escape syntax
super.start();
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -33,7 +33,7 @@
import org.teiid.language.Limit;
import org.teiid.language.OrderBy;
import org.teiid.language.SetQuery;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.AliasModifier;
@@ -48,7 +48,7 @@
*/
public class SybaseExecutionFactory extends JDBCExecutionFactory {
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.MOD, new
ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -35,10 +35,7 @@
*/
public class TeiidExecutionFactory extends JDBCExecutionFactory {
- /**
- * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
- * @since 4.3
- */
+ @Override
public List<String> getSupportedFunctions() {
List<String> supportedFunctions = new ArrayList<String>();
supportedFunctions.addAll(super.getSupportedFunctions());
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -44,9 +44,7 @@
return false;
}
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
+ @Override
public List getSupportedFunctions() {
List supportedFunctions = new ArrayList();
supportedFunctions.addAll(super.getSupportedFunctions());
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -50,7 +50,7 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput,
JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput,
JDBCExecutionFactory translator) throws TranslatorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, input);
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Expression;
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
/**
@@ -96,7 +96,7 @@
JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.LOCATE, new
LocateFunctionModifier(getLanguageFactory(), locateFunctionName, parameterOrder));
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.Expression;
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
/**
@@ -89,7 +89,7 @@
JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.MOD, new
ModFunctionModifier(modFunctionName, getLanguageFactory()));
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.dqp.internal.datamgr.language.TstLanguageBridgeFactory;
import org.teiid.language.LanguageObject;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
/**
@@ -53,7 +53,7 @@
private static JDBCExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new JDBCExecutionFactory();
TRANSLATOR.setTrimStrings(true);
TRANSLATOR.start();
@@ -75,14 +75,14 @@
try {
trans.start();
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
}
public static final RuntimeMetadata metadata =
TstLanguageBridgeFactory.metadataFactory;
- private String getStringWithContext(LanguageObject obj) throws ConnectorException {
+ private String getStringWithContext(LanguageObject obj) throws TranslatorException {
JDBCExecutionFactory env = new JDBCExecutionFactory();
env.setUseCommentsInSourceQuery(true);
env.start();
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Command;
import org.teiid.query.function.metadata.FunctionMetadataReader;
import org.teiid.query.function.metadata.FunctionMethod;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -70,18 +70,18 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput,
JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput,
JDBCExecutionFactory translator) throws TranslatorException {
helpTestVisitor(vdb,null,input, expectedOutput, translator);
}
- public static void helpTestVisitor(String vdb, String udf, String input, String
expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String udf, String input, String
expectedOutput, JDBCExecutionFactory translator) throws TranslatorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, udf, input);
helpTestVisitor(expectedOutput, translator, obj);
}
- public static void helpTestVisitor(String expectedOutput, JDBCExecutionFactory
translator, Command obj) throws ConnectorException {
+ public static void helpTestVisitor(String expectedOutput, JDBCExecutionFactory
translator, Command obj) throws TranslatorException {
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class),
translator);
tc.translateCommand(obj);
assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
//$NON-NLS-1$
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -45,12 +45,12 @@
try {
TRANSLATOR = new AccessExecutionFactory();
TRANSLATOR.start();
- } catch(ConnectorException e) {
+ } catch(TranslatorException e) {
e.printStackTrace();
}
}
- public void helpTestVisitor(String input, String expectedOutput) throws
ConnectorException {
+ public void helpTestVisitor(String input, String expectedOutput) throws
TranslatorException {
// Convert from sql to objects
Command obj =
FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(input);
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.mockito.Mockito;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -44,7 +44,7 @@
private static DB2ExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new DB2ExecutionFactory();
TRANSLATOR.start();
}
@@ -53,7 +53,7 @@
return UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb";
//$NON-NLS-1$
}
- public void helpTestVisitor(TranslationUtility util, String input, String
expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(TranslationUtility util, String input, String
expectedOutput) throws TranslatorException {
// Convert from sql to objects
Command obj = util.parseCommand(input);
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -35,7 +35,7 @@
private static DerbyExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new DerbyExecutionFactory();
TRANSLATOR.start();
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
public class TestH2Translator {
@@ -32,7 +32,7 @@
private static H2ExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new H2ExecutionFactory();
TRANSLATOR.start();
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
/**
@@ -33,7 +33,7 @@
private static MySQL5ExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new MySQL5ExecutionFactory();
TRANSLATOR.start();
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
/**
@@ -34,7 +34,7 @@
private static MySQLExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new MySQLExecutionFactory();
TRANSLATOR.start();
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -43,7 +43,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -62,7 +62,7 @@
TRANSLATOR.start();
}
- private void helpTestVisitor(String input, String expectedOutput) throws
ConnectorException {
+ private void helpTestVisitor(String input, String expectedOutput) throws
TranslatorException {
helpTestVisitor(getOracleSpecificMetadata(), input, EMPTY_CONTEXT, null,
expectedOutput);
}
@@ -490,15 +490,15 @@
return UnitTestUtil.getTestDataPath() + "/PartsSupplierOracle.vdb";
//$NON-NLS-1$
}
- private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String
expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String
expectedOutput) throws TranslatorException {
helpTestVisitor(vdb, input, EMPTY_CONTEXT, dbmsTimeZone, expectedOutput, false);
}
- private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String
expectedOutput, boolean correctNaming) throws ConnectorException {
+ private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String
expectedOutput, boolean correctNaming) throws TranslatorException {
helpTestVisitor(vdb, input, EMPTY_CONTEXT, dbmsTimeZone, expectedOutput,
correctNaming);
}
- private void helpTestVisitor(String vdb, String input, ExecutionContext context,
String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws
ConnectorException {
+ private void helpTestVisitor(String vdb, String input, ExecutionContext context,
String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws
TranslatorException {
// Convert from sql to objects
TranslationUtility util = new TranslationUtility(vdb);
Command obj = util.parseCommand(input, correctNaming, true);
@@ -506,16 +506,16 @@
}
/** Helper method takes a QueryMetadataInterface impl instead of a VDB filename
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private void helpTestVisitor(QueryMetadataInterface metadata, String input,
ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws
ConnectorException {
+ private void helpTestVisitor(QueryMetadataInterface metadata, String input,
ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws
TranslatorException {
// Convert from sql to objects
CommandBuilder commandBuilder = new CommandBuilder(metadata);
Command obj = commandBuilder.getCommand(input);
this.helpTestVisitor(obj, context, dbmsTimeZone, expectedOutput);
}
- private void helpTestVisitor(Command obj, ExecutionContext context, String
dbmsTimeZone, String expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(Command obj, ExecutionContext context, String
dbmsTimeZone, String expectedOutput) throws TranslatorException {
OracleExecutionFactory translator = new OracleExecutionFactory();
if (dbmsTimeZone != null) {
translator.setDatabaseTimeZone(dbmsTimeZone);
@@ -717,7 +717,7 @@
return new TransformationMetadata(null, store, null, null);
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
TranslatorException {
helpTestVisitor(vdb, input, null, expectedOutput);
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
public class TestPostgreSQLTranslator {
@@ -44,7 +44,7 @@
return TranslationHelper.BQT_VDB;
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
TranslatorException {
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, TRANSLATOR);
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.metadata.TransformationMetadata;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -48,7 +48,7 @@
private static SQLServerExecutionFactory trans = new SQLServerExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
@@ -60,7 +60,7 @@
return TranslationHelper.BQT_VDB;
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws
TranslatorException {
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.language.LanguageFactory;
import org.teiid.language.Literal;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.SQLConversionVisitor;
@@ -48,7 +48,7 @@
private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
===================================================================
---
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -42,7 +42,7 @@
private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
@@ -61,7 +61,7 @@
TranslatedCommand tc = new
TranslatedCommand(Mockito.mock(ExecutionContext.class), trans);
try {
tc.translateCommand(obj);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -74,7 +74,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
@@ -112,7 +112,7 @@
// ou=people,dc=company,dc=com?SUBTREE_SCOPE?RESTRICT
// TODO - change method for calling RESTRICT to also specify
// object class name (RESTRICT=inetOrgPerson)
- public LDAPSearchDetails translateSQLQueryToLDAPSearch(Select query) throws
ConnectorException {
+ public LDAPSearchDetails translateSQLQueryToLDAPSearch(Select query) throws
TranslatorException {
// Parse SELECT symbols.
// The columns will be translated into LDAP attributes of interest.
ArrayList attributeList = getAttributesFromSelectSymbols(query);
@@ -124,12 +124,12 @@
Iterator itr = fromList.listIterator();
if(!itr.hasNext()) {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.noTablesInFromError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
TableReference fItm = (TableReference)itr.next();
if(itr.hasNext()) {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.multiItemsInFromError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
String contextName = getContextNameFromFromItem(fItm);
int searchScope = getSearchScopeFromFromItem(fItm);
@@ -174,7 +174,7 @@
sd.printDetailsToLog();
} catch (NamingException nme) {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.searchDetailsLoggingError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return sd;
@@ -186,7 +186,7 @@
* @param orderBy the OrderBy clause
* @param the array of SortKeys
*/
- private SortKey[] getSortKeysFromOrderByClause(OrderBy orderBy) throws
ConnectorException {
+ private SortKey[] getSortKeysFromOrderByClause(OrderBy orderBy) throws
TranslatorException {
SortKey[] sortKeys = null;
if(orderBy != null) {
List orderItems = orderBy.getSortSpecifications();
@@ -227,7 +227,7 @@
*/
// GHH 20080409 - changed to fall back on new connector property
// for default base DN if available
- private String getContextNameFromFromItem(TableReference fromItem) throws
ConnectorException {
+ private String getContextNameFromFromItem(TableReference fromItem) throws
TranslatorException {
String nameInSource;
String contextName;
@@ -251,14 +251,14 @@
}
} else {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// if the context name is not specified either in Name in Source
// or in the default connector properties it'll be either
// null or an empty string
if(contextName == null || contextName.equals("")) { //$NON-NLS-1$
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.baseContextNameError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return contextName;
@@ -268,7 +268,7 @@
// from item's NameInSource, and if true return name (not NameInSource)
// of from item as the objectClass name on to which the query should
// be restricted
- private String getRestrictToNamedClass(TableReference fromItem) throws
ConnectorException {
+ private String getRestrictToNamedClass(TableReference fromItem) throws
TranslatorException {
String nameInSource;
String namedClass = null;
if(fromItem instanceof NamedTable) {
@@ -300,12 +300,12 @@
}
} else {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return namedClass;
}
- private int getSearchScopeFromFromItem(TableReference fromItem) throws
ConnectorException {
+ private int getSearchScopeFromFromItem(TableReference fromItem) throws
TranslatorException {
String searchScopeString = ""; //$NON-NLS-1$
int searchScope = LDAPConnectorConstants.ldapDefaultSearchScope;
// TODO: Re-use the getExpressionString method if possible, rather than
@@ -341,7 +341,7 @@
}
} else {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return searchScope;
}
@@ -351,7 +351,7 @@
* @param op operator to evaluate
* @return LDAP-specific string equivalent of the operator
*/
- private String parseCompoundCriteriaOp(AndOr.Operator op) throws ConnectorException {
+ private String parseCompoundCriteriaOp(AndOr.Operator op) throws TranslatorException {
switch(op) {
case AND:
return "&"; //$NON-NLS-1$
@@ -359,7 +359,7 @@
return "|"; //$NON-NLS-1$
default:
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.criteriaNotParsableError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -371,7 +371,7 @@
// GHH 20080326 - found that code to fall back on Name if NameInSource
// was null wasn't working properly, so replaced with tried and true
// code from another custom connector.
- private String getExpressionString(Expression e) throws ConnectorException {
+ private String getExpressionString(Expression e) throws TranslatorException {
String expressionName = null;
// GHH 20080326 - changed around the IElement handling here
// - the rest of this method is unchanged
@@ -397,7 +397,7 @@
}
} catch (ClassNotFoundException cce) {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.timestampClassNotFoundError");
//$NON-NLS-1$
- throw new ConnectorException(cce, msg);
+ throw new TranslatorException(cce, msg);
}
} else {
@@ -411,7 +411,7 @@
LogManager.logError(LogConstants.CTX_CONNECTOR, "Received
ISearchedCaseExpression, but it is not supported. Check capabilties.");
//$NON-NLS-1$
}
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.unsupportedElementError");
//$NON-NLS-1$
- throw new ConnectorException(msg + e.toString());
+ throw new TranslatorException(msg + e.toString());
}
expressionName = escapeReservedChars(expressionName);
return expressionName;
@@ -452,7 +452,7 @@
* @param List list to hold each pre-fix character of the search filter.
* @return list list that can be traversed in order to construct the search filter.
*/
- private List<String> getSearchFilterFromWhereClause(Condition criteria,
List<String> filterList) throws ConnectorException {
+ private List<String> getSearchFilterFromWhereClause(Condition criteria,
List<String> filterList) throws TranslatorException {
if(criteria == null) {
filterList.add("(objectClass=*)"); //$NON-NLS-1$
}
@@ -483,7 +483,7 @@
String rhsString = getExpressionString(rhs);
if(lhsString == null || rhsString == null) {
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.missingNISError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
addCompareCriteriaToList(filterList, op, lhsString, rhsString);
@@ -532,7 +532,7 @@
* Process a list of right-hand side IN expresssions and add the corresponding LDAP
filter
* clause string to the given filterList.
*/
- private void processInCriteriaList(List filterList, List rhsList, Expression lhs) throws
ConnectorException {
+ private void processInCriteriaList(List filterList, List rhsList, Expression lhs) throws
TranslatorException {
if(rhsList.size() == 0) {
return;
}
@@ -553,7 +553,7 @@
* @param lhs left hand side expression
* @param rhs right hand side expression
*/
- private void addCompareCriteriaToList(List filterList, Comparison.Operator op, String
lhs, String rhs) throws ConnectorException {
+ private void addCompareCriteriaToList(List filterList, Comparison.Operator op, String
lhs, String rhs) throws TranslatorException {
// Push the comparison statement into the list, e.g.:
// (sn=Mike)
// !(empNum>=100)
@@ -575,7 +575,7 @@
break;
default:
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.criteriaNotSupportedError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
filterList.add(rhs);
@@ -590,7 +590,7 @@
// GHH 20080326 - found that code to fall back on Name if NameInSource
// was null wasn't working properly, so replaced with tried and true
// code from another custom connector.
- public String getNameFromElement(Column e) throws ConnectorException {
+ public String getNameFromElement(Column e) throws TranslatorException {
String ldapAttributeName = null;
ldapAttributeName = e.getNameInSource();
if (ldapAttributeName == null || ldapAttributeName.equals("")) {
//$NON-NLS-1$
@@ -605,7 +605,7 @@
* @param query the supplied Query
* @return the list of SELECT elements
*/
- private ArrayList getElementsFromSelectSymbols(Select query) throws ConnectorException
{
+ private ArrayList getElementsFromSelectSymbols(Select query) throws TranslatorException
{
ArrayList selectElementList = new ArrayList();
Iterator selectSymbolItr = query.getDerivedColumns().iterator();
@@ -621,7 +621,7 @@
* @param query the supplied Query
* @return the list of attributes
*/
- private ArrayList getAttributesFromSelectSymbols(Select query) throws ConnectorException
{
+ private ArrayList getAttributesFromSelectSymbols(Select query) throws
TranslatorException {
ArrayList ldapAttributeList = new ArrayList();
Iterator selectSymbolItr = query.getDerivedColumns().iterator();
@@ -645,7 +645,7 @@
* @param symbol Input ISelectSymbol
* @return Element returned metadata runtime Element
*/
- private Column getElementFromSymbol(DerivedColumn symbol) throws ConnectorException
{
+ private Column getElementFromSymbol(DerivedColumn symbol) throws TranslatorException
{
ColumnReference expr = (ColumnReference) symbol.getExpression();
return expr.getMetadataObject();
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
@@ -77,23 +77,23 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression
command,ExecutionContext executionContext, RuntimeMetadata metadata, Object
connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
return new LDAPSyncQueryExecution((Select)command, this,
(LdapContext)cf.getConnection());
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public UpdateExecution createUpdateExecution(Command command,ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
return new LDAPUpdateExecution(command, (LdapContext)cf.getConnection());
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -97,7 +97,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ResultSetExecution;
@@ -136,7 +136,7 @@
* @param maxBatchSize the max batch size.
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Parse the IQuery, and translate it into an appropriate LDAP search.
this.parser = new IQueryToLdapSearchParser(this.executionFactory);
searchDetails = parser.translateSQLQueryToLDAPSearch(query);
@@ -152,7 +152,7 @@
/**
* Set the standard request controls
*/
- private void setStandardRequestControls() throws ConnectorException {
+ private void setStandardRequestControls() throws TranslatorException {
Control[] sortCtrl = new Control[1];
SortKey[] keys = searchDetails.getSortKeys();
if (keys != null) {
@@ -163,10 +163,10 @@
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError") +
//$NON-NLS-1$
" : "+ne.getExplanation(); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
} catch(IOException e) {
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError");
//$NON-NLS-1$
- throw new ConnectorException(e,msg);
+ throw new TranslatorException(e,msg);
}
}
}
@@ -176,7 +176,7 @@
* sets the context to something appropriate for the search that is about to occur.
*
*/
- private void createSearchContext() throws ConnectorException {
+ private void createSearchContext() throws TranslatorException {
try {
ldapCtx = (LdapContext) this.ldapConnection.lookup(searchDetails.getContextName());
} catch (NamingException ne) {
@@ -185,7 +185,7 @@
+ searchDetails.getContextName());
}
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.createContextError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -193,7 +193,7 @@
/**
* Set the search controls
*/
- private SearchControls setSearchControls() throws ConnectorException {
+ private SearchControls setSearchControls() throws TranslatorException {
SearchControls ctrls = new SearchControls();
//ArrayList modelAttrList = searchDetails.getAttributeList();
ArrayList modelAttrList = searchDetails.getElementList();
@@ -221,7 +221,7 @@
* Perform the LDAP search against the subcontext, using the filter and
* search controls appropriate to the query and model metadata.
*/
- private void executeSearch(SearchControls ctrls) throws ConnectorException {
+ private void executeSearch(SearchControls ctrls) throws TranslatorException {
String ctxName = searchDetails.getContextName();
String filter = searchDetails.getContextFilter();
if (ctxName == null || filter == null || ctrls == null) {
@@ -233,12 +233,12 @@
LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to
search context " //$NON-NLS-1$
+ ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError");
//$NON-NLS-1$
- throw new ConnectorException(msg + " : " + ne.getExplanation());
//$NON-NLS-1$
+ throw new TranslatorException(msg + " : " + ne.getExplanation());
//$NON-NLS-1$
} catch(Exception e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to
search context " //$NON-NLS-1$
+ ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError");
//$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -248,7 +248,7 @@
// but less so when closing context, since it is safe to call close
// on contexts multiple times
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
close();
}
@@ -259,7 +259,7 @@
// but less so when closing context, since it is safe to call close
// on contexts multiple times
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
if (searchEnumeration != null) {
try {
searchEnumeration.close();
@@ -286,7 +286,7 @@
// it from being used again.
// GHH 20080326 - also added return of explanation for generic
// NamingException
- public List next() throws ConnectorException {
+ public List next() throws TranslatorException {
try {
// The search has been executed, so process up to one batch of
// results.
@@ -306,7 +306,7 @@
final String msg = "Ldap error while processing next batch of results: " +
ne.getExplanation(); //$NON-NLS-1$
LogManager.logError(LogConstants.CTX_CONNECTOR, msg); // GHH 20080326 - changed to
output explanation from LDAP server
searchEnumeration = null; // GHH 20080326 - NamingEnumertion's are no longer good
after an exception so toss it
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -317,7 +317,7 @@
*/
// GHH 20080326 - added fetching of DN of result, for directories that
// do not include it as an attribute
- private List getRow(SearchResult result) throws ConnectorException {
+ private List getRow(SearchResult result) throws TranslatorException {
Attributes attrs = result.getAttributes();
String resultDN = result.getNameInNamespace(); // added GHH 20080326
ArrayList attributeList = searchDetails.getElementList();
@@ -345,14 +345,14 @@
// value for that column in the result
// GHH 20080326 - added handling of ClassCastException when non-string
// attribute is returned
- private void addResultToRow(Column modelElement, String resultDistinguishedName,
Attributes attrs, List row) throws ConnectorException {
+ private void addResultToRow(Column modelElement, String resultDistinguishedName,
Attributes attrs, List row) throws TranslatorException {
String strResult;
String modelAttrName = parser.getNameFromElement(modelElement);
Class modelAttrClass = modelElement.getJavaType();
if(modelAttrName == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.nullAttrError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Attribute resultAttr = attrs.get(modelAttrName);
@@ -386,7 +386,7 @@
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.attrValueFetchError",modelAttrName);
//$NON-NLS-1$
LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg+" :
"+ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg+" : "+ne.getExplanation()); //$NON-NLS-1$
+ throw new TranslatorException(msg+" : "+ne.getExplanation()); //$NON-NLS-1$
}
// GHH 20080326 - if attribute is not a string, just
@@ -419,7 +419,7 @@
row.add(null);
}
} catch(NumberFormatException nfe) {
- throw new ConnectorException(nfe, "Element " + modelAttrName + " is
typed as Integer, " + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException(nfe, "Element " + modelAttrName + " is
typed as Integer, " + //$NON-NLS-1$ //$NON-NLS-2$
"but it's value (" + strResult + ") cannot be converted from
string " + //$NON-NLS-1$ //$NON-NLS-2$
"to Integer. Please change type to String, or modify the data.");
//$NON-NLS-1$
}
@@ -446,7 +446,7 @@
row.add(null);
}
} catch(ParseException pe) {
- throw new ConnectorException(pe, "Timestamp could not be parsed. Please check
to ensure the " //$NON-NLS-1$
+ throw new TranslatorException(pe, "Timestamp could not be parsed. Please check
to ensure the " //$NON-NLS-1$
+ " Format field for attribute " //$NON-NLS-1$
+ modelAttrName + " is configured using SimpleDateFormat conventions.");
//$NON-NLS-1$
}
@@ -455,13 +455,13 @@
// Specifically, add support for byte arrays, since that's actually supported
// in the underlying data source.
} else {
- throw new ConnectorException("Base type " + modelAttrClass.toString()
//$NON-NLS-1$
+ throw new TranslatorException("Base type " + modelAttrClass.toString()
//$NON-NLS-1$
+ " is not supported in the LDAP connector. " //$NON-NLS-1$
+ " Please modify the base model to use a supported type.");
//$NON-NLS-1$
}
} catch(ClassNotFoundException cne) {
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.supportedClassNotFoundError");
//$NON-NLS-1$
- throw new ConnectorException(cne, msg);
+ throw new TranslatorException(cne, msg);
}
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.UpdateExecution;
@@ -93,7 +93,7 @@
* here for the sake of efficiency.
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// first make a copy of the initial LDAP context we got from
// the connection. The actual update-class operation will use
// this copy. This will enable the close and cancel methods
@@ -104,7 +104,7 @@
ldapCtx = (LdapContext)this.ldapConnection.lookup(""); //$NON-NLS-1$
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.createContextError",ne.getExplanation());
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (command instanceof Update) {
@@ -118,13 +118,13 @@
}
else {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.incorrectCommandError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {1};
}
@@ -154,7 +154,7 @@
// TODO - maybe automatically specify objectClass based off of
// Name/NameInSource RESTRICT property settings, like with read support
private void executeInsert()
- throws ConnectorException {
+ throws TranslatorException {
List<ColumnReference> insertElementList = ((Insert)command).getColumns();
List<Expression> insertValueList =
((ExpressionValueSource)((Insert)command).getValueSource()).getValues();
@@ -181,11 +181,11 @@
insertValue = ((Literal)insertValueList.get(i)).getValue();
if (insertValue == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNNullError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (!(insertValue instanceof java.lang.String)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNTypeError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
distinguishedName = (String)insertValue;
}
@@ -202,7 +202,7 @@
// the LDAP add operation, so throw an exception
if (distinguishedName == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.noInsertSourceNameDNError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// just try to create a new LDAP entry using the DN and
// attributes specified in the INSERT operation. If it isn't
@@ -212,10 +212,10 @@
ldapCtx.createSubcontext(distinguishedName, insertAttrs);
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.insertFailed",distinguishedName,ne.getExplanation());
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
} catch (Exception e) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.insertFailedUnexpected",distinguishedName);
//$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -230,7 +230,7 @@
// even if the named entry doesn't exist (as long as its parent does
// exist).
private void executeDelete()
- throws ConnectorException {
+ throws TranslatorException {
Condition criteria = ((Delete)command).getWhere();
@@ -249,12 +249,12 @@
ldapCtx.destroySubcontext(distinguishedName);
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.deleteFailed",distinguishedName,ne.getExplanation());
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
// don't remember why I added this generic catch of Exception,
// but it does no harm...
} catch (Exception e) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.deleteFailedUnexpected",distinguishedName);
//$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -274,7 +274,7 @@
// The update criteria must include only an equals comparison
// on the "DN" column ("WHERE DN='cn=John
Doe,ou=people,dc=company,dc=com'")
private void executeUpdate()
- throws ConnectorException {
+ throws TranslatorException {
List<SetClause> updateList = ((Update)command).getChanges();
Condition criteria = ((Update)command).getWhere();
@@ -314,7 +314,7 @@
rightExpr = setClause.getValue();
if (!(rightExpr instanceof Literal)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.valueNotLiteralError",nameLeftElement);
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
valueRightExpr = ((Literal)rightExpr).getValue();
// add in the modification as a replacement - meaning
@@ -335,12 +335,12 @@
ldapCtx.modifyAttributes(distinguishedName, updateMods);
} catch (NamingException ne) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailed",distinguishedName,ne.getExplanation());
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
// don't remember why I added this generic catch of Exception,
// but it does no harm...
} catch (Exception e) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailedUnexpected",distinguishedName);
//$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -352,40 +352,40 @@
// since there is no way to specify this granularity of criteria
// right now in the connector capabilities
private String getDNFromCriteria(Condition criteria)
- throws ConnectorException {
+ throws TranslatorException {
if (criteria == null) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaEmptyError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (!(criteria instanceof Comparison)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaNotSimpleError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Comparison compareCriteria = (Comparison)criteria;
if (compareCriteria.getOperator() != Operator.EQ) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaNotEqualsError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Expression leftExpr = compareCriteria.getLeftExpression();
if (!(leftExpr instanceof ColumnReference)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaLHSNotElementError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// call utility method to get NameInSource/Name for element
String nameLeftExpr = getNameFromElement((ColumnReference)leftExpr);
if (!(nameLeftExpr.toUpperCase().equals("DN"))) { //$NON-NLS-1$
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaSrcColumnError",nameLeftExpr);
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Expression rightExpr = compareCriteria.getRightExpression();
if (!(rightExpr instanceof Literal)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaRHSNotLiteralError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Object valueRightExpr = ((Literal)rightExpr).getValue();
if (!(valueRightExpr instanceof java.lang.String)) {
final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaRHSNotStringError");
//$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return (String)valueRightExpr;
}
@@ -416,7 +416,7 @@
// calling close on already closed context is safe per
// javax.naming.Context javadoc so we won't worry about this also
// happening in our close method
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
close();
}
@@ -425,7 +425,7 @@
// calling close on already closed context is safe per
// javax.naming.Context javadoc so we won't worry about this also
// happening in our close method
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
try {
if(ldapCtx != null) {
ldapCtx.close();
Modified:
trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
===================================================================
---
trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -48,7 +48,7 @@
import org.teiid.metadata.Column.SearchType;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ldap.IQueryToLdapSearchParser;
import org.teiid.translator.ldap.LDAPExecutionFactory;
import org.teiid.translator.ldap.LDAPSearchDetails;
@@ -254,7 +254,7 @@
expectedCountLimit, expectedSearchScope, expectedSortKeys);
}
- private LDAPSearchDetails helpGetSearchDetails(String queryString) throws
ConnectorException {
+ private LDAPSearchDetails helpGetSearchDetails(String queryString) throws
TranslatorException {
QueryMetadataInterface metadata = exampleLdap();
RuntimeMetadata rm = new RuntimeMetadataImpl(metadata);
Modified:
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
===================================================================
---
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -40,7 +40,7 @@
import org.teiid.language.Argument.Direction;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.TypeFacility;
@@ -71,7 +71,7 @@
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
// Wait on first batch if necessary
if(this.config.getWaitTime() > 0 && !waited) {
// Wait a random amount of time up to waitTime milliseconds
@@ -102,13 +102,13 @@
* @see
com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Log our command
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Loopback executing command:
" + command); //$NON-NLS-1$
if(this.config.isThrowError()) {
- throw new ConnectorException("Failing because Error=true");
//$NON-NLS-1$
+ throw new TranslatorException("Failing because Error=true");
//$NON-NLS-1$
}
this.rowsNeeded = this.config.getRowCount();
@@ -127,12 +127,12 @@
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int [] {0};
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
Call proc = (Call)this.command;
int count = proc.getReturnType() != null ? 1:0;
for (Argument param : proc.getArguments()) {
@@ -147,7 +147,7 @@
* @see com.metamatrix.data.Execution#close()
*/
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
// nothing to do
}
@@ -155,7 +155,7 @@
* @see com.metamatrix.data.Execution#cancel()
*/
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
Modified:
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
---
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.teiid.language.Command;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
@@ -80,13 +80,13 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
}
@Override
public Execution createExecution(Command command, ExecutionContext executionContext,
RuntimeMetadata metadata, Object connectionfactory)
- throws ConnectorException {
+ throws TranslatorException {
return new LoopbackExecution(command, this);
}
Modified:
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
===================================================================
---
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import junit.framework.TestCase;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.loopback.LoopbackExecution;
import org.teiid.translator.loopback.LoopbackExecutionFactory;
@@ -49,11 +49,11 @@
return config;
}
- public void helpTestQuery(String sql, TranslationUtility metadata, Object[][]
expectedResults) throws ConnectorException {
+ public void helpTestQuery(String sql, TranslationUtility metadata, Object[][]
expectedResults) throws TranslatorException {
helpTestQuery(sql, metadata, 0, 1, expectedResults);
}
- public void helpTestQuery(String sql, TranslationUtility metadata, int waitTime, int
rowCount, Object[][] expectedResults) throws ConnectorException {
+ public void helpTestQuery(String sql, TranslationUtility metadata, int waitTime, int
rowCount, Object[][] expectedResults) throws TranslatorException {
ConnectorHost host = new ConnectorHost(exampleProperties(waitTime, rowCount), null,
metadata);
List actualResults = host.executeCommand(sql);
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -6,6 +6,8 @@
import java.util.List;
import java.util.Map;
+import javax.resource.ResourceException;
+
import org.teiid.core.types.DataTypeManager;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -15,7 +17,7 @@
import org.teiid.metadata.Table;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import com.sforce.soap.partner.ChildRelationship;
import com.sforce.soap.partner.DescribeGlobalResult;
@@ -64,16 +66,20 @@
this.connectorEnv = env;
}
- public void processMetadata() throws ConnectorException {
- DescribeGlobalResult globalResult = connection.getObjects();
- List<DescribeGlobalSObjectResult> objects = globalResult.getSobjects();
- for (DescribeGlobalSObjectResult object : objects) {
- addTable(object);
- }
- addRelationships();
+ public void processMetadata() throws TranslatorException {
+ try {
+ DescribeGlobalResult globalResult = connection.getObjects();
+ List<DescribeGlobalSObjectResult> objects = globalResult.getSobjects();
+ for (DescribeGlobalSObjectResult object : objects) {
+ addTable(object);
+ }
+ addRelationships();
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
- private void addRelationships() throws ConnectorException {
+ private void addRelationships() throws TranslatorException {
for (Iterator<Relationship> iterator = relationships.iterator();
iterator.hasNext();) {
Relationship relationship = iterator.next();
if (!this.connectorEnv.isModelAuditFields() &&
isAuditField(relationship.getForeignKeyField())) {
@@ -125,8 +131,14 @@
return result;
}
- private void addTable(DescribeGlobalSObjectResult object) throws ConnectorException {
- DescribeSObjectResult objectMetadata = connection.getObjectMetaData(object.getName());
+ private void addTable(DescribeGlobalSObjectResult object) throws TranslatorException {
+ DescribeSObjectResult objectMetadata = null;
+ try {
+ objectMetadata = connection.getObjectMetaData(object.getName());
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
+
String name = NameUtil.normalizeName(objectMetadata.getName());
Table table = metadataFactory.addTable(name);
@@ -166,7 +178,7 @@
}
}
- private void addColumns(DescribeSObjectResult objectMetadata, Table table) throws
ConnectorException {
+ private void addColumns(DescribeSObjectResult objectMetadata, Table table) throws
TranslatorException {
List<Field> fields = objectMetadata.getFields();
for (Field field : fields) {
String normalizedName = NameUtil.normalizeName(field.getName());
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -32,7 +32,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -70,7 +70,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Started"); //$NON-NLS-1$
}
@@ -78,12 +78,12 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new QueryExecutionImpl(command, (SalesforceConnection)connectionFactory,
metadata, executionContext);
}
@Override
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory) throws
ConnectorException {
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory) throws
TranslatorException {
UpdateExecution result = null;
if(command instanceof org.teiid.language.Delete) {
result = new DeleteExecutionImpl(command, (SalesforceConnection)connectionFactory,
metadata, executionContext);
@@ -98,11 +98,11 @@
@Override
public ProcedureExecution createProcedureExecution(Call command,ExecutionContext
executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new ProcedureExecutionParentImpl(command,
(SalesforceConnection)connectionFactory, metadata, executionContext);
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws TranslatorException {
MetadataProcessor processor = new
MetadataProcessor((SalesforceConnection)connectionFactory,metadataFactory, this);
processor.processMetadata();
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -23,9 +23,9 @@
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.XMLGregorianCalendar;
-import org.teiid.translator.ConnectorException;
import org.teiid.translator.salesforce.execution.DataPayload;
import org.teiid.translator.salesforce.execution.DeletedResult;
import org.teiid.translator.salesforce.execution.UpdatedResult;
@@ -36,25 +36,25 @@
public interface SalesforceConnection {
- public QueryResult query(String queryString, int maxBatchSize, Boolean queryAll) throws
ConnectorException;
+ public QueryResult query(String queryString, int maxBatchSize, Boolean queryAll) throws
ResourceException;
- public QueryResult queryMore(String queryLocator, int batchSize) throws
ConnectorException;
+ public QueryResult queryMore(String queryLocator, int batchSize) throws
ResourceException;
public boolean isAlive();
- public int delete(String[] ids) throws ConnectorException ;
+ public int delete(String[] ids) throws ResourceException ;
- public int create(DataPayload data) throws ConnectorException;
+ public int create(DataPayload data) throws ResourceException;
- public int update(List<DataPayload> updateDataList) throws ConnectorException;
+ public int update(List<DataPayload> updateDataList) throws ResourceException;
- public UpdatedResult getUpdated(String objectName, XMLGregorianCalendar startCalendar,
XMLGregorianCalendar endCalendar) throws ConnectorException;
+ public UpdatedResult getUpdated(String objectName, XMLGregorianCalendar startCalendar,
XMLGregorianCalendar endCalendar) throws ResourceException;
- public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar,
XMLGregorianCalendar endCalendar) throws ConnectorException;
+ public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar,
XMLGregorianCalendar endCalendar) throws ResourceException;
- public QueryResult retrieve(String fieldList, String sObjectType, List<String>
ids) throws ConnectorException;
+ public QueryResult retrieve(String fieldList, String sObjectType, List<String>
ids) throws ResourceException;
- public DescribeGlobalResult getObjects() throws ConnectorException;
+ public DescribeGlobalResult getObjects() throws ResourceException;
- public DescribeSObjectResult getObjectMetaData(String objectName) throws
ConnectorException;
+ public DescribeSObjectResult getObjectMetaData(String objectName) throws
ResourceException;
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class Util {
@@ -50,9 +50,9 @@
return result.toString();
}
- public static void validateQueryLength(StringBuffer query) throws ConnectorException {
+ public static void validateQueryLength(StringBuffer query) throws TranslatorException {
if(query.length() >= 10000) {
- throw new
ConnectorException(Messages.getString("Util.query.exceeds.max.length"));
+ throw new
TranslatorException(Messages.getString("Util.query.exceeds.max.length"));
}
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -23,11 +23,13 @@
import java.util.ArrayList;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Comparison;
import org.teiid.language.Condition;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.UpdateExecution;
@@ -63,16 +65,16 @@
}
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {result};
}
@@ -84,7 +86,7 @@
return connection;
}
- String[] getIDs(Condition criteria, IQueryProvidingVisitor visitor) throws
ConnectorException {
+ String[] getIDs(Condition criteria, IQueryProvidingVisitor visitor) throws
TranslatorException {
String[] Ids = null;
if (visitor.hasOnlyIDCriteria()) {
try {
@@ -97,16 +99,20 @@
}
} else if (visitor.hasCriteria()) {
- String query = visitor.getQuery();
- QueryResult results = getConnection().query(query, context.getBatchSize(),
Boolean.FALSE);
- if (null != results && results.getSize() > 0) {
- ArrayList<String> idList = new ArrayList<String>(results
- .getRecords().size());
- for (int i = 0; i < results.getRecords().size(); i++) {
- SObject sObject = results.getRecords().get(i);
- idList.add(sObject.getId());
+ try {
+ String query = visitor.getQuery();
+ QueryResult results = getConnection().query(query, context.getBatchSize(),
Boolean.FALSE);
+ if (null != results && results.getSize() > 0) {
+ ArrayList<String> idList = new ArrayList<String>(results
+ .getRecords().size());
+ for (int i = 0; i < results.getRecords().size(); i++) {
+ SObject sObject = results.getRecords().get(i);
+ idList.add(sObject.getId());
+ }
+ Ids = idList.toArray(new String[0]);
}
- Ids = idList.toArray(new String[0]);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
return Ids;
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -21,10 +21,12 @@
*/
package org.teiid.translator.salesforce.execution;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Delete;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.visitors.DeleteVisitor;
@@ -40,12 +42,16 @@
}
@Override
- public void execute() throws ConnectorException {
- DeleteVisitor dVisitor = new DeleteVisitor(getMetadata());
- dVisitor.visitNode(command);
- String[] Ids = getIDs(((Delete)command).getWhere(), dVisitor);
- if(null != Ids && Ids.length > 0) {
- result = getConnection().delete(Ids);
+ public void execute() throws TranslatorException {
+ try {
+ DeleteVisitor dVisitor = new DeleteVisitor(getMetadata());
+ dVisitor.visitNode(command);
+ String[] Ids = getIDs(((Delete)command).getWhere(), dVisitor);
+ if(null != Ids && Ids.length > 0) {
+ result = getConnection().delete(Ids);
+ }
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -5,13 +5,14 @@
import java.util.GregorianCalendar;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.teiid.language.Argument;
import org.teiid.language.Call;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
*
@@ -37,12 +38,12 @@
DatatypeFactory factory;
public GetDeletedExecutionImpl(
- ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
this.parent = procedureExecutionParent;
try {
factory = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
- throw new ConnectorException(e.getMessage());
+ throw new TranslatorException(e.getMessage());
}
}
@@ -59,26 +60,30 @@
}
@Override
- public void execute(ProcedureExecutionParent procedureExecutionParent) throws
ConnectorException {
- Call command = parent.getCommand();
- List<Argument> params = command.getArguments();
-
- Argument object = params.get(OBJECT);
- String objectName = (String) object.getArgumentValue().getValue();
-
- Argument start = params.get(STARTDATE);
- Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
- GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(startTime);
- XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- Argument end = params.get(ENDDATE);
- Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
- tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(endTime);
- XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- deletedResult = parent.getConnection().getDeleted(objectName, startCalendar,
endCalendar);
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws
TranslatorException {
+ try {
+ Call command = parent.getCommand();
+ List<Argument> params = command.getArguments();
+
+ Argument object = params.get(OBJECT);
+ String objectName = (String) object.getArgumentValue().getValue();
+
+ Argument start = params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
+ GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(startTime);
+ XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ Argument end = params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
+ tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(endTime);
+ XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ deletedResult = parent.getConnection().getDeleted(objectName, startCalendar,
endCalendar);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
@SuppressWarnings("unchecked")
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -6,13 +6,14 @@
import java.util.GregorianCalendar;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.teiid.language.Argument;
import org.teiid.language.Call;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
*
@@ -35,12 +36,12 @@
DatatypeFactory factory;
public GetUpdatedExecutionImpl(
- ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
this.parent = procedureExecutionParent;
try {
factory = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
- throw new ConnectorException(e.getMessage());
+ throw new TranslatorException(e.getMessage());
}
}
@@ -55,26 +56,30 @@
}
@Override
- public void execute(ProcedureExecutionParent procedureExecutionParent) throws
ConnectorException {
- Call command = parent.getCommand();
- List<Argument> params = command.getArguments();
-
- Argument object = params.get(OBJECT);
- String objectName = (String) object.getArgumentValue().getValue();
-
- Argument start = params.get(STARTDATE);
- Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
- GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(startTime);
- XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- Argument end = params.get(ENDDATE);
- Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
- tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(endTime);
- XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- updatedResult = parent.getConnection().getUpdated(objectName, startCalendar,
endCalendar);
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws
TranslatorException {
+ try {
+ Call command = parent.getCommand();
+ List<Argument> params = command.getArguments();
+
+ Argument object = params.get(OBJECT);
+ String objectName = (String) object.getArgumentValue().getValue();
+
+ Argument start = params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
+ GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(startTime);
+ XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ Argument end = params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
+ tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(endTime);
+ XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ updatedResult = parent.getConnection().getUpdated(objectName, startCalendar,
endCalendar);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
@Override
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -22,10 +22,12 @@
package org.teiid.translator.salesforce.execution;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Insert;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.visitors.InsertVisitor;
@@ -40,12 +42,16 @@
}
@Override
- public void execute() throws ConnectorException {
- InsertVisitor visitor = new InsertVisitor(getMetadata());
- visitor.visit((Insert)command);
- DataPayload data = new DataPayload();
- data.setType(visitor.getTableName());
- data.setMessageElements(visitor.getMessageElements());
- result = getConnection().create(data);
+ public void execute() throws TranslatorException {
+ try {
+ InsertVisitor visitor = new InsertVisitor(getMetadata());
+ visitor.visit((Insert)command);
+ DataPayload data = new DataPayload();
+ data.setType(visitor.getTableName());
+ data.setMessageElements(visitor.getMessageElements());
+ result = getConnection().create(data);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -4,7 +4,7 @@
import org.teiid.language.Call;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ProcedureExecution;
@@ -28,27 +28,27 @@
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
return execution.getOutputParameterValues();
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
return execution.next();
}
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
execution.cancel();
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
execution.close();
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
if(getCommand().getProcedureName().endsWith("getUpdated")) {
execution = new GetUpdatedExecutionImpl(this);
execution.execute(this);
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
+import javax.resource.ResourceException;
import javax.xml.namespace.QName;
import org.teiid.language.AggregateFunction;
@@ -44,7 +45,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
@@ -102,43 +103,47 @@
partIdentifier = context.getPartIdentifier();
}
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR,
Messages.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR,
Messages.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
}
@Override
- public void execute() throws ConnectorException {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Incoming
Query: " + query.toString()); //$NON-NLS-1$
- List<TableReference> from = ((Select)query).getFrom();
- String finalQuery;
- if(from.get(0) instanceof Join) {
- visitor = new JoinQueryVisitor(metadata);
- visitor.visitNode(query);
- finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
-
- results = connection.query(finalQuery, this.context.getBatchSize(),
visitor.getQueryAll());
- } else {
- visitor = new SelectVisitor(metadata);
- visitor.visitNode(query);
- if(visitor.canRetrieve()) {
- results = connection.retrieve(visitor.getRetrieveFieldList(),
- visitor.getTableName(), visitor.getIdInCriteria());
- } else {
+ public void execute() throws TranslatorException {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Incoming
Query: " + query.toString()); //$NON-NLS-1$
+ List<TableReference> from = ((Select)query).getFrom();
+ String finalQuery;
+ if(from.get(0) instanceof Join) {
+ visitor = new JoinQueryVisitor(metadata);
+ visitor.visitNode(query);
finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
+
results = connection.query(finalQuery, this.context.getBatchSize(),
visitor.getQueryAll());
+ } else {
+ visitor = new SelectVisitor(metadata);
+ visitor.visitNode(query);
+ if(visitor.canRetrieve()) {
+ results = connection.retrieve(visitor.getRetrieveFieldList(),
+ visitor.getTableName(), visitor.getIdInCriteria());
+ } else {
+ finalQuery = visitor.getQuery().trim();
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing
Query: " + finalQuery); //$NON-NLS-1$
+ results = connection.query(finalQuery, this.context.getBatchSize(),
visitor.getQueryAll());
+ }
}
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
@SuppressWarnings("unchecked")
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
List<?> result;
if (query.getProjectedQuery().getDerivedColumns().get(0)
.getExpression() instanceof AggregateFunction) {
@@ -151,7 +156,7 @@
return result;
}
- private List<Object> getRow(QueryResult result) throws ConnectorException {
+ private List<Object> getRow(QueryResult result) throws TranslatorException {
List<Object> row;
if(null == resultBatch) {
loadBatch();
@@ -171,22 +176,26 @@
return row;
}
- private void loadBatch() throws ConnectorException {
- if(null != resultBatch) { // if we have an old batch, then we have to get new results
- results = connection.queryMore(results.getQueryLocator(), context.getBatchSize());
- }
- resultBatch = new ArrayList<List<Object>>();
-
- for(int resultIndex = 0; resultIndex < results.getSize(); resultIndex++) {
- SObject sObject = results.getRecords().get(resultIndex);
- List<Object[]> result = getObjectData(sObject);
- for(Iterator<Object[]> i = result.iterator(); i.hasNext(); ) {
- resultBatch.add(Arrays.asList(i.next()));
+ private void loadBatch() throws TranslatorException {
+ try {
+ if(null != resultBatch) { // if we have an old batch, then we have to get new
results
+ results = connection.queryMore(results.getQueryLocator(), context.getBatchSize());
}
+ resultBatch = new ArrayList<List<Object>>();
+
+ for(int resultIndex = 0; resultIndex < results.getSize(); resultIndex++) {
+ SObject sObject = results.getRecords().get(resultIndex);
+ List<Object[]> result = getObjectData(sObject);
+ for(Iterator<Object[]> i = result.iterator(); i.hasNext(); ) {
+ resultBatch.add(Arrays.asList(i.next()));
+ }
+ }
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
- private List<Object[]> getObjectData(SObject sObject) throws ConnectorException
{
+ private List<Object[]> getObjectData(SObject sObject) throws TranslatorException
{
List<Object> topFields = sObject.getAny();
logAndMapFields(sObject.getType(), topFields);
List<Object[]> result = new ArrayList<Object[]>();
@@ -212,7 +221,7 @@
}
private List<Object[]> extractDataFromFields(SObject sObject,
- List<Object> fields, List<Object[]> result) throws ConnectorException {
+ List<Object> fields, List<Object[]> result) throws TranslatorException {
Map<String,Integer> fieldToIndexMap =
sObjectToResponseField.get(sObject.getType());
for (int j = 0; j < visitor.getSelectSymbolCount(); j++) {
Column element = visitor.getSelectSymbolMetadata(j);
@@ -225,7 +234,7 @@
if(parent instanceof Table) {
table = (Table)parent;
} else {
- throw new ConnectorException("Could not resolve Table for column " +
element.getName()); //$NON-NLS-1$
+ throw new TranslatorException("Could not resolve Table for column " +
element.getName()); //$NON-NLS-1$
}
}
if(table.getNameInSource().equals(sObject.getType())) {
@@ -236,7 +245,7 @@
if (element.getNameInSource().equalsIgnoreCase("id")) { //$NON-NLS-1$
setValueInColumn(j, sObject.getId(), result);
} else {
- throw new
ConnectorException("SalesforceQueryExecutionImpl.missing.field"+
element.getNameInSource()); //$NON-NLS-1$
+ throw new
TranslatorException("SalesforceQueryExecutionImpl.missing.field"+
element.getNameInSource()); //$NON-NLS-1$
}
} else {
Object cell;
@@ -263,10 +272,10 @@
/**
* Load the map of response field names to index.
* @param fields
- * @throws ConnectorException
+ * @throws TranslatorException
*/
private void logAndMapFields(String sObjectName,
- List<Object> fields) throws ConnectorException {
+ List<Object> fields) throws TranslatorException {
if (!sObjectToResponseField.containsKey(sObjectName)) {
logFields(sObjectName, fields);
Map<String, Integer> responseFieldToIndexMap;
@@ -279,7 +288,7 @@
}
}
- private void logFields(String sObjectName, List<Object> fields) throws
ConnectorException {
+ private void logFields(String sObjectName, List<Object> fields) throws
TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "SalesForce Object Name = "
+ sObjectName); //$NON-NLS-1$
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "FieldCount = " +
fields.size()); //$NON-NLS-1$
for(int i = 0; i < fields.size(); i++) {
@@ -291,9 +300,9 @@
}
@SuppressWarnings("unchecked")
- private Object getCellDatum(Column element, Element elem) throws ConnectorException {
+ private Object getCellDatum(Column element, Element elem) throws TranslatorException {
if(!element.getNameInSource().equals(elem.getLocalName())) {
- throw new ConnectorException("SalesforceQueryExecutionImpl.column.mismatch1"
+ element.getNameInSource() + "SalesforceQueryExecutionImpl.column.mismatch2" +
elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new
TranslatorException("SalesforceQueryExecutionImpl.column.mismatch1" +
element.getNameInSource() + "SalesforceQueryExecutionImpl.column.mismatch2" +
elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
}
String value = elem.getTextContent();
Object result = null;
@@ -336,7 +345,7 @@
Date date = Util.getSalesforceDateTimeFormat().parse(value);
result = new Timestamp(date.getTime());
} catch (ParseException e) {
- throw new ConnectorException(e,
"SalesforceQueryExecutionImpl.datatime.parse" + value); //$NON-NLS-1$
+ throw new TranslatorException(e,
"SalesforceQueryExecutionImpl.datatime.parse" + value); //$NON-NLS-1$
}
}
} else {
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -2,7 +2,7 @@
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface SalesforceProcedureExecution {
@@ -19,6 +19,6 @@
void close();
- void execute(ProcedureExecutionParent procedureExecutionParent) throws
ConnectorException;
+ void execute(ProcedureExecutionParent procedureExecutionParent) throws
TranslatorException;
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
@@ -34,7 +35,7 @@
import org.teiid.language.Update;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.Util;
@@ -54,7 +55,7 @@
@SuppressWarnings("unchecked")
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
UpdateVisitor visitor = new UpdateVisitor(getMetadata());
visitor.visit((Update)command);
String[] Ids = getIDs(((Update)command).getWhere(), visitor);
@@ -78,7 +79,11 @@
updateDataList.add(data);
}
- result = getConnection().update(updateDataList);
+ try {
+ result = getConnection().update(updateDataList);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
}
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -44,7 +44,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.Util;
@@ -75,7 +75,7 @@
protected List<String> criteriaList = new ArrayList<String>();
protected boolean hasCriteria;
protected Map<String, Column> columnElementsByName = new HashMap<String,
Column>();
- protected List<ConnectorException> exceptions = new
ArrayList<ConnectorException>();
+ protected List<TranslatorException> exceptions = new
ArrayList<TranslatorException>();
protected Table table;
boolean onlyIDCriteria;
protected Boolean queryAll = Boolean.FALSE;
@@ -102,7 +102,7 @@
addCompareCriteria(criteriaList, criteria);
boolean isAcceptableID = (Operator.EQ == criteria.getOperator() &&
isIdColumn(criteria.getLeftExpression()));
setHasCriteria(true, isAcceptableID);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@@ -111,15 +111,15 @@
public void visit( Like criteria ) {
try {
if (isIdColumn(criteria.getLeftExpression())) {
- ConnectorException e = new
ConnectorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
+ TranslatorException e = new
TranslatorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
exceptions.add(e);
}
if (isMultiSelectColumn(criteria.getLeftExpression())) {
- ConnectorException e = new ConnectorException(
+ TranslatorException e = new TranslatorException(
Messages.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect"));
exceptions.add(e);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
boolean negated = criteria.isNegated();
@@ -179,7 +179,7 @@
}
}
setHasCriteria(true, isIdColumn(criteria.getLeftExpression()));
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@@ -192,13 +192,13 @@
} else if (functionName.equalsIgnoreCase("excludes")) {
generateMultiSelect(func, EXCLUDES);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
private void generateMultiSelect( Function func,
- String funcName ) throws ConnectorException {
+ String funcName ) throws TranslatorException {
List<Expression> expressions = func.getParameters();
validateFunction(expressions);
Expression columnExpression = expressions.get(0);
@@ -210,7 +210,7 @@
}
private void appendMultiselectIn( Column column,
- In criteria ) throws ConnectorException {
+ In criteria ) throws TranslatorException {
StringBuffer result = new StringBuffer();
result.append(column.getNameInSource()).append(SPACE);
if (criteria.isNegated()) {
@@ -236,15 +236,15 @@
criteriaList.add(result.toString());
}
- private void validateFunction( List<Expression> expressions ) throws
ConnectorException {
+ private void validateFunction( List<Expression> expressions ) throws
TranslatorException {
if (expressions.size() != 2) {
- throw new
ConnectorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
+ throw new
TranslatorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
}
if (!(expressions.get(0) instanceof ColumnReference)) {
- throw new
ConnectorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
+ throw new
TranslatorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
}
if (!(expressions.get(1) instanceof Literal)) {
- throw new
ConnectorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
+ throw new
TranslatorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
}
}
@@ -267,7 +267,7 @@
}
protected void addCompareCriteria( List criteriaList,
- Comparison compCriteria ) throws
ConnectorException {
+ Comparison compCriteria ) throws
TranslatorException {
Expression lExpr = compCriteria.getLeftExpression();
if (lExpr instanceof Function) {
parseFunction((Function)lExpr);
@@ -319,7 +319,7 @@
}
}
- private void appendCriteria( In criteria ) throws ConnectorException {
+ private void appendCriteria( In criteria ) throws TranslatorException {
StringBuffer queryString = new StringBuffer();
Expression leftExp = criteria.getLeftExpression();
if(isIdColumn(leftExp)) {
@@ -347,7 +347,7 @@
criteriaList.add(queryString.toString());
}
- private boolean isTimeColumn( Column column ) throws ConnectorException {
+ private boolean isTimeColumn( Column column ) throws TranslatorException {
boolean result = false;
if (column.getJavaType().equals(java.sql.Timestamp.class) ||
column.getJavaType().equals(java.sql.Time.class)
|| column.getJavaType().equals(java.sql.Date.class)) {
@@ -356,7 +356,7 @@
return result;
}
- protected String getValue( Expression expr ) throws ConnectorException {
+ protected String getValue( Expression expr ) throws TranslatorException {
String result;
if (expr instanceof ColumnReference) {
ColumnReference element = (ColumnReference)expr;
@@ -371,11 +371,11 @@
return result;
}
- protected void loadColumnMetadata( NamedTable group ) throws ConnectorException {
+ protected void loadColumnMetadata( NamedTable group ) throws TranslatorException {
table = group.getMetadataObject();
String supportsQuery = table.getProperties().get("Supports Query");
if (!Boolean.valueOf(supportsQuery)) {
- throw new ConnectorException(table.getNameInSource() + " "
+ throw new TranslatorException(table.getNameInSource() + " "
+
Messages.getString("CriteriaVisitor.query.not.supported"));
}
List<Column> columnIds = table.getColumns();
@@ -393,7 +393,7 @@
}
}
- protected boolean isIdColumn( Expression expression ) throws ConnectorException {
+ protected boolean isIdColumn( Expression expression ) throws TranslatorException {
boolean result = false;
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
@@ -405,7 +405,7 @@
return result;
}
- protected boolean isMultiSelectColumn( Expression expression ) throws
ConnectorException {
+ protected boolean isMultiSelectColumn( Expression expression ) throws
TranslatorException {
boolean result = false;
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
@@ -439,7 +439,7 @@
return this.onlyIDCriteria;
}
- public String getTableName() throws ConnectorException {
+ public String getTableName() throws TranslatorException {
return table.getNameInSource();
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import org.teiid.language.Delete;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class DeleteVisitor extends CriteriaVisitor implements IQueryProvidingVisitor {
@@ -39,7 +39,7 @@
super.visit(delete);
try {
loadColumnMetadata(delete.getTable());
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -50,7 +50,7 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
throw exceptions.get(0);
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -21,7 +21,7 @@
*/
package org.teiid.translator.salesforce.execution.visitors;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface ICriteriaVisitor {
@@ -31,6 +31,6 @@
public boolean hasOnlyIDCriteria();
- public String getTableName() throws ConnectorException;
+ public String getTableName() throws TranslatorException;
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -21,10 +21,10 @@
*/
package org.teiid.translator.salesforce.execution.visitors;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface IQueryProvidingVisitor extends ICriteriaVisitor {
- public String getQuery() throws ConnectorException;
+ public String getQuery() throws TranslatorException;
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Literal;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class InsertVisitor extends CriteriaVisitor {
@@ -57,7 +57,7 @@
List<ColumnReference> columns = insert.getColumns();
List<Expression> values =
((ExpressionValueSource)insert.getValueSource()).getValues();
if(columns.size() != values.size()) {
- throw new ConnectorException("Error: columns.size and values.size are not the
same.");
+ throw new TranslatorException("Error: columns.size and values.size are not the
same.");
}
for(int i = 0; i < columns.size(); i++) {
@@ -80,7 +80,7 @@
elements.add(jbe);
}
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -11,7 +11,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Util;
@@ -55,7 +55,7 @@
loadColumnMetadata((NamedTable) right);
}
super.visit(join);
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
@@ -94,13 +94,13 @@
} else {
super.visit(criteria);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@Override
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (isParentToChildJoin()) {
return super.getQuery();
@@ -133,7 +133,7 @@
return childTable.equals(leftTableInJoin);
}
- protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws
ConnectorException {
+ protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws
TranslatorException {
boolean firstTime = true;
for (DerivedColumn symbol : selectSymbols) {
Expression expression = symbol.getExpression();
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Constants;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.Util;
@@ -61,7 +61,7 @@
public void visit(Select query) {
super.visit(query);
if (query.isDistinct()) {
- exceptions.add(new ConnectorException(
+ exceptions.add(new TranslatorException(
Messages.getString("SelectVisitor.distinct.not.supported")));
}
selectSymbols = query.getDerivedColumns();
@@ -78,7 +78,7 @@
selectSymbolNameToIndex .put(element.getNameInSource(), index);
String nameInSource = element.getNameInSource();
if (null == nameInSource || nameInSource.length() == 0) {
- exceptions.add(new ConnectorException(
+ exceptions.add(new TranslatorException(
"name in source is null or empty for column "
+ symbol.toString()));
continue;
@@ -98,11 +98,11 @@
String supportsQuery = table.getProperties().get(Constants.SUPPORTS_QUERY);
objectSupportsRetrieve =
Boolean.valueOf(table.getProperties().get(Constants.SUPPORTS_RETRIEVE));
if (!Boolean.valueOf(supportsQuery)) {
- throw new ConnectorException(table.getNameInSource() + " "
+ throw new TranslatorException(table.getNameInSource() + " "
+
Messages.getString("CriteriaVisitor.query.not.supported"));
}
loadColumnMetadata(obj);
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -119,9 +119,9 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
- throw ((ConnectorException) exceptions.get(0));
+ throw ((TranslatorException) exceptions.get(0));
}
StringBuffer result = new StringBuffer();
result.append(SELECT).append(SPACE);
@@ -136,7 +136,7 @@
return result.toString();
}
- protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws
ConnectorException {
+ protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws
TranslatorException {
boolean firstTime = true;
for (DerivedColumn symbol : selectSymbols) {
if (!firstTime) {
@@ -156,7 +156,7 @@
if(parent instanceof Table) {
table = (Table)parent;
} else {
- throw new ConnectorException("Could not resolve Table for column " +
element.getName());
+ throw new TranslatorException("Could not resolve Table for column " +
element.getName());
}
}
result.append(table.getNameInSource());
@@ -200,7 +200,7 @@
}
- public String getRetrieveFieldList() throws ConnectorException {
+ public String getRetrieveFieldList() throws TranslatorException {
assertRetrieveValidated();
StringBuffer result = new StringBuffer();
addSelectSymbols(table.getNameInSource(), result);
@@ -208,7 +208,7 @@
}
- public List<String> getIdInCriteria() throws ConnectorException {
+ public List<String> getIdInCriteria() throws TranslatorException {
assertRetrieveValidated();
List<Expression> expressions = this.idInCriteria.getRightExpressions();
List<String> result = new ArrayList<String>(expressions.size());
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -23,7 +23,7 @@
import org.teiid.language.Update;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class UpdateVisitor extends CriteriaVisitor implements IQueryProvidingVisitor {
@@ -39,7 +39,7 @@
visitNode(update.getWhere());
try {
loadColumnMetadata(update.getTable());
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -50,9 +50,9 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
- throw ((ConnectorException) exceptions.get(0));
+ throw ((TranslatorException) exceptions.get(0));
}
StringBuffer result = new StringBuffer();
result.append(SELECT).append(SPACE);
Modified:
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java
===================================================================
---
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -41,7 +41,7 @@
import org.teiid.core.util.StringUtil;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.FileConnection;
@@ -89,11 +89,11 @@
return metadataProps;
}
- private List<BufferedReader> createReaders(String tableName) throws
ConnectorException {
+ private List<BufferedReader> createReaders(String tableName) throws
TranslatorException {
try {
createReaders(this.metadataProps.get(tableName), tableName);
} catch (IOException e) {
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextSynchExecution.Unable_get_Reader", new Object[]
{tableName, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextSynchExecution.Unable_get_Reader", new Object[]
{tableName, e.getMessage() })); //$NON-NLS-1$
}
return readerQueue;
@@ -105,13 +105,13 @@
* @param props Group's metadata properites string
* @return BufferReader Object
*/
- private void createReaders(Properties props, String groupName) throws IOException,
ConnectorException {
+ private void createReaders(Properties props, String groupName) throws IOException,
TranslatorException {
if(readerQueue != null && readerQueue.size() > 0) {
return ;
}
if(props == null) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Error_obtain_properties_for_group",
groupName)); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Error_obtain_properties_for_group",
groupName)); //$NON-NLS-1$
}
String location = props.getProperty(TextDescriptorPropertyNames.LOCATION);
@@ -136,7 +136,7 @@
// get the stream from the connection
addReader(location, urlConn.getInputStream());
} catch (MalformedURLException e) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnection.fileDoesNotExistForGroup",
new Object[] {location, groupName})); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnection.fileDoesNotExistForGroup",
new Object[] {location, groupName})); //$NON-NLS-1$
}
}
@@ -162,9 +162,9 @@
* row HEADER_ROW is used as the row that may contain column
* names.
*
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private String nextLine(String tableName) throws ConnectorException {
+ private String nextLine(String tableName) throws TranslatorException {
if (currentreader == null && readerQueueIndex < readerQueue.size()) {
// reader queue index is advanced only by the nextReader()
// method. Don't do it here.
@@ -227,7 +227,7 @@
else {
Object[] params = new Object[] { line };
String msg =
TextPlugin.Util.getString("TextSynchExecution.Text_has_no_determined_ending_qualifier",
params); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
}
@@ -250,7 +250,7 @@
return line;
}
} catch (Throwable e) {
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new
Object[] { location, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new
Object[] { location, e.getMessage() })); //$NON-NLS-1$
}
// we are done reading..
return null;
@@ -265,7 +265,7 @@
readerQueueIndex++;
}
- public String getHeaderLine(String tableName) throws ConnectorException {
+ public String getHeaderLine(String tableName) throws TranslatorException {
if (this.headerMsg != null) {
return this.headerMsg;
}
@@ -274,7 +274,7 @@
return this.headerMsg;
}
- public String getNextLine(String tableName) throws ConnectorException {
+ public String getNextLine(String tableName) throws TranslatorException {
// make sure the reader are created
createReaders(tableName);
if (this.firstLine != null) {
Modified:
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
===================================================================
---
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -45,7 +45,7 @@
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.FileConnection;
@@ -68,7 +68,7 @@
private String encoding = Charset.defaultCharset().name();
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
initMetaDataProps();
}
@@ -119,18 +119,18 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,
ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
TextConnectionImpl textConn = new TextConnectionImpl(this.metadataProps,
(FileConnection)cf.getConnection(), encoding);
return new TextSynchExecution(this, (Select)command, textConn);
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object
connectionFactory) throws TranslatorException {
for (Map.Entry<String, Properties> entry : metadataProps.entrySet()) {
Properties p = entry.getValue();
String columns = p.getProperty(TextDescriptorPropertyNames.COLUMNS);
@@ -143,7 +143,7 @@
if (types != null) {
typeNames = types.trim().split(","); //$NON-NLS-1$
if (typeNames.length != columnNames.length) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnector.column_mismatch",
entry.getKey())); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnector.column_mismatch",
entry.getKey())); //$NON-NLS-1$
}
}
Table table =
metadataFactory.addTable(entry.getKey().substring(entry.getKey().indexOf('.') +
1));
@@ -156,10 +156,10 @@
}
}
- private void initMetaDataProps() throws ConnectorException {
+ private void initMetaDataProps() throws TranslatorException {
// Verify required items
if (descriptorFile == null || descriptorFile.trim().length() == 0) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_name_is_not_specified._2"));
//$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_name_is_not_specified._2"));
//$NON-NLS-1$
}
BufferedReader br = null;
try {
@@ -185,7 +185,7 @@
}
} catch (IOException e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e,
TextPlugin.Util.getString("TextConnection.Error_while_reading_text_file__{0}_1",
new Object[] {e.getMessage()})); //$NON-NLS-1$
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextConnection.Error_trying_to_establish_connection_5"));
//$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextConnection.Error_trying_to_establish_connection_5"));
//$NON-NLS-1$
} finally {
if (br != null) {
try {br.close();} catch (Exception ee) {}
@@ -197,7 +197,7 @@
/**
* Read the property string and populate the properties with info needed to access
data files.
*/
- private void getMetadata(String propStr) throws ConnectorException {
+ private void getMetadata(String propStr) throws TranslatorException {
try {
int index = 0;
@@ -232,18 +232,18 @@
try {
Integer.parseInt(propertyValue);
} catch (NumberFormatException e) {
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3",
new Object[] {e.getMessage()})); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3",
new Object[] {e.getMessage()})); //$NON-NLS-1$
}
} else if (propertyName.equals(TextDescriptorPropertyNames.HEADER_ROW)) {
try {
Integer.parseInt(propertyValue);
} catch (NumberFormatException e) {
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3",
new Object[] {e.getMessage()})); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3",
new Object[] {e.getMessage()})); //$NON-NLS-1$
}
} else if (!(propertyName.equals(TextDescriptorPropertyNames.COLUMNS)
|| propertyName.equals(TextDescriptorPropertyNames.TYPES) ||
propertyName.equals(TextDescriptorPropertyNames.LOCATION)
|| propertyName.equals(TextDescriptorPropertyNames.DELIMITER) ||
propertyName.equals(TextDescriptorPropertyNames.QUALIFIER))) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnection.The_property_{0}_for_the_group_{1}_is_invalid._4",
new Object[] {propertyName, groupName})); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnection.The_property_{0}_for_the_group_{1}_is_invalid._4",
new Object[] {propertyName, groupName})); //$NON-NLS-1$
}
// Check for tab as a delimiter and use correct string
@@ -257,7 +257,7 @@
metadataProps.put(groupName, props);
}
} catch (Exception e) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnection.Error_parsing_property_string_{0}__{1}_6",
new Object[] {propStr, e.getMessage()})); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnection.Error_parsing_property_string_{0}__{1}_6",
new Object[] {propStr, e.getMessage()})); //$NON-NLS-1$
}
}
@@ -266,7 +266,7 @@
* @param fileLocation String standing for the fileLocation either in file system or
web.
* @return BufferReader for the file
*/
- private BufferedReader getReader(String fileLocation) throws ConnectorException {
+ private BufferedReader getReader(String fileLocation) throws TranslatorException {
try {
InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream(fileLocation);
if (is != null) {
@@ -283,10 +283,10 @@
// place the stream into a buffered reader
return new BufferedReader(inSR);
} catch (MalformedURLException e) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12",
new Object[] {fileLocation})); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12",
new Object[] {fileLocation})); //$NON-NLS-1$
}
} catch (IOException e) {
- throw new
ConnectorException(e,TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12",
new Object[] {fileLocation})); //$NON-NLS-1$
+ throw new
TranslatorException(e,TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12",
new Object[] {fileLocation})); //$NON-NLS-1$
}
}
Modified:
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
===================================================================
---
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -39,7 +39,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TypeFacility;
@@ -93,7 +93,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
//translate request
translateRequest(cmd);
@@ -101,9 +101,9 @@
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (canceled) {
- throw new ConnectorException("Execution cancelled"); //$NON-NLS-1$
+ throw new TranslatorException("Execution cancelled"); //$NON-NLS-1$
}
Select query = cmd;
NamedTable group = (NamedTable)query.getFrom().get(0);
@@ -131,15 +131,15 @@
// Save selected columns into query results
if (this.config.isEnforceColumnCount() && record.size() !=
numModeledColumns) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Input_column_cnt_incorrect",
new Object[] { new Integer(numModeledColumns), new Integer(record.size()) }));
//$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Input_column_cnt_incorrect",
new Object[] { new Integer(numModeledColumns), new Integer(record.size()) }));
//$NON-NLS-1$
}
return getRow(record, cols, types);
}
- } catch(ConnectorException ce) {
+ } catch(TranslatorException ce) {
throw ce;
} catch(Throwable e) {
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new
Object[] { location, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new
Object[] { location, e.getMessage() })); //$NON-NLS-1$
}
}
@@ -157,16 +157,16 @@
* Translate command.
* @param request ICommand as request
* @return Object translated request
- * @throws ConnectorException if error occurs
+ * @throws TranslatorException if error occurs
*/
- protected Object translateRequest(Command request) throws ConnectorException {
+ protected Object translateRequest(Command request) throws TranslatorException {
if (request == null) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Request_is_null"));
//$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Request_is_null"));
//$NON-NLS-1$
}
if (cmd == null) {
Object[] params = new Object[] { cmd };
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Error_translating_request",
params)); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Error_translating_request",
params)); //$NON-NLS-1$
}
// Get the columns widths for all the elements in the group.
@@ -203,9 +203,9 @@
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
Object[] params = new Object[] { query, e.getMessage() };
- throw new ConnectorException(e,
TextPlugin.Util.getString("TextSynchExecution.Cannot_be_translated_by_the_TextTranslator.",
params)); //$NON-NLS-1$
+ throw new TranslatorException(e,
TextPlugin.Util.getString("TextSynchExecution.Cannot_be_translated_by_the_TextTranslator.",
params)); //$NON-NLS-1$
}
return request;
@@ -216,7 +216,7 @@
* @param vars List of DataNodeIDs
* @return Column numbers corresponding to vars
*/
- private int[] getSelectCols(List vars) throws ConnectorException{
+ private int[] getSelectCols(List vars) throws TranslatorException{
int[] cols = new int[vars.size()];
for(int i=0; i<vars.size(); i++) {
cols[i] = getColumn((DerivedColumn)vars.get(i));
@@ -232,9 +232,9 @@
*
* @param symbol Identifier to look up the column
* @return int The column corresponding to that id
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private int getColumn(DerivedColumn symbol) throws ConnectorException{
+ private int getColumn(DerivedColumn symbol) throws TranslatorException{
return this.getColumn(getElementFromSymbol(symbol));
}
@@ -259,9 +259,9 @@
* is used otherwise, Name In Source is used.
* @param elem
* @return int
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private int getColumn(Column elem) throws ConnectorException{
+ private int getColumn(Column elem) throws TranslatorException{
String colStr = elem.getNameInSource();
try {
// If Name In Source is numeric, it is a column number
@@ -275,9 +275,9 @@
for ( int i = 0; i < headerRow.size(); i++ ) {
if ( colStr.compareToIgnoreCase((String)headerRow.get(i) )==0) return i;
}
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Column_not_found_in_header_row",
new Object[] {colStr, elem.getFullName() } )); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Column_not_found_in_header_row",
new Object[] {colStr, elem.getFullName() } )); //$NON-NLS-1$
}
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Invalid_column_number",
new Object[] {colStr, elem.getFullName() } ) ); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Invalid_column_number",
new Object[] {colStr, elem.getFullName() } ) ); //$NON-NLS-1$
}
}
@@ -290,7 +290,7 @@
* @return List of column values inside the line
* @throws Exception
*/
- private List getRecord(String line, String delimiter, String qualifier, List
colWidths) throws ConnectorException {
+ private List getRecord(String line, String delimiter, String qualifier, List
colWidths) throws TranslatorException {
if(delimiter != null) {
return parseDelimitedLine(line, delimiter, qualifier);
}
@@ -301,7 +301,7 @@
* @param line line's length will not be 0
* @return List of parsed columns
*/
- private List parseDelimitedLine(String line, String delimiter, String qualifier)
throws ConnectorException {
+ private List parseDelimitedLine(String line, String delimiter, String qualifier)
throws TranslatorException {
// the case with no qualifier
if (qualifier == null || qualifier.trim().length()==0) {
// parse on delimiters
@@ -359,7 +359,7 @@
// changed to Connectorexception so that the exception is thrown to the user
// and becomes known a problem, rather than just
// keeping it internally to the server
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Text_has_no_ending_qualifier",
params)); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Text_has_no_ending_qualifier",
params)); //$NON-NLS-1$
}
// skipping escaped qualifier charachters
if(line.length() > endQualIndex+1) {
@@ -379,7 +379,7 @@
// changed to Connectorexception so that the exception is thrown to the user
// and becomes known a problem, rather than just
// keeping it internally to the server
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
@@ -437,9 +437,9 @@
* @param line
* @param colWidths
* @return List
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private List parseFixedWidthLine(String line, List colWidths) throws
ConnectorException {
+ private List parseFixedWidthLine(String line, List colWidths) throws
TranslatorException {
int length = line.length();
List fields = new ArrayList(colWidths.size());
Iterator iter = colWidths.iterator();
@@ -448,7 +448,7 @@
try {
int width = ((Integer)iter.next()).intValue();
if(width <= 0) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Column_length_must_be_positive"));
//$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Column_length_must_be_positive"));
//$NON-NLS-1$
}
int end = current + width;
@@ -479,7 +479,7 @@
* @param columns Columns to save in results
* @param types Class of all columns' types
*/
- private List getRow(List record, int[] columns, Class[] types) throws
ConnectorException {
+ private List getRow(List record, int[] columns, Class[] types) throws
TranslatorException {
List newRecord = new ArrayList(columns.length);
for(int i=0; i<columns.length; i++) {
int column = columns[i];
@@ -496,7 +496,7 @@
* @param type Input type
* @return Object translated Object from String
*/
- private Object convertString(String value, Class type) throws ConnectorException {
+ private Object convertString(String value, Class type) throws TranslatorException {
if (value==null) {
return null;
}
@@ -527,7 +527,7 @@
try {
return new
Timestamp(stringToDateTranslator.translateStringToDate(value).getTime());
}catch(ParseException ex) {
- throw new
ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Unable_translate_String_to_Date",
new Object[] { ex.getMessage() })); //$NON-NLS-1$
+ throw new
TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Unable_translate_String_to_Date",
new Object[] { ex.getMessage() })); //$NON-NLS-1$
}
}
}
Modified:
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java
===================================================================
---
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import junit.framework.TestCase;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import com.metamatrix.cdk.api.ConnectorHost;
@@ -47,7 +47,7 @@
try {
Util.getConnectorHostWithFakeMetadata(BAD_COUNT_FILE).executeCommand(sql);
fail("Should have failed due to extra column defined in .csv
file");//$NON-NLS-1$
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
assertEquals("Expected input file to have 3 columns based on model, but
found 4. This could be caused by misplaced quotes, causing multiple columns to be treated
as one.", e.getMessage()); //$NON-NLS-1$
}
}
@@ -57,7 +57,7 @@
try {
Util.getConnectorHostWithFakeMetadata(BAD_COUNT_FILE).executeCommand(sql);
fail("Should have failed due to extra column defined in .csv
file");//$NON-NLS-1$
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
assertEquals("Expected input file to have 3 columns based on model, but
found 4. This could be caused by misplaced quotes, causing multiple columns to be treated
as one.", e.getMessage()); //$NON-NLS-1$
}
}
Modified:
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java
===================================================================
---
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
@@ -126,7 +126,7 @@
try {
Util.helpTestExecution("TextParts/TextParts.vdb",
"TextParts/PartsDescriptor4.txt", sql, 21); //$NON-NLS-1$ //$NON-NLS-2$
fail("Should have received ConnectorException due to an invalid header
row being defined."); //$NON-NLS-1$
- } catch (ConnectorException ce ) {
+ } catch (TranslatorException ce ) {
assertEquals("'SELECT PARTS_AlphaNameInSource.Part_Id,
PARTS_AlphaNameInSource.Part_Name, PARTS_AlphaNameInSource.Part_Color,
PARTS_AlphaNameInSource.Part_Weight FROM PARTS_AlphaNameInSource' cannot be translated
by the TextTranslator. Column Part_Id not found for element
Parts.PARTS_AlphaNameInSource.Part_Id. Verify column name \"Part_Id\" is
defined in the header row of the text file and that the header row number is correctly
defined in the descriptor file.", ce.getMessage()); //$NON-NLS-1$
}
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
-import org.teiid.translator.ConnectorCapabilities;
+import org.teiid.translator.TranslatorCapabilities;
/**
@@ -40,11 +40,11 @@
private CapabilitiesConverter() {
}
- public static SourceCapabilities convertCapabilities(ConnectorCapabilities srcCaps)
{
+ public static SourceCapabilities convertCapabilities(TranslatorCapabilities srcCaps)
{
return convertCapabilities(srcCaps, null, false);
}
- public static BasicSourceCapabilities convertCapabilities(ConnectorCapabilities
srcCaps, String connectorID, boolean isXa) {
+ public static BasicSourceCapabilities convertCapabilities(TranslatorCapabilities
srcCaps, String connectorID, boolean isXa) {
BasicSourceCapabilities tgtCaps = new BasicSourceCapabilities();
tgtCaps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION,
srcCaps.supportsSelectExpression());
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -56,8 +56,8 @@
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Scope;
import org.teiid.query.sql.lang.Command;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorCapabilities;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -129,7 +129,7 @@
}
- public MetadataStore getMetadata(String modelName, Map<String, Datatype>
datatypes, Properties importProperties) throws ConnectorException {
+ public MetadataStore getMetadata(String modelName, Map<String, Datatype>
datatypes, Properties importProperties) throws TranslatorException {
MetadataFactory factory = new MetadataFactory(modelName, datatypes,
importProperties);
ExecutionFactory executionFactory = getExecutionFactory();
if (executionFactory instanceof MetadataProvider) {
@@ -138,7 +138,7 @@
return factory.getMetadataStore();
}
- public SourceCapabilities getCapabilities() throws ConnectorException {
+ public SourceCapabilities getCapabilities() throws TranslatorException {
if (cachedCapabilities != null) {
return cachedCapabilities;
}
@@ -151,7 +151,7 @@
return resultCaps;
}
- public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem
awi) throws ConnectorException {
+ public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem
awi) throws TranslatorException {
// Set the connector ID to be used; if not already set.
checkStatus();
AtomicRequestID atomicRequestId = message.getAtomicRequestID();
@@ -196,7 +196,7 @@
/**
* initialize this <code>ConnectorManager</code>.
- * @throws ConnectorException
+ * @throws TranslatorException
*/
public void start() {
LogManager.logDetail(LogConstants.CTX_CONNECTOR,
DQPPlugin.Util.getString("ConnectorManagerImpl.Initializing_connector",
translatorName)); //$NON-NLS-1$
@@ -283,9 +283,9 @@
return null;
}
- private void checkStatus() throws ConnectorException {
+ private void checkStatus() throws TranslatorException {
if (stopped) {
- throw new
ConnectorException(DQPPlugin.Util.getString("ConnectorManager.not_in_valid_state",
this.translatorName)); //$NON-NLS-1$
+ throw new
TranslatorException(DQPPlugin.Util.getString("ConnectorManager.not_in_valid_state",
this.translatorName)); //$NON-NLS-1$
}
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.dqp.message.AtomicResultsMessage;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -34,11 +34,11 @@
void cancel();
- AtomicResultsMessage more() throws ConnectorException;
+ AtomicResultsMessage more() throws TranslatorException;
void close();
- AtomicResultsMessage execute() throws ConnectorException, BlockedException;
+ AtomicResultsMessage execute() throws TranslatorException, BlockedException;
boolean isQueued();
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -53,7 +53,7 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionFactory;
@@ -154,12 +154,12 @@
}
LogManager.logDetail(LogConstants.CTX_CONNECTOR,
DQPPlugin.Util.getString("DQPCore.The_atomic_request_has_been_cancelled",
this.id)); //$NON-NLS-1$
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, e,
DQPPlugin.Util.getString("Cancel_request_failed", this.id)); //$NON-NLS-1$
}
}
- public AtomicResultsMessage more() throws ConnectorException {
+ public AtomicResultsMessage more() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id,
"Processing MORE request"}); //$NON-NLS-1$
try {
return handleBatch();
@@ -178,7 +178,7 @@
execution.close();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id,
"Closed execution"}); //$NON-NLS-1$
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, e.getMessage());
} catch (Throwable e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
@@ -190,7 +190,7 @@
- private ConnectorException handleError(Throwable t) {
+ private TranslatorException handleError(Throwable t) {
if (t instanceof DataNotAvailableException) {
throw (DataNotAvailableException)t;
}
@@ -203,23 +203,23 @@
String msg = DQPPlugin.Util.getString("ConnectorWorker.process_failed",
this.id); //$NON-NLS-1$
if (isCancelled.get()) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, msg);
- } else if (t instanceof ConnectorException || t instanceof
TeiidProcessingException) {
+ } else if (t instanceof TranslatorException || t instanceof
TeiidProcessingException) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, t, msg);
} else {
LogManager.logError(LogConstants.CTX_CONNECTOR, t, msg);
}
- if (t instanceof ConnectorException) {
- return (ConnectorException)t;
+ if (t instanceof TranslatorException) {
+ return (TranslatorException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
- return new ConnectorException(t);
+ return new TranslatorException(t);
}
- public AtomicResultsMessage execute() throws ConnectorException, BlockedException {
+ public AtomicResultsMessage execute() throws TranslatorException, BlockedException {
if(isCancelled()) {
- throw new ConnectorException("Request canceled"); //$NON-NLS-1$
+ throw new TranslatorException("Request canceled"); //$NON-NLS-1$
}
if (!this.securityContext.isTransactional()) {
@@ -267,19 +267,19 @@
private int index;
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
exec.cancel();
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
exec.close();
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
exec.execute();
}
@Override
- public List<?> next() throws ConnectorException,
+ public List<?> next() throws TranslatorException,
DataNotAvailableException {
if (results == null) {
results = ((UpdateExecution)exec).getUpdateCounts();
@@ -305,7 +305,7 @@
}
}
- protected AtomicResultsMessage handleBatch() throws ConnectorException {
+ protected AtomicResultsMessage handleBatch() throws TranslatorException {
Assertion.assertTrue(!this.lastBatch);
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id,
"Sending results from connector"}); //$NON-NLS-1$
int batchSize = 0;
@@ -336,7 +336,7 @@
break;
} else if (this.rowCount > this.connector.getMaxResultRows() &&
this.connector.isExceptionOnMaxRows()) {
String msg =
DQPPlugin.Util.getString("ConnectorWorker.MaxResultRowsExceed",
this.connector.getMaxResultRows()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
}
@@ -378,7 +378,7 @@
return response;
}
- private void correctTypes(List row) throws ConnectorException {
+ private void correctTypes(List row) throws TranslatorException {
//TODO: add a proper source schema
for (int i = convertToRuntimeType.size() - 1; i >= 0; i--) {
int index = convertToRuntimeType.get(i);
@@ -403,7 +403,7 @@
try {
result = DataTypeManager.transformValue(value, value.getClass(), this.schema[i]);
} catch (TransformationException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
if (value == result) {
convertToDesiredRuntimeType[i] = false;
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Argument;
import org.teiid.language.Call;
import org.teiid.language.Argument.Direction;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ProcedureExecution;
@@ -65,9 +65,9 @@
}
}
- List padRow(List row) throws ConnectorException {
+ List padRow(List row) throws TranslatorException {
if (row.size() != resultSetCols) {
- throw new
ConnectorException(DQPPlugin.Util.getString("ConnectorWorker.ConnectorWorker_result_set_unexpected_columns",
new Object[] {proc, new Integer(resultSetCols), new Integer(row.size())})); //$NON-NLS-1$
+ throw new
TranslatorException(DQPPlugin.Util.getString("ConnectorWorker.ConnectorWorker_result_set_unexpected_columns",
new Object[] {proc, new Integer(resultSetCols), new Integer(row.size())})); //$NON-NLS-1$
}
if (paramCols == 0) {
return row;
@@ -78,7 +78,7 @@
return result;
}
- List getParameterRow() throws ConnectorException {
+ List getParameterRow() throws TranslatorException {
if (paramCols == 0) {
return null;
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -108,7 +108,7 @@
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class LanguageBridgeFactory {
@@ -585,7 +585,7 @@
if(sp.getProcedureID() != null) {
try {
proc = this.metadataFactory.getProcedure(sp.getGroup().getName());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new TeiidRuntimeException(e);
}
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.StoredProcedureInfo;
import org.teiid.query.sql.lang.SPParameter;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -45,14 +45,14 @@
}
@Override
- public Column getColumn(String fullName) throws ConnectorException {
+ public Column getColumn(String fullName) throws TranslatorException {
try {
Object metadataId = metadata.getElementID(fullName);
return getElement(metadataId);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -64,14 +64,14 @@
}
@Override
- public Table getTable(String fullName) throws ConnectorException {
+ public Table getTable(String fullName) throws TranslatorException {
try {
Object groupId = metadata.getGroupID(fullName);
return getGroup(groupId);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -83,14 +83,14 @@
}
@Override
- public Procedure getProcedure(String fullName) throws ConnectorException {
+ public Procedure getProcedure(String fullName) throws TranslatorException {
try {
StoredProcedureInfo sp = metadata.getStoredProcedureInfoForProcedure(fullName);
return getProcedure(sp);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -108,33 +108,33 @@
return null;
}
- public byte[] getBinaryVDBResource(String resourcePath) throws ConnectorException {
+ public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException {
try {
return metadata.getBinaryVDBResource(resourcePath);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
- public String getCharacterVDBResource(String resourcePath) throws ConnectorException
{
+ public String getCharacterVDBResource(String resourcePath) throws TranslatorException
{
try {
return metadata.getCharacterVDBResource(resourcePath);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
- public String[] getVDBResourcePaths() throws ConnectorException {
+ public String[] getVDBResourcePaths() throws TranslatorException {
try {
return metadata.getVDBResourcePaths();
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -68,17 +68,17 @@
if(caps != null) {
return caps;
}
- ConnectorException exception = null;
+ TranslatorException exception = null;
ModelMetaData model = vdb.getModel(modelName);
for (String sourceName:model.getSourceNames()) {
try {
ConnectorManager mgr = this.connectorRepo.getConnectorManager(sourceName);
if (mgr == null) {
- throw new
ConnectorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found",
sourceName, modelName, sourceName)); //$NON-NLS-1$
+ throw new
TranslatorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found",
sourceName, modelName, sourceName)); //$NON-NLS-1$
}
caps = mgr.getCapabilities();
break;
- } catch(ConnectorException e) {
+ } catch(TranslatorException e) {
if (exception == null) {
exception = e;
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -77,7 +77,7 @@
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class DataTierManagerImpl implements ProcessorDataManager {
@@ -346,7 +346,7 @@
return aqr;
}
- ConnectorWork executeRequest(AtomicRequestMessage aqr, AbstractWorkItem awi, String
connectorName) throws ConnectorException {
+ ConnectorWork executeRequest(AtomicRequestMessage aqr, AbstractWorkItem awi, String
connectorName) throws TranslatorException {
return getCM(connectorName).executeRequest(aqr, awi);
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -33,7 +33,7 @@
import org.teiid.dqp.internal.datamgr.impl.ConnectorWork;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -91,7 +91,7 @@
try {
running = true;
receiveResults(this.cwi.more());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptionOccurred(e, true);
} finally {
running = false;
@@ -116,7 +116,7 @@
}
running = true;
receiveResults(this.cwi.execute());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptionOccurred(e, true);
} finally {
running = false;
@@ -157,7 +157,7 @@
}
}
- void exceptionOccurred(ConnectorException exception, boolean removeState) throws
TeiidComponentException, TeiidProcessingException {
+ void exceptionOccurred(TranslatorException exception, boolean removeState) throws
TeiidComponentException, TeiidProcessingException {
if (removeState) {
fullyCloseSource();
}
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -40,17 +40,11 @@
public BasicSourceCapabilities() {
}
- /**
- * @see
org.teiid.resource.cci.server.datatier.ConnectorCapabilities#supportsCapability(java.lang.String)
- */
public boolean supportsCapability(Capability capability) {
Boolean supports = (Boolean) capabilityMap.get(capability);
return (supports == null) ? false : supports.booleanValue();
}
- /**
- * @see
org.teiid.resource.cci.server.datatier.ConnectorCapabilities#supportsFunction(java.lang.String)
- */
public boolean supportsFunction(String functionName) {
Boolean supports = (Boolean) functionMap.get(functionName);
return (supports == null) ? false : supports.booleanValue();
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -45,7 +45,7 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
/**
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -52,7 +52,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.util.CommandContext;
import org.teiid.query.util.Permutation;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
/**
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -54,7 +54,7 @@
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.util.CommandContext;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
public final class RuleRaiseAccess implements OptimizerRule {
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -60,7 +60,7 @@
}
@Override
- public Execution createExecution(Command command, ExecutionContext executionContext,
RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ public Execution createExecution(Command command, ExecutionContext executionContext,
RuntimeMetadata metadata, Object connection) throws TranslatorException {
executionCount++;
return new FakeBlockingExecution(executionContext);
}
@@ -89,7 +89,7 @@
public FakeBlockingExecution(ExecutionContext ec) {
this.ec = ec;
}
- public void execute(QueryExpression query, int maxBatchSize) throws
ConnectorException {
+ public void execute(QueryExpression query, int maxBatchSize) throws
TranslatorException {
if (executeBlocks) {
waitForCancel();
}
@@ -97,20 +97,20 @@
Assert.assertSame(classloader,
Thread.currentThread().getContextClassLoader());
}
}
- public synchronized void cancel() throws ConnectorException {
+ public synchronized void cancel() throws TranslatorException {
cancelled = true;
this.notify();
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
Assert.assertFalse("The execution should not be closed more than
once", closed); //$NON-NLS-1$
closed = true;
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
ec.addWarning(new Exception("Some warning")); //$NON-NLS-1$
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (nextBatchBlocks) {
waitForCancel();
}
@@ -120,11 +120,11 @@
this.rowCount++;
return Arrays.asList(this.rowCount - 1);
}
- private synchronized void waitForCancel() throws ConnectorException {
+ private synchronized void waitForCancel() throws TranslatorException {
try {
this.wait(simulatedBatchRetrievalTime);
if (cancelled && driverThrowsExceptionOnCancel) {
- throw new ConnectorException("Request cancelled");
//$NON-NLS-1$
+ throw new TranslatorException("Request cancelled");
//$NON-NLS-1$
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
@@ -132,7 +132,7 @@
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {1};
}
}
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
@@ -43,12 +43,12 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
List<Object> result = new ArrayList<Object>(paramSize);
for (int i = 0; i < paramSize; i++) {
result.add(i);
@@ -56,14 +56,14 @@
return result;
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
}
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (rowNum == 1) {
return null;
}
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -49,7 +49,7 @@
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ProcedureExecution;
@@ -101,7 +101,7 @@
try {
pbh.padRow(Arrays.asList(1));
fail("Expected exception from resultset mismatch"); //$NON-NLS-1$
- } catch (ConnectorException err) {
+ } catch (TranslatorException err) {
assertEquals(
"Could not process stored procedure results for EXEC spTest8(1). Expected 2
result set columns, but was 1. Please update your models to allow for stored procedure
results batching.", err.getMessage()); //$NON-NLS-1$
}
@@ -156,7 +156,7 @@
}
@Ignore
- @Test(expected=ConnectorException.class) public void testIsImmutablePropertyFails()
throws Exception {
+ @Test(expected=TranslatorException.class) public void testIsImmutablePropertyFails()
throws Exception {
/*
* Setup:
* 1. requestMsg.isTransactional() must be TRUE
Modified: trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
@@ -69,9 +69,9 @@
@Override
public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem
awi)
- throws ConnectorException {
+ throws TranslatorException {
if (throwExceptionOnExecute) {
- throw new ConnectorException("Connector Exception"); //$NON-NLS-1$
+ throw new TranslatorException("Connector Exception"); //$NON-NLS-1$
}
List projectedSymbols = (message.getCommand()).getProjectedSymbols();
List[] results = createResults(projectedSymbols);
@@ -81,12 +81,12 @@
return new ConnectorWork() {
@Override
- public AtomicResultsMessage more() throws ConnectorException {
+ public AtomicResultsMessage more() throws TranslatorException {
throw new RuntimeException("Should not be called"); //$NON-NLS-1$
}
@Override
- public AtomicResultsMessage execute() throws ConnectorException {
+ public AtomicResultsMessage execute() throws TranslatorException {
if (dataNotAvailable > -1) {
int delay = dataNotAvailable;
dataNotAvailable = -1;
Modified:
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
public class TestJoinPushdownRestrictions {
Modified: trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Command;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.index.VDBMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -50,15 +50,15 @@
private ExecutionContext executionContext;
private Object connectionFactory;
- public ConnectorHost(ExecutionFactory connector, Object connectionFactory, String
vdbFileName) throws ConnectorException {
+ public ConnectorHost(ExecutionFactory connector, Object connectionFactory, String
vdbFileName) throws TranslatorException {
initialize(connector, connectionFactory, new
TranslationUtility(VDBMetadataFactory.getVDBMetadata(vdbFileName)));
}
- public ConnectorHost(ExecutionFactory connector, Object connectionFactory,
TranslationUtility util) throws ConnectorException{
+ public ConnectorHost(ExecutionFactory connector, Object connectionFactory,
TranslationUtility util) throws TranslatorException{
initialize(connector, connectionFactory, util);
}
- private void initialize(ExecutionFactory connector, Object connectionFactory,
TranslationUtility util) throws ConnectorException {
+ private void initialize(ExecutionFactory connector, Object connectionFactory,
TranslationUtility util) throws TranslatorException {
this.connector = connector;
this.util = util;
this.connectionFactory = connectionFactory;
@@ -69,20 +69,20 @@
this.executionContext = context;
}
- public List executeCommand(String query) throws ConnectorException {
+ public List executeCommand(String query) throws TranslatorException {
Command command = getCommand(query);
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
return executeCommand(command, runtimeMetadata);
}
- public List executeCommand(Command command) throws ConnectorException {
+ public List executeCommand(Command command) throws TranslatorException {
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
return executeCommand(command, runtimeMetadata);
}
private List executeCommand(Command command, RuntimeMetadata runtimeMetadata)
- throws ConnectorException {
+ throws TranslatorException {
Execution exec = connector.createExecution(command, this.executionContext,
runtimeMetadata, this.connectionFactory);
exec.execute();
@@ -92,7 +92,7 @@
return results;
}
- public int[] executeBatchedUpdates(String[] updates) throws ConnectorException {
+ public int[] executeBatchedUpdates(String[] updates) throws TranslatorException {
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
Command[] commands = new Command[updates.length];
for (int i = 0; i < updates.length; i++) {
@@ -102,7 +102,7 @@
return executeBatchedUpdates(commands, runtimeMetadata);
}
- public int[] executeBatchedUpdates(Command[] commands, RuntimeMetadata
runtimeMetadata) throws ConnectorException {
+ public int[] executeBatchedUpdates(Command[] commands, RuntimeMetadata
runtimeMetadata) throws TranslatorException {
List<List> result = executeCommand(new
BatchedUpdates(Arrays.asList(commands)), runtimeMetadata);
int[] counts = new int[result.size()];
for (int i = 0; i < counts.length; i++) {
@@ -111,7 +111,7 @@
return counts;
}
- private List<List> readResultsFromExecution(Execution execution) throws
ConnectorException {
+ private List<List> readResultsFromExecution(Execution execution) throws
TranslatorException {
List<List> results = new ArrayList<List>();
while (true) {
try {
@@ -133,7 +133,7 @@
try {
Thread.sleep(e.getRetryDelay());
} catch (InterruptedException e1) {
- throw new ConnectorException(e1);
+ throw new TranslatorException(e1);
}
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -25,8 +25,6 @@
import java.lang.reflect.Method;
import java.util.Map;
-import javax.resource.ResourceException;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -106,8 +104,6 @@
} catch (TeiidException e) {
throw new DeploymentException(e);
- } catch (ResourceException e) {
- throw new DeploymentException(e);
} catch (InvocationTargetException e) {
throw new DeploymentException(e);
} catch (IllegalAccessException e) {
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-13 13:40:34
UTC (rev 2122)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-13 14:30:43
UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.metadata.TransformationMetadata.Resource;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.runtime.RuntimePlugin;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionFactory;
@@ -275,7 +275,7 @@
this.serializer.saveAttachment(cacheFile, store);
}
return store;
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
if (exception != null) {
exception = e;
}
Modified:
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
===================================================================
---
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-13
13:40:34 UTC (rev 2122)
+++
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -15,7 +15,7 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ProcedureExecution;
@@ -28,7 +28,7 @@
@Override
public ProcedureExecution createProcedureExecution(
Call procedure, ExecutionContext executionContext,
- RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ RuntimeMetadata metadata, Object connection) throws TranslatorException {
Properties props = new Properties();
props.setProperty("customBehaviour", "SkipExecute");//$NON-NLS-1$
//$NON-NLS-2$
@@ -45,7 +45,7 @@
@Override
public ResultSetExecution createResultSetExecution(
QueryExpression query, ExecutionContext executionContext,
- RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ RuntimeMetadata metadata, Object connection) throws TranslatorException {
Properties groupProps = new Properties();
groupProps.setProperty("customName", "CustomTableA");//$NON-NLS-1$
//$NON-NLS-2$
NamedTable group = (NamedTable)query.getProjectedQuery().getFrom().get(0);
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-05-13
13:40:34 UTC (rev 2122)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-05-13
14:30:43 UTC (rev 2123)
@@ -48,7 +48,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.services.SessionServiceImpl;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
import org.teiid.transport.LocalServerConnection;
@@ -78,7 +78,7 @@
Mockito.stub(cmr.getConnectorManager("source")).toReturn(new
ConnectorManager("x", "x") {
@Override
public SourceCapabilities getCapabilities()
- throws ConnectorException {
+ throws TranslatorException {
return new BasicSourceCapabilities();
}
});