teiid SVN: r2603 - in trunk: adminshell and 140 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-09-24 14:51:07 -0400 (Fri, 24 Sep 2010)
New Revision: 2603
Added:
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeSQLVisitor.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeUtil.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/PathFunctionModifier.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestPathFunctionModifier.java
trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBLifeCycleListener.java
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected
Removed:
trunk/build/assembly/bin.xml
trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
trunk/client/src/main/java/org/teiid/net/NetPlugin.java
trunk/client/src/main/resources/org/teiid/net/i18n.properties
trunk/client/src/test/java/org/teiid/net/TestMMURL.java
trunk/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
trunk/engine/src/main/java/org/teiid/dqp/DQPPlugin.java
trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java
trunk/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java
trunk/engine/src/main/resources/org/teiid/dqp/i18n.properties
trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
Modified:
trunk/adminshell/pom.xml
trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
trunk/api/pom.xml
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
trunk/api/src/main/java/org/teiid/resource/spi/ConnectionRequestInfoWrapper.java
trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnection.java
trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnectionFactory.java
trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/api/src/main/java/org/teiid/translator/TranslatorException.java
trunk/api/src/main/resources/org/teiid/connector/i18n.properties
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/build/assembly/client-jar.xml
trunk/build/assembly/docs.xml
trunk/build/assembly/jboss-container/dist.xml
trunk/build/assembly/src.xml
trunk/build/kits/adminshell/connection.properties
trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
trunk/build/kits/jboss-container/conf/props/teiid-security-roles.properties
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/build/kits/jboss-container/teiid-examples/jca/ldap-ds.xml
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/client/pom.xml
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java
trunk/client/src/main/java/org/teiid/adminapi/impl/PermissionMap.java
trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/main/java/org/teiid/client/BatchSerializer.java
trunk/client/src/main/java/org/teiid/client/RequestMessage.java
trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java
trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
trunk/client/src/main/java/org/teiid/net/TeiidURL.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
trunk/client/src/main/resources/teiid-client-settings.properties
trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
trunk/client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java
trunk/common-core/pom.xml
trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java
trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
trunk/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java
trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java
trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
trunk/common-core/src/main/resources/org/teiid/core/i18n.properties
trunk/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java
trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
trunk/connectors/connector-ldap/src/main/resources/org/teiid/resource/adapter/ldap/i18n.properties
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
trunk/connectors/pom.xml
trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties
trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.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/modeshape/ModeShapeExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java
trunk/connectors/translator-jdbc/src/test/resources/ModeShape.vdb
trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
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/QueryExecutionImpl.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/SelectVisitor.java
trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
trunk/console/pom.xml
trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/adminshell.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-b.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/clustering.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/security.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
trunk/documentation/pom.xml
trunk/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
trunk/engine/pom.xml
trunk/engine/src/main/java/org/teiid/cache/Cache.java
trunk/engine/src/main/java/org/teiid/cache/CacheFactory.java
trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java
trunk/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java
trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java
trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.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/dqp/internal/process/LobWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/message/AtomicResultsMessage.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java
trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java
trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/JoinRegion.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.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/RulePlanProcedures.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/AddNodeInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/NodeDescriptor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLContext.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
trunk/engine/src/main/java/org/teiid/query/report/ActivityReport.java
trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java
trunk/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java
trunk/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPWorkContext.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestSessionAwareCache.java
trunk/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestCalculateCostUtil.java
trunk/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestCriteriaCapabilityValidatorVisitor.java
trunk/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRuleChooseDependent.java
trunk/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
trunk/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/metadata/pom.xml
trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
trunk/metadata/src/main/resources/System.vdb
trunk/metadata/src/main/resources/org/teiid/metadata/i18n.properties
trunk/pom.xml
trunk/runtime/pom.xml
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
trunk/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedureColumns.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedures.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProceduresWithEscape.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetSchemas.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableMultipleTypes.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableTypes.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_INDEX.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_NAMESPACE.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_PROC.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedureColumns.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedures.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testSchemas.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
trunk/test-integration/db/pom.xml
trunk/test-integration/db/src/test/java/org/teiid/test/testcases/CommonTransactionTests.java
trunk/test-integration/pom.xml
Log:
forward merging 7.1.1
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/adminshell/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -108,12 +108,12 @@
p = props;
}
- @Doc(text = "Adds a role to the specified policy")
+ @Doc(text = "Adds a mapped role to the specified data role")
public static void addDataRoleMapping(
@Doc(text = "vdb name") String vdbName,
@Doc(text = "vdb version") int vdbVersion,
- @Doc(text = "policy name") String policyName,
- @Doc(text = "role") String role) throws AdminException {
+ @Doc(text = "dataRole name") String policyName,
+ @Doc(text = "mapped role name") String role) throws AdminException {
getAdmin().addDataRoleMapping(vdbName, vdbVersion, policyName, role);
}
@@ -237,16 +237,25 @@
return getAdmin().getCacheStats(identifier);
}
- @Doc(text = "Remove a role for the data policy")
+ @Doc(text = "Remove a mapped role for the data role")
public static void removeDataRoleMapping(
@Doc(text = "vdb name") String vdbName,
@Doc(text = "vdb version") int vdbVersion,
- @Doc(text = "policy name") String policyName,
- @Doc(text = "role name") String role) throws AdminException {
+ @Doc(text = "dataRole name") String policyName,
+ @Doc(text = "mapped role name") String role) throws AdminException {
getAdmin()
.removeDataRoleMapping(vdbName, vdbVersion, policyName, role);
}
+ @Doc(text = "Set the any authenticated flag for the data role")
+ public static void setAnyAuthenticatedForDataRole(
+ @Doc(text = "vdb name")String vdbName,
+ @Doc(text = "vdb version")int vdbVersion,
+ @Doc(text = "dataRole name")String dataRole,
+ @Doc(text = "any authenticated") boolean anyAuthenticated) throws AdminException {
+ getAdmin().setAnyAuthenticatedForDataRole(vdbName, vdbVersion, dataRole, anyAuthenticated);
+ }
+
@Doc(text = "Set a runtime property")
public static void setRuntimeProperty(
@Doc(text = "name") String propertyName,
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -88,9 +88,6 @@
@Override
public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
- if(!(arg1 instanceof ConnectionRequestInfoWrapper)) {
- throw new ResourceException("Un-recognized Connection Request Info object received"); //$NON-NLS-1$
- }
ConnectionContext.setSubject(arg0);
WrappedConnection wc = new WrappedConnection(this);
Modified: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,6 +37,7 @@
import javax.security.auth.Subject;
import org.teiid.core.TeiidException;
+import org.teiid.core.util.Assertion;
import org.teiid.core.util.ReflectionHelper;
@@ -45,20 +46,29 @@
private static final long serialVersionUID = -7302713800883776790L;
private PrintWriter log;
private BasicResourceAdapter ra;
+ private BasicConnectionFactory cf;
@Override
- public abstract Object createConnectionFactory() throws ResourceException;
+ public abstract BasicConnectionFactory createConnectionFactory() throws ResourceException;
@Override
- public Object createConnectionFactory(ConnectionManager arg0) throws ResourceException {
- return createConnectionFactory();
+ public Object createConnectionFactory(ConnectionManager cm) throws ResourceException {
+ this.cf = createConnectionFactory();
+ return new WrappedConnectionFactory(this.cf, cm, this);
}
@Override
public ManagedConnection createManagedConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
- ConnectionRequestInfoWrapper criw = (ConnectionRequestInfoWrapper)arg1;
+ Assertion.isNotNull(this.cf);
ConnectionContext.setSubject(arg0);
- BasicConnection connection = criw.cf.getConnection();
+
+ BasicConnection connection = null;
+ if (arg1 instanceof ConnectionRequestInfoWrapper) {
+ connection = this.cf.getConnection(((ConnectionRequestInfoWrapper)arg1).cs);
+ }
+ else {
+ connection = this.cf.getConnection();
+ }
ConnectionContext.setSubject(null);
return new BasicManagedConnection(connection);
}
Modified: trunk/api/src/main/java/org/teiid/resource/spi/ConnectionRequestInfoWrapper.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/ConnectionRequestInfoWrapper.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/resource/spi/ConnectionRequestInfoWrapper.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -21,12 +21,13 @@
*/
package org.teiid.resource.spi;
+import javax.resource.cci.ConnectionSpec;
import javax.resource.spi.ConnectionRequestInfo;
class ConnectionRequestInfoWrapper implements ConnectionRequestInfo {
- BasicConnectionFactory cf;
+ ConnectionSpec cs;
- public ConnectionRequestInfoWrapper(BasicConnectionFactory cf) {
- this.cf = cf;
+ public ConnectionRequestInfoWrapper(ConnectionSpec cs) {
+ this.cs = cs;
}
}
Modified: trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnection.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnection.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -69,5 +69,9 @@
public ResultSetInfo getResultSetInfo() throws ResourceException {
return this.mc.getConnection().getResultSetInfo();
}
+
+ public Connection unwrap() throws ResourceException {
+ return this.mc.getConnection();
+ }
}
Modified: trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnectionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnectionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/resource/spi/WrappedConnectionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -50,7 +50,7 @@
@Override
public Connection getConnection() throws ResourceException {
- return (Connection)cm.allocateConnection(mcf, new ConnectionRequestInfoWrapper(this.delegate));
+ return (Connection)cm.allocateConnection(mcf, null);
}
@@ -66,7 +66,7 @@
@Override
public Connection getConnection(ConnectionSpec arg0) throws ResourceException {
- return getConnection();
+ return (Connection)cm.allocateConnection(mcf, new ConnectionRequestInfoWrapper(arg0));
}
@Override
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -109,8 +109,14 @@
/**
* When the execution is turned on with "alive=true", the execution object will not
* be implicitly closed at the end of the last batch. It will only be closed at end
- * of the user query. This is useful in keeping the connection open for
+ * of the user query.
+ * <p>
+ * The engine will already detect situations when the connection should stay open for
* LOB (clob/blob/xml) streaming.
+ * <p>
+ * Keeping the execution alive unnecessarily may cause issues with connection usage
+ * as the connection instance may not be usable by other queries.
+ *
* @param alive
*/
void keepExecutionAlive(boolean alive);
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -753,7 +753,7 @@
try {
if (className == null) {
if (defaultClass == null) {
- throw new TranslatorException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
+ throw new TranslatorException("Neither class name nor default class specified to create an instance"); //$NON-NLS-1$
}
return expectedType.cast(defaultClass.newInstance());
}
@@ -777,4 +777,12 @@
public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException {
}
+
+ /**
+ * Indicates if LOBs are usable after the execution is closed.
+ * @return true if LOBs can be used after close
+ */
+ public boolean areLobsUsableAfterClose() {
+ return false;
+ }
}
Modified: trunk/api/src/main/java/org/teiid/translator/TranslatorException.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/TranslatorException.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/java/org/teiid/translator/TranslatorException.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -49,13 +49,16 @@
}
public TranslatorException( String errorCode, String message ) {
- super( message, errorCode);
+ super( errorCode, message);
}
public TranslatorException( int errorCode, String message ) {
super(message, Integer.toString(errorCode));
- }
+ }
+ public TranslatorException(Throwable e, int errorCode, String message ) {
+ super(e, Integer.toString(errorCode), message);
+ }
/**
* Construct an instance from a message and an exception to chain to this one.
Modified: trunk/api/src/main/resources/org/teiid/connector/i18n.properties
===================================================================
--- trunk/api/src/main/resources/org/teiid/connector/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/api/src/main/resources/org/teiid/connector/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -20,52 +20,15 @@
# 02110-1301 USA.
#
-ConnectionPool.The_value__6=The value "{0}" is illegal for property "{1}".
-ConnectionPool.The_conn_value=The max connections property value must be greater than 0; {0} is invalid value.
-ConnectionPool.No_connection_pool_available._8=No connection pool is available.
-ConnectionPool.Timeout_while_waiting_to_obtain_connection_for__9=The connection pool for identity "{0}" is at the maximum connection count "{1}" and no connection became available in the timeout period. Consider increasing the number of connections allowed per identity or the wait time.
-ConnectionPool.Connection_pool_created_1=Connection pool created successfully
-ConnectionPool.Failed_close_a_connection__2=Failed to close a connection for {0}.
-ConnectionPool.Max_conn_reached=Connection pool reached maximum connection limit.
-ConnectionPool.Max_conn_per_id_reached=Connection pool reached maximum connection limit for an identifier pool.
-ConnectionPool.Shut_down=Shutting down connection pool: closing all connections.
-ConnectionPool.Removed_conn=Connection pool closed a connection for {0}.
-ConnectionPool.New_conn=Connection pool created a connection for {0}.
-ConnectionPool.ExceededConnections=The connection pool for identity "{0}" is at the maximum connection count "{1}" and no connection became available in the timeout period. Consider increasing the number of connections allowed per identity or the wait time.
-ConnectionPool.ExceededWait=The connection pool for identity "{0}" exceeded wait time for connection, "{1}" ms, and no connection became available in the timeout period. Consider increasing the number of connections allowed per identity or the wait time.
-ConnectionPool.Closed_conn=Connection pool closed a connection.
-ConnectionPool.Failed_close_conn=Failed to close a connection.
-ConnectionPool.Timeout_while_waiting_to_obtain_connection=Timeout while waiting to obtain a connection.
-CollectionVisitor.The_visitor_collection_must_contain_at_least_one_visitor._1=The visitor collection must contain at least one visitor.
-CollectionVisitor.All_the_objects_in_the_collection_must_be_LanguageObjectVisitors._2=All the objects in the collection must be LanguageObjectVisitors.
DelegatingHierarchyVisitor.The_pre-_and_post-processing_visitors_cannot_both_be_null._1=The pre- and post-processing visitors cannot both be null.
-CredentialMap.Null_input=Null credentials input string.
-CredentialMap.Empty_input=Empty credentials input string. Expected "(".
-CredentialMap.Missing_parens=Credentials input string must be enclosed in ()''s
-CredentialMap.Missing_system_prop=Credentials string must contain "system" property.
-BasicValueReference_error=Error occurred during creating the value chunk for the value reference object.
-BasicValueReference_walkbackerror=Walking the results backwards is not supported in this implementation of Value reference, Please provide a custom value reference implementation.
-JDBCTranslator.Retrieved_Blob_is_too_large_13=Retrieved Blob is too large, Blobs have a max size of {0} bytes.
-JDBCTranslator.Error_determining_blob_length___15=Error determining blob length: {0}
-JDBCTranslator.Retrieved_Clob_is_too_large__18=Retrieved Clob is too large, Clobs have a max size of {0}
-JDBCTranslator.Error_determining_clob_length___20=Error determining clob length: {0}
-ClobToStringTranslator.0=Unexpected value type in Clob to String translator: {0}
-JDBCTranslator.Unable_to_translate_data_value__11=Unable to translate data value from {0} to expected type {1}
-ValueTranslator.no_tranfrom_found=To Suitable transform found to convert {0} type value to {1}
-unknown_object_type_to_tranfrom_xml=Unknown object type supplied to transform into SQLXML.
-UserIdentityFactory.single_identity_not_supported=Single identity is not supported by the UserIdentityFactory. A context is required.
-UserIdentityFactory.extraction_error=Unable to extract credentials from command payload or trusted session payload for per-user connection.
-UserIdentityFactory.missing_credentials=Payload missing credentials for {0}
MetadataFactory.unknown_datatype=Unknown datatype {0}
MetadataFactory.no_column_found=No column found with name {0}
-MetadataFactory.duplicate_name="Non-uniquely named record detected ''{0}''
MetadataFactory.invalid_name=Invalid column name ''{0}'', cannot contain the . character.
-WrappedConnection.no_metadata=Connector is not capable of providing metadata. Extend connector with MetadataProvider interface
\ No newline at end of file
Modified: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -12,6 +12,7 @@
<moduleSets>
<moduleSet>
<includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.jboss.teiid:teiid-adminshell</include>
@@ -39,7 +40,7 @@
<fileSets>
<fileSet>
- <directory>build/target/kits/adminshell</directory>
+ <directory>target/kits/adminshell</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*.sh</include>
@@ -48,7 +49,7 @@
</fileSet>
<fileSet>
- <directory>build/target/kits/adminshell</directory>
+ <directory>target/kits/adminshell</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
@@ -57,7 +58,7 @@
</fileSet>
<fileSet>
- <directory>target/distribution</directory>
+ <directory>target</directory>
<includes>
<include>teiid-${version}-client.jar</include>
</includes>
@@ -69,9 +70,9 @@
<files>
<file>
- <source>target/distribution/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
+ <source>target/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
<fileMode>0644</fileMode>
</file>
</files>
-</assembly>
\ No newline at end of file
+</assembly>
Deleted: trunk/build/assembly/bin.xml
===================================================================
--- trunk/build/assembly/bin.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/bin.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,35 +0,0 @@
-<!--This script builds a JAR for a Teiid Embedded Server Installation -->
-<assembly>
-
- <id>bin</id>
-
- <formats>
- <format>zip</format>
- </formats>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <includes>
- <include>*.txt</include>
- </includes>
- <useDefaultExcludes>true</useDefaultExcludes>
- </fileSet>
- </fileSets>
-
- <moduleSets>
- <moduleSet>
- <includeSubModules>true</includeSubModules>
- <binaries>
- <includeDependencies>false</includeDependencies>
- <unpack>false</unpack>
- <outputDirectory></outputDirectory>
- <includes>
- <include>:jar:*</include>
- </includes>
- </binaries>
- </moduleSet>
- </moduleSets>
-
-</assembly>
\ No newline at end of file
Modified: trunk/build/assembly/client-jar.xml
===================================================================
--- trunk/build/assembly/client-jar.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/client-jar.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -13,7 +13,8 @@
<moduleSets>
<moduleSet>
<includeSubModules>true</includeSubModules>
-
+ <useAllReactorProjects>true</useAllReactorProjects>
+
<includes>
<include>org.jboss.teiid:teiid-client</include>
<include>org.jboss.teiid:teiid-common-core</include>
Modified: trunk/build/assembly/docs.xml
===================================================================
--- trunk/build/assembly/docs.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/docs.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -12,7 +12,8 @@
<moduleSets>
<moduleSet>
<includeSubModules>true</includeSubModules>
-
+ <useAllReactorProjects>true</useAllReactorProjects>
+
<includes>
<include>org.jboss.teiid.documentation:admin-guide</include>
<include>org.jboss.teiid.documentation:reference</include>
Modified: trunk/build/assembly/jboss-container/dist.xml
===================================================================
--- trunk/build/assembly/jboss-container/dist.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/jboss-container/dist.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -13,7 +13,7 @@
<fileSets>
<fileSet>
- <directory>build/target/kits/jboss-container</directory>
+ <directory>target/kits/jboss-container</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*.sh</include>
@@ -23,7 +23,7 @@
</fileSet>
<fileSet>
- <directory>build/target/kits/jboss-container</directory>
+ <directory>target/kits/jboss-container</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
@@ -34,7 +34,7 @@
<!-- only true dependency file for any client -->
<fileSet>
- <directory>target/distribution</directory>
+ <directory>target</directory>
<includes>
<include>teiid-${version}-client.jar</include>
</includes>
@@ -44,7 +44,7 @@
</fileSet>
<fileSet>
- <directory>client/src/main/resources</directory>
+ <directory>../client/src/main/resources</directory>
<includes>
<include>vdb-deployer.xsd</include>
</includes>
@@ -70,32 +70,32 @@
<files>
<file>
- <source>target/distribution/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
+ <source>target/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
- <source>target/distribution/teiid-${version}-docs/reference/en-US/pdf/teiid_reference.pdf</source>
+ <source>target/teiid-${version}-docs/reference/en-US/pdf/teiid_reference.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
- <source>target/distribution/teiid-${version}-docs/quick-start-example/en-US/pdf/teiid_quick_start_example.pdf</source>
+ <source>target/teiid-${version}-docs/quick-start-example/en-US/pdf/teiid_quick_start_example.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
- <source>target/distribution/teiid-${version}-docs/developer-guide/en-US/pdf/teiid_developer_guide.pdf</source>
+ <source>target/teiid-${version}-docs/developer-guide/en-US/pdf/teiid_developer_guide.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
- <source>target/distribution/teiid-${version}-docs/client-developers-guide/en-US/pdf/teiid_client_developers_guide.pdf</source>
+ <source>target/teiid-${version}-docs/client-developers-guide/en-US/pdf/teiid_client_developers_guide.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
- <source>target/distribution/teiid-${version}-docs/caching-guide/en-US/pdf/teiid_caching_guide.pdf</source>
+ <source>target/teiid-${version}-docs/caching-guide/en-US/pdf/teiid_caching_guide.pdf</source>
<outputDirectory>teiid-docs</outputDirectory>
<fileMode>0644</fileMode>
</file>
@@ -104,7 +104,9 @@
<!-- these have external dependent clients like connectors-->
<moduleSets>
+
<moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.jboss.teiid:teiid-hibernate-dialect</include>
</includes>
@@ -118,6 +120,7 @@
<!-- These are Teiid internal dependencies; to make JCA work -->
<moduleSet>
<includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.jboss.teiid:teiid-jboss-integration</include>
@@ -142,7 +145,8 @@
<!-- These are built in connectors -->
<moduleSet>
<includeSubModules>true</includeSubModules>
-
+ <useAllReactorProjects>true</useAllReactorProjects>
+
<includes>
<include>org.jboss.teiid.connectors:connector-file:rar</include>
<include>org.jboss.teiid.connectors:connector-ldap:rar</include>
@@ -171,7 +175,8 @@
<!-- These are built in translators -->
<moduleSet>
<includeSubModules>true</includeSubModules>
-
+ <useAllReactorProjects>true</useAllReactorProjects>
+
<includes>
<include>org.jboss.teiid.connectors:translator-jdbc</include>
<include>org.jboss.teiid.connectors:translator-loopback</include>
@@ -201,7 +206,8 @@
<!-- Include the JOPR plugin -->
<moduleSet>
<includeSubModules>true</includeSubModules>
-
+ <useAllReactorProjects>true</useAllReactorProjects>
+
<includes>
<include>org.jboss.teiid:teiid-console</include>
</includes>
@@ -215,4 +221,4 @@
</moduleSet>
</moduleSets>
-</assembly>
\ No newline at end of file
+</assembly>
Modified: trunk/build/assembly/src.xml
===================================================================
--- trunk/build/assembly/src.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/assembly/src.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -11,7 +11,7 @@
<fileSets>
<fileSet>
- <directory>${project.basedir}</directory>
+ <directory>${project.basedir}/..</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>teiid</outputDirectory>
<excludes>
Modified: trunk/build/kits/adminshell/connection.properties
===================================================================
--- trunk/build/kits/adminshell/connection.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/adminshell/connection.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -2,6 +2,6 @@
jdbc.password=teiid
jdbc.url=jdbc:teiid:admin@mm://localhost:31000;
-admin.url=mm://localhost:31443
+admin.url=mms://localhost:31443
admin.user=admin
admin.password=admin
Modified: trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
===================================================================
--- trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -62,7 +62,7 @@
-->
<!-- un-comment to enable Teiid COMMAND log
- <appender name="COMMAND" class="org.apache.log4j.RollingFileAppender">
+ <appender name="COMMAND" class="org.jboss.logging.appender.RollingFileAppender">
<param name="File" value="${jboss.server.log.dir}/teiid-command.log"/>
<param name="MaxFileSize" value="1000KB"/>
<param name="MaxBackupIndex" value="25"/>
Modified: trunk/build/kits/jboss-container/conf/props/teiid-security-roles.properties
===================================================================
--- trunk/build/kits/jboss-container/conf/props/teiid-security-roles.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/jboss-container/conf/props/teiid-security-roles.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,4 +1,3 @@
# A roles.properties file for use with the UsersRolesLoginModule
-# username=role1,role1.
-# allowed teiid admin roles (Admin.SystemAdmin, Admin.ProductAdmin, Admin.ReadOnlyAdmin)
-admin=Admin.SystemAdmin
+# username=role1,role2
+admin=admin
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -123,7 +123,14 @@
</bean>
<bean name="JdbcSslConfiguration" class="org.teiid.transport.SSLConfiguration">
- <property name="sslEnabled">false</property>
+ <!-- can be one of disabled, login, or enabled
+ disabled = no transport or message level security will be used
+ login = only the login traffic will be encrypted at a message level
+ using 128 bit AES with an ephemerial DH key exchange.
+ No other config values are needed in this mode
+ enabled = traffic will be secured using this configuration
+ -->
+ <property name="mode">login</property>
<property name="keystoreFilename">cert.keystore</property>
<property name="keystorePassword">passwd</property>
<property name="keystoreType">JKS</property>
@@ -133,7 +140,6 @@
<property name="truststorePassword">passwd</property>
<!-- 1-way, 2-way, anonymous -->
<property name="authenticationMode">1-way</property>
- <property name="clientEncryptionEnabled">true</property>
</bean>
<!-- Admin Socket connection settings (SSL see below) -->
@@ -151,7 +157,14 @@
</bean>
<bean name="AdminSslConfiguration" class="org.teiid.transport.SSLConfiguration">
- <property name="sslEnabled">false</property>
+ <!-- can be one of disabled, login, or enabled
+ disabled = no transport or message level security will be used
+ login = only the login traffic will be encrypted at a message level
+ using 128 bit AES with an ephemerial DH key exchange.
+ No other config values are needed in this mode
+ enabled = traffic will be secured using this configuration
+ -->
+ <property name="mode">enabled</property>
<property name="keystoreFilename">cert.keystore</property>
<property name="keystorePassword">passwd</property>
<property name="keystoreType">JKS</property>
@@ -161,7 +174,6 @@
<property name="truststorePassword">passwd</property>
<!-- 1-way, 2-way, anonymous -->
<property name="authenticationMode">anonymous</property>
- <property name="clientEncryptionEnabled">true</property>
</bean>
<!-- JDBC Socket connection properties (SSL see below) -->
@@ -179,7 +191,11 @@
</bean>
<bean name="OdbcSslConfiguration" class="org.teiid.transport.SSLConfiguration">
- <property name="sslEnabled">false</property>
+ <!-- can be one of disabled or enabled
+ disabled = no transport or message level security will be used
+ enabled = traffic will be secured using this configuration
+ -->
+ <property name="mode">disabled</property>
<property name="keystoreFilename">cert.keystore</property>
<property name="keystorePassword">passwd</property>
<property name="keystoreType">JKS</property>
@@ -189,7 +205,6 @@
<property name="truststorePassword">passwd</property>
<!-- 1-way, 2-way, anonymous -->
<property name="authenticationMode">1-way</property>
- <property name="clientEncryptionEnabled">true</property>
</bean>
<!-- teiid's default security domain, replace this with your own if needs to be any other JAAS domain -->
Modified: trunk/build/kits/jboss-container/teiid-examples/jca/ldap-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/jca/ldap-ds.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/jboss-container/teiid-examples/jca/ldap-ds.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -7,7 +7,7 @@
<jndi-name>ldapDS</jndi-name>
<!-- The resource archive file that defines JCA connection for Sales Force (do not change this) -->
- <rar-name>teiid-connector-file.rar</rar-name>
+ <rar-name>teiid-connector-ldap.rar</rar-name>
<!-- connection interface; (do not change this) -->
<connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
Deleted: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Added: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
===================================================================
(Binary files differ)
Property changes on: trunk/build/kits/jboss-container/teiid-examples/simpleclient/JDBCClient.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-09-24 18:51:07 UTC (rev 2603)
@@ -26,12 +26,15 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
+ <LI><B>Transaction Statements</B> - JDBC/ODBC now accepts START TRANSACTION, COMMIT, and ROLLBACK statements to control local transactions.
<LI><B>Procedure Result Caching</B> - virtual procedure definitions may use a cache hint to cache results in the result set cache.
<LI><B>Improved Plan Caching</B> - plans used by internal materialization and stored procedure plans will be automatically cached in the prepared plan cache. Improvements were also made to reduce the memory footprint of the plans.
<LI><B>Refined Load Balancing and Fail Over</B> - clients can use use the statement "SET NEWINSTANCE TRUE" to allow their connection to select a new server instance. See the Client Developer's Guide for more information.
<LI><B>Simplified Role Usage</B> - a role can now be assigned to any authenticated user via the any-authenticated attribute on the data-role element.
<LI><B>Materialized View Performance</B> - materialized view tables will now automatically create and use non-unique secondary indexes for unique constraints and indexes defined on the view.
- <LI><B>Binary Web Service Calls</B> - the ws translator now provides an invokeHttp procedure to return the blob contents and string content type of an http/https call.
+ <LI><B>Binary Web Service Calls</B> - the ws translator now provides an invokeHttp procedure to return the blob contents and string content type of an http/https call.
+ <LI><B>Improved clustering support</B> - see the Admin Guide chapter on clustering.
+ <LI><B>IPv6 support</B> - Teiid can started using IPv6 bind address and can be used with JDBC connection.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -40,6 +43,9 @@
</ul>
<h4>from 7.1</h4>
<ul>
+ <li>The SYSADMIN schema was created to hold procedures and tables that should not be generally accessible. SYS and pg_catalog are now always accessible - permissions do not apply to these schemas. The SYS.getBinaryVDBResource, SYS.getCharacterVDBResource, and SYS.getVDBResourcePaths have been replaced with the
+ SYSADMIN.VDBResources table. The Matviews table and the refreshMatView/refreshMatViewRow procedures were also moved into SYSADMIN.
+ <li>Overwriting an existing VDB will cause old connections to be terminated. Production systems should rely on VDB versioning.
<li>The jdbc:metamatrix JDBC URL prefix is no longer accepted. Use jdbc:teiid instead.
<li>Model visibility no longer restricts access to tables and procedures. Setting visible to false will only hide entries from system tables. Data roles should be used to restrict data access.
</ul>
@@ -75,6 +81,11 @@
<h4>from 7.1</h4>
<ul>
+ <li>Teiid clients now allow the usage of anonymous SSL by default.
+ This changes allows the admin port (default 31443) to use anonymous SSL by default, rather than just securing login traffic.
+ Admin clients should therefore use the mms protocol instead of mm. This will encrypt all admin traffic and ensure that any passwords in configuration files will
+ be encrypted in transit. See the Admin Guide to upgrade from anonymous SSL to 1-way or 2-way authentication.
+ The config properties sslEnabled and clientEncryptionEnabled for SSLConfiguration beans have been combined to a single property mode, that can have the values disabled|login|enabled.
<li>Apache CXF is now expected to be used as the web services stack provider through JBossWS-CXF. See the Admin Guide for instructions on
installing CXF for use with Teiid's Salesforce and web service connectors. The WS Resource Adapter's -ds.xml files should no longer use
WSSecurityConfigURL and WSSecurityConfigName, rather they should be ConfigFile and ConfigName respectively. The property values should no longer
@@ -117,6 +128,10 @@
<h2><a name="LibraryUpdates">Thirdparty Library Updates</a></h2>
The following components have been updated:
+<h4>From 7.1</h4>
+<ul>
+ <li>Netty was upgraded to 3.2.1
+</ul>
<h4>From 7.0</h4>
<ul>
<li>Direct integration of JBossCache jars was removed.
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/build/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>build</artifactId>
+ <artifactId>teiid</artifactId>
<name>Build</name>
<description>Teiid Build</description>
<build>
@@ -34,5 +34,60 @@
</excludes>
</resource>
</resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+
+ <configuration>
+ <descriptors>
+ <descriptor>assembly/client-jar.xml</descriptor>
+ <descriptor>assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>create-assemblies</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
+
+ <profiles>
+ <profile>
+ <!--
+ This profile is activated manually, as in "mvn ... -P release ..."
+ -->
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>assembly/src.xml</descriptor>
+ <descriptor>assembly/docs.xml</descriptor>
+ <descriptor>assembly/client-jar.xml</descriptor>
+ <descriptor>assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/cache-jbosscache/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -89,4 +89,12 @@
public void setCacheManager(String mgrName) {
this.cacheManagerName = mgrName;
}
+
+ @Override
+ public boolean isReplicated() {
+ if (delegate == null) {
+ return false;
+ }
+ return delegate.isReplicated();
+ }
}
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -128,4 +128,15 @@
void setCacheConfiguration(CacheConfiguration config) {
this.config = config;
}
+
+ @Override
+ public Set<K> keys() {
+ HashSet keys = new HashSet();
+ Node<K, V> node = getRootNode();
+ Set<Node<K, V>> children = node.getChildren();
+ for (Node<K, V> child:children) {
+ keys.addAll(child.getData().keySet());
+ }
+ return keys;
+ }
}
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -113,4 +113,9 @@
public void stop() {
destroy();
}
+
+ @Override
+ public boolean isReplicated() {
+ return true;
+ }
}
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -234,21 +234,30 @@
*
* @param vdbName
* @param vdbVersion
- * @param policyName
- * @param role
+ * @param dataRole
+ * @param mappedRoleName
*/
- void addDataRoleMapping(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
+ void addDataRoleMapping(String vdbName, int vdbVersion, String dataRole, String mappedRoleName) throws AdminException;
/**
- * Assign a Role name to the Data Role in a given VDB
+ * Remove a Role name to the Data Role in a given VDB
*
* @param vdbName
* @param vdbVersion
- * @param policyName
- * @param role
+ * @param dataRole
+ * @param mappedRoleName
*/
- void removeDataRoleMapping(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
+ void removeDataRoleMapping(String vdbName, int vdbVersion, String dataRole, String mappedRoleName) throws AdminException;
+ /**
+ * Set the any authenticated flag on the Data Role in a given VDB
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param dataRole
+ * @param anyAuthenticated
+ */
+ void setAnyAuthenticatedForDataRole(String vdbName, int vdbVersion, String dataRole, boolean anyAuthenticated) throws AdminException;
/**
* Merge the Source VDB into Target VDB. Both Source and Target VDBs must be present for this method to
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,9 +32,9 @@
import org.teiid.client.util.ExceptionUtil;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.PropertiesUtils;
+import org.teiid.jdbc.JDBCPlugin;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
-import org.teiid.net.NetPlugin;
import org.teiid.net.ServerConnection;
import org.teiid.net.ServerConnectionFactory;
import org.teiid.net.TeiidURL;
@@ -53,18 +53,16 @@
private Admin target;
private ServerConnection registry;
- private Properties p;
private boolean closed;
public AdminProxy(Properties p) throws ConnectionException, CommunicationException {
- this.p = p;
this.registry = serverConnectionFactory.getConnection(p);
this.target = registry.getService(Admin.class);
}
private synchronized Admin getTarget() throws AdminComponentException {
if (closed) {
- throw new AdminComponentException(NetPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
+ throw new AdminComponentException(JDBCPlugin.Util.getString("admin_conn_closed")); //$NON-NLS-1$
}
return target;
}
@@ -76,6 +74,9 @@
close();
return null;
}
+ if (!method.getDeclaringClass().equals(Admin.class)) {
+ return method.invoke(this, args);
+ }
try {
return method.invoke(getTarget(), args);
} catch (InvocationTargetException e) {
@@ -186,7 +187,7 @@
String applicationName) throws AdminException {
if (userName == null || userName.trim().length() == 0) {
- throw new IllegalArgumentException(NetPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
+ throw new IllegalArgumentException(JDBCPlugin.Util.getString("invalid_parameter")); //$NON-NLS-1$
}
final Properties p = new Properties();
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ListOverMap.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright (C) 2008 Red Hat, Inc.
- * Copyright (C) 2000-2007 MetaMatrix, Inc.
* Licensed to Red Hat, Inc. under one or more contributor
* license agreements. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/PermissionMap.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/PermissionMap.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/PermissionMap.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright (C) 2008 Red Hat, Inc.
- * Copyright (C) 2000-2007 MetaMatrix, Inc.
* Licensed to Red Hat, Inc. under one or more contributor
* license agreements. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/SourceMappingMetadata.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright (C) 2008 Red Hat, Inc.
- * Copyright (C) 2000-2007 MetaMatrix, Inc.
* Licensed to Red Hat, Inc. under one or more contributor
* license agreements. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -285,8 +285,13 @@
}
public String toString() {
- return getName()+VERSION_DELIM+getVersion()+ models.getMap().values(); //$NON-NLS-1$
+ return getName()+VERSION_DELIM+getVersion()+ models.getMap().values();
}
+
+ public boolean isVisible(String modelName) {
+ ModelMetaData model = getModel(modelName);
+ return model == null || model.isVisible();
+ }
public ModelMetaData getModel(String modelName) {
return this.models.getMap().get(modelName);
Modified: trunk/client/src/main/java/org/teiid/client/BatchSerializer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/BatchSerializer.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/client/BatchSerializer.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,7 @@
import java.util.Map;
import org.teiid.core.types.DataTypeManager;
-import org.teiid.net.NetPlugin;
+import org.teiid.jdbc.JDBCPlugin;
@@ -380,7 +380,7 @@
break objectSearch;
}
}
- throw new IOException(NetPlugin.Util.getString("BatchSerializer.datatype_mismatch", new Object[] {types[i], new Integer(i), objectClass})); //$NON-NLS-1$
+ throw new IOException(JDBCPlugin.Util.getString("BatchSerializer.datatype_mismatch", new Object[] {types[i], new Integer(i), objectClass})); //$NON-NLS-1$
}
}
}
Modified: trunk/client/src/main/java/org/teiid/client/RequestMessage.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,7 +33,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.ExternalizeUtil;
-import org.teiid.net.NetPlugin;
+import org.teiid.jdbc.JDBCPlugin;
/**
@@ -221,7 +221,7 @@
if (!(txnAutoWrapMode.equals(TXN_WRAP_OFF)
|| txnAutoWrapMode.equals(TXN_WRAP_ON)
|| txnAutoWrapMode.equals(TXN_WRAP_DETECT))) {
- throw new TeiidProcessingException(NetPlugin.Util.getString("RequestMessage.invalid_txnAutoWrap", txnAutoWrapMode)); //$NON-NLS-1$
+ throw new TeiidProcessingException(JDBCPlugin.Util.getString("RequestMessage.invalid_txnAutoWrap", txnAutoWrapMode)); //$NON-NLS-1$
}
}
this.txnAutoWrapMode = txnAutoWrapMode;
Modified: trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -29,7 +29,7 @@
import org.teiid.client.DQP;
import org.teiid.core.TeiidException;
import org.teiid.core.types.Streamable;
-import org.teiid.net.NetPlugin;
+import org.teiid.jdbc.JDBCPlugin;
public class StreamingLobChunckProducer implements LobChunkProducer {
@@ -71,7 +71,7 @@
Future<LobChunk> result = dqp.requestNextLobChunk(streamRequestId, requestId, streamable.getReferenceStreamId());
return result.get();
} catch (Exception e) {
- IOException ex = new IOException(NetPlugin.Util.getString("StreamImpl.Unable_to_read_data_from_stream", e.getMessage())); //$NON-NLS-1$
+ IOException ex = new IOException(JDBCPlugin.Util.getString("StreamImpl.Unable_to_read_data_from_stream", e.getMessage())); //$NON-NLS-1$
ex.initCause(e);
throw ex;
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -383,13 +383,6 @@
}
}
- /**
- * <p>This creates a MMStatement object for sending SQL statements to the MetaMatrix
- * server. This should be used for statements without parameters. For statements
- * that are executed many times, use the PreparedStatement object.</p>
- * @return a Statement object.
- * @throws a SQLException if a MetaMatrix server access error occurs.
- */
public Statement createStatement() throws SQLException {
return createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
}
@@ -439,14 +432,6 @@
}
}
- /**
- * <p>This method returns the current status of the connection in regards to it's
- * auto-commit state. By default, the auto-commit is set to true. Meaning that
- * any transaction that occurs is automatically commited to the MetaMatrix server.
- * #See corresponding setAutoCommit() method.</p>
- * @return true if the statements on this connection get committed on execution.
- * @throws SQLException should never happen
- */
public boolean getAutoCommit() throws SQLException {
//Check to see the connection is open
checkConnection();
@@ -563,26 +548,10 @@
return closed;
}
- /**
- * <p>This method will return whether this connection is read only or not.
- * It will throw a SQLException if a MetaMatrix server access error occurs.
- * @return boolean value indication if connection is readonly
- * @throws SQLException, should never occur
- */
public boolean isReadOnly() throws SQLException {
return readOnly;
}
- /**
- * <p>This method will convert the given SQL String into a MetaMatrix SQL Request.
- * This will convert any date escape sequences into the appropriate MetaMatrix
- * type, and any kind of data transformations that the MetaMatrix server would
- * expect. This method returns the native form of the statement that the driver
- * would have sent.</p>
- * @param sql string to be coverted into SQL understood by metamatrix
- * @return uncoverted sql string(escape parsing takesplace in metamatrix)
- * @throws SQLException, should never occur
- */
public String nativeSQL(String sql) throws SQLException {
// return the string argument without any modifications.
// escape syntaxes are directly supported in the server
@@ -639,16 +608,6 @@
}
}
- /**
- * <p>This method creates a MMPreparedStatement which is used for sending parameterized
- * SQL statements to the MetaMatrix server. A statement with or without IN parameters
- * can be pre-compiled and stored in a MMPreparedStatement object. Since the MetaMatrix
- * server does not pre-compile statements, a sql statement will be constructed using the
- * parameters supplied which would be used for execution of this preparedStatement object.</p>
- * @param sql string representing a prepared statement
- * @return a PreparedStatement object
- * @throws SQLException if there is an error creating a prepared statement object
- */
public PreparedStatementImpl prepareStatement(String sql) throws SQLException {
return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
}
@@ -676,34 +635,21 @@
return newStatement;
}
- /**
- * <p>This method creates a MMPreparedStatement which is used for sending parameterized
- * SQL statements to the MetaMatrix server and it has the capability to retrieve auto-generated keys.</p>
- * @param sql string representing a prepared statement
- * @param intValue indicating the result set Type
- * @param intValue indicating the result set concurrency
- * @param intValue indicating the result set holdability
- * @return a PreparedStatement object
- * @throws SQLException if there is an error creating a prepared statement object
- */
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability ) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- /**
- * <p>This method will drop all changes made since the beginning of the transaction
- * and release any MetaMatrix server locks currently held by this connection. This
- * method rolls back transactions on all the statements currently open on this connection.
- * This is used when then auto-commit has been disabled.</p>
- * @see setAutoCommit(boolean) method for more information.
- * @throws SQLException if there is an error rolling back.
- */
public void rollback() throws SQLException {
rollback(true);
}
-
- void rollback(boolean startTxn) throws SQLException {
+
+ /**
+ * Rollback the current local transaction
+ * @param startTxn
+ * @throws SQLException
+ */
+ public void rollback(boolean startTxn) throws SQLException {
//Check to see the connection is open
checkConnection();
@@ -727,17 +673,6 @@
}
}
- /**
- * <p>This method will set the connection's auto commit mode accordingly. By
- * default this is set to true (auto-commit is turned on). An auto-commit
- * value of true means any statements will automatically be made permanent if
- * they are successful after the last row of the ReulstSet has been retrieved
- * or the next execute occurs, whichever comes first. If set to false, changes
- * can be either be committed (using the commit() method) or rolled back ("undo
- * the changes" by using the rollback() method).</p>
- * @param boolean value indicating if autoCommit is turned on
- * @throws SQLException is metamatrix access error occurs.
- */
public void setAutoCommit(boolean autoCommit) throws SQLException {
//Check to see the connection is open
checkConnection();
@@ -756,7 +691,7 @@
}
/**
- * <p>Metamatrix does not allow setting a catalog through a connection. This
+ * <p>Teiid does not allow setting a catalog through a connection. This
* method silently ignores the request as per the specification.</p>
* @param The string values which sets the catalog name on the connection.
* @throws SQLException This should never occur.
Modified: trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -60,7 +60,7 @@
*/
// This host/port pattern allows just a . or a - to be in the host part.
- static final String HOST_PORT_PATTERN = "[\\p{Alnum}\\.\\-\\_]+:\\d+"; //$NON-NLS-1$
+ static final String HOST_PORT_PATTERN = "\\[?[\\p{Alnum}\\.\\-\\_:]+\\]?:\\d+"; //$NON-NLS-1$
static final String URL_PATTERN = "jdbc:teiid:([\\w-\\.]+)@mm[s]?://"+HOST_PORT_PATTERN+"(,"+HOST_PORT_PATTERN+")*(;.*)?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static Pattern urlPattern = Pattern.compile(URL_PATTERN);
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.jdbc;
import java.io.Serializable;
-import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
@@ -63,6 +62,7 @@
import org.teiid.core.types.JDBCSQLTypeInfo;
import org.teiid.core.types.SQLXMLImpl;
import org.teiid.core.util.SqlUtil;
+import org.teiid.core.util.StringUtil;
public class StatementImpl extends WrapperImpl implements TeiidStatement {
@@ -144,8 +144,9 @@
//Map<out/inout/return param index --> index in results>
protected Map outParamIndexMap = new HashMap();
- private static Pattern SET_STATEMENT = Pattern.compile("\\s*set\\s*(\\w+)\\s*(\\w*)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
- private static Pattern SHOW_STATEMENT = Pattern.compile("\\s*show\\s*(\\w*)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+ private static Pattern TRANSACTION_STATEMENT = Pattern.compile("\\s*(commit|rollback|(start\\s*transaction))\\s*;?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+ private static Pattern SET_STATEMENT = Pattern.compile("\\s*set\\s*(\\w+)\\s*(\\w*);?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+ private static Pattern SHOW_STATEMENT = Pattern.compile("\\s*show\\s*(\\w*);?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
/**
* Factory Constructor
* @param driverConnection
@@ -403,6 +404,22 @@
this.updateCounts = new int[] {0};
return;
}
+ match = TRANSACTION_STATEMENT.matcher(commands[0]);
+ if (match.matches()) {
+ if (resultsMode == ResultsMode.RESULTSET) {
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
+ }
+ String command = match.group(1);
+ if (StringUtil.startsWithIgnoreCase(command, "start")) { //$NON-NLS-1$
+ this.getConnection().setAutoCommit(false);
+ } else if (command.equalsIgnoreCase("commit")) { //$NON-NLS-1$
+ this.getConnection().setAutoCommit(true);
+ } else if (command.equalsIgnoreCase("rollback")) { //$NON-NLS-1$
+ this.getConnection().rollback(false);
+ }
+ this.updateCounts = new int[] {0};
+ return;
+ }
match = SHOW_STATEMENT.matcher(commands[0]);
if (match.matches()) {
if (resultsMode == ResultsMode.UPDATECOUNT) {
@@ -996,7 +1013,7 @@
checkStatement();
}
- public Connection getConnection() throws SQLException {
+ public ConnectionImpl getConnection() throws SQLException {
return this.driverConnection;
}
@@ -1044,7 +1061,7 @@
public void setMaxFieldSize(int max) throws SQLException {
checkStatement();
if ( max < 0 ) {
- throw new TeiidSQLException(JDBCPlugin.Util.getString("MMStatement.Invalid_field_size")); //$NON-NLS-1$
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("MMStatement.Invalid_field_size", max)); //$NON-NLS-1$
}
this.maxFieldSize = max;
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -136,23 +136,42 @@
// Format: "mm://server1:port,server2:port,..."
String serverURL = ""; //$NON-NLS-1$
- serverURL = "" + ( this.secure ? TeiidURL.SECURE_PROTOCOL : TeiidURL.DEFAULT_PROTOCOL ); //$NON-NLS-1$
- serverURL += "" + this.serverName; //$NON-NLS-1$
+ serverURL = "" + ( this.secure ? TeiidURL.SECURE_PROTOCOL : TeiidURL.DEFAULT_PROTOCOL ); //$NON-NLS-1$
+
+ if (this.serverName.indexOf(':') != -1) {
+ serverURL += "["; //$NON-NLS-1$
+ }
+
+ serverURL += "" + this.serverName; //$NON-NLS-1$
+
+ if (this.serverName.indexOf(':') != -1) {
+ serverURL += "]"; //$NON-NLS-1$
+ }
+
if ( this.portNumber != 0 )
- serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
+ serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
+
if ( this.alternateServers.length() > 0 ) {
String[] as = this.alternateServers.split( TeiidURL.COMMA_DELIMITER);
- for ( int i = 0; i < as.length; i++ ) {
- String[] server = as[i].split( TeiidURL.COLON_DELIMITER );
-
- if ( server.length > 0 ) {
- serverURL += TeiidURL.COMMA_DELIMITER + server[0];
- if ( server.length > 1 ) {
- serverURL += TeiidURL.COLON_DELIMITER + server[1];
- } else {
- serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
- }
+ for ( int i = 0; i < as.length; i++ ) {
+ if (as[i].startsWith("[") && as[i].endsWith("]:")) { //$NON-NLS-1$ //$NON-NLS-2$
+ serverURL += (TeiidURL.COMMA_DELIMITER + as[i]);
+ }
+ else if (as[i].startsWith("[") && as[i].endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
+ serverURL += (TeiidURL.COMMA_DELIMITER +as[i] + TeiidURL.COLON_DELIMITER + this.portNumber);
+ }
+ else {
+ String[] server = as[i].split(TeiidURL.COLON_DELIMITER );
+
+ if ( server.length > 0 ) {
+ serverURL += TeiidURL.COMMA_DELIMITER + server[0];
+ if ( server.length > 1 ) {
+ serverURL += TeiidURL.COLON_DELIMITER + server[1];
+ } else {
+ serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
+ }
+ }
}
}
}
@@ -279,7 +298,7 @@
/**
* Returns a string containing a comma delimited list of alternate
- * MetaMatrix Server(s).
+ * server(s).
*
* The list will be in the form of server2[:port2][,server3[:port3]]. If no
* alternate servers have been defined <code>null</code> is returned.
Deleted: trunk/client/src/main/java/org/teiid/net/NetPlugin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/NetPlugin.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/net/NetPlugin.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,35 +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.net;
-
-import java.util.ResourceBundle;
-
-import org.teiid.core.BundleUtil;
-
-public class NetPlugin {
-
- public static final String PLUGIN_ID = NetPlugin.class.getPackage().getName();
-
- public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
- PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-}
Modified: trunk/client/src/main/java/org/teiid/net/TeiidURL.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/TeiidURL.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/net/TeiidURL.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -29,7 +29,9 @@
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
+import org.teiid.jdbc.JDBCPlugin;
+
/**
* Class defines the URL in the Teiid.
*
@@ -92,7 +94,7 @@
public static final String FORMAT_SERVER = "mm[s]://server1:port1[,server2:port2]"; //$NON-NLS-1$
- public static final String INVALID_FORMAT_SERVER = NetPlugin.Util.getString("MMURL.INVALID_FORMAT", new Object[] {FORMAT_SERVER}); //$NON-NLS-1$
+ public static final String INVALID_FORMAT_SERVER = JDBCPlugin.Util.getString("MMURL.INVALID_FORMAT", new Object[] {FORMAT_SERVER}); //$NON-NLS-1$
@@ -123,6 +125,9 @@
public TeiidURL(String host, int port, boolean secure) {
usingSSL = secure;
+ if(host.startsWith("[")) { //$NON-NLS-1$
+ host = host.substring(1, host.indexOf(']'));
+ }
hosts.add(new HostInfo(host, port));
}
@@ -230,13 +235,29 @@
throw new IllegalArgumentException(exceptionMessage);
}
while (st.hasMoreTokens()) {
- st2 = new StringTokenizer(st.nextToken(), COLON_DELIMITER);
+ String nextToken = st.nextToken();
try {
- String host = st2.nextToken().trim();
- String port = st2.nextToken().trim();
+ String host = ""; //$NON-NLS-1$
+ String port = ""; //$NON-NLS-1$
+ if (nextToken.startsWith("[")) { //$NON-NLS-1$
+ int hostEnd = nextToken.indexOf("]:"); //$NON-NLS-1$
+ host = nextToken.substring(1, hostEnd);
+ port = nextToken.substring(hostEnd+2);
+ }
+ else {
+ st2 = new StringTokenizer(nextToken, COLON_DELIMITER);
+ host = st2.nextToken().trim();
+ port = st2.nextToken().trim();
+ }
+
if (host.equals("")) { //$NON-NLS-1$
throw new IllegalArgumentException("hostname can't be empty"); //$NON-NLS-1$
}
+
+ if (port.equals("")) { //$NON-NLS-1$
+ throw new IllegalArgumentException("port can't be empty"); //$NON-NLS-1$
+ }
+
int portNumber;
try {
portNumber = Integer.parseInt(port);
@@ -248,11 +269,13 @@
}
HostInfo hostInfo = new HostInfo(host, portNumber);
hosts.add(hostInfo);
+
} catch (NoSuchElementException nsee) {
throw new IllegalArgumentException(exceptionMessage);
} catch (NullPointerException ne) {
throw new IllegalArgumentException(exceptionMessage);
}
+
}
}
@@ -273,7 +296,15 @@
Iterator<HostInfo> iter = hosts.iterator();
while (iter.hasNext()) {
HostInfo host = iter.next();
+
+ boolean ipv6HostName = host.getHostName().indexOf(':') != -1;
+ if (ipv6HostName) {
+ sb.append('[');
+ }
sb.append(host.getHostName());
+ if (ipv6HostName) {
+ sb.append(']');
+ }
sb.append(COLON_DELIMITER);
sb.append(host.getPortNumber());
if (iter.hasNext()) {
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -49,10 +49,10 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidException;
+import org.teiid.jdbc.JDBCPlugin;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
import org.teiid.net.HostInfo;
-import org.teiid.net.NetPlugin;
import org.teiid.net.ServerConnection;
import org.teiid.net.TeiidURL;
@@ -103,7 +103,7 @@
public synchronized SocketServerInstance selectServerInstance()
throws CommunicationException, ConnectionException {
if (closed) {
- throw new CommunicationException(NetPlugin.Util.getString("SocketServerConnection.closed")); //$NON-NLS-1$
+ throw new CommunicationException(JDBCPlugin.Util.getString("SocketServerConnection.closed")); //$NON-NLS-1$
}
if (this.serverInstance != null && (!failOver || this.serverInstance.isOpen())) {
return this.serverInstance;
@@ -145,7 +145,7 @@
if (e.getCause() instanceof CommunicationException) {
throw (CommunicationException)e.getCause();
}
- throw new CommunicationException(e, NetPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to")); //$NON-NLS-1$
+ throw new CommunicationException(e, JDBCPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to")); //$NON-NLS-1$
}
}
return this.serverInstance;
@@ -157,13 +157,13 @@
this.serverDiscovery.markInstanceAsBad(hostInfo);
if (knownHosts == 1) { //just a single host, use the exception
if (ex instanceof UnknownHostException) {
- throw new SingleInstanceCommunicationException(ex, NetPlugin.Util.getString("SocketServerInstance.Connection_Error.Unknown_Host", hostInfo.getHostName())); //$NON-NLS-1$
+ throw new SingleInstanceCommunicationException(ex, JDBCPlugin.Util.getString("SocketServerInstance.Connection_Error.Unknown_Host", hostInfo.getHostName())); //$NON-NLS-1$
}
- throw new SingleInstanceCommunicationException(ex,NetPlugin.Util.getString("SocketServerInstance.Connection_Error.Connect_Failed", hostInfo.getHostName(), String.valueOf(hostInfo.getPortNumber()), ex.getMessage())); //$NON-NLS-1$
+ throw new SingleInstanceCommunicationException(ex,JDBCPlugin.Util.getString("SocketServerInstance.Connection_Error.Connect_Failed", hostInfo.getHostName(), String.valueOf(hostInfo.getPortNumber()), ex.getMessage())); //$NON-NLS-1$
}
log.log(Level.FINE, "Unable to connect to host", ex); //$NON-NLS-1$
}
- throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstancePool.No_valid_host_available", hostCopy.toString())); //$NON-NLS-1$
+ throw new CommunicationException(JDBCPlugin.Util.getString("SocketServerInstancePool.No_valid_host_available", hostCopy.toString())); //$NON-NLS-1$
}
private ILogon connect(HostInfo hostInfo) throws CommunicationException,
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -52,9 +52,9 @@
import org.teiid.core.crypto.Cryptor;
import org.teiid.core.crypto.DhKeyGenerator;
import org.teiid.core.crypto.NullCryptor;
+import org.teiid.jdbc.JDBCPlugin;
import org.teiid.net.CommunicationException;
import org.teiid.net.HostInfo;
-import org.teiid.net.NetPlugin;
/**
@@ -112,7 +112,7 @@
Object obj = this.socketChannel.read();
if (!(obj instanceof Handshake)) {
- throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstanceImpl.handshake_error")); //$NON-NLS-1$
+ throw new CommunicationException(JDBCPlugin.Util.getString("SocketServerInstanceImpl.handshake_error")); //$NON-NLS-1$
}
handshake = (Handshake)obj;
break;
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -43,7 +43,8 @@
import javax.net.ssl.TrustManagerFactory;
import org.teiid.core.util.Assertion;
-import org.teiid.net.NetPlugin;
+import org.teiid.core.util.PropertiesUtils;
+import org.teiid.jdbc.JDBCPlugin;
@@ -61,14 +62,12 @@
static final String KEYSTORE_TYPE = "org.teiid.ssl.keyStoreType"; //$NON-NLS-1$
static final String KEYSTORE_PASSWORD = "org.teiid.ssl.keyStorePassword"; //$NON-NLS-1$
static final String KEYSTORE_FILENAME = "org.teiid.ssl.keyStore"; //$NON-NLS-1$
+ public static final String ALLOW_ANON = "org.teiid.ssl.allowAnon"; //$NON-NLS-1$
- static final String DEFAULT_KEYSTORE_PROTOCOL = "SSLv3"; //$NON-NLS-1$
static final String DEFAULT_KEYSTORE_TYPE = "JKS"; //$NON-NLS-1$
- public static final String NONE = "none"; //$NON-NLS-1$
-
public static final String ANON_CIPHER_SUITE = "TLS_DH_anon_WITH_AES_128_CBC_SHA"; //$NON-NLS-1$
- public static final String ANON_PROTOCOL = "TLS"; //$NON-NLS-1$
+ public static final String DEFAULT_PROTOCOL = "TLSv1"; //$NON-NLS-1$
public static class SSLSocketFactory {
private boolean isAnon;
@@ -93,23 +92,20 @@
String keystore = props.getProperty(KEYSTORE_FILENAME);
String keystorePassword = props.getProperty(KEYSTORE_PASSWORD);
String keystoreType = props.getProperty(KEYSTORE_TYPE, DEFAULT_KEYSTORE_TYPE);
- String keystoreProtocol = props.getProperty(PROTOCOL, DEFAULT_KEYSTORE_PROTOCOL);
+ String keystoreProtocol = props.getProperty(PROTOCOL, DEFAULT_PROTOCOL);
String keystoreAlgorithm = props.getProperty(KEYSTORE_ALGORITHM);
String truststore = props.getProperty(TRUSTSTORE_FILENAME, keystore);
String truststorePassword = props.getProperty(TRUSTSTORE_PASSWORD, keystorePassword);
- boolean anon = NONE.equalsIgnoreCase(truststore);
+ boolean anon = PropertiesUtils.getBooleanProperty(props, ALLOW_ANON, true);
SSLContext result = null;
- // 0) anon
// 1) keystore != null = 2 way SSL (can define a separate truststore too)
// 2) truststore != null = 1 way SSL (here we can define custom properties for truststore; useful when
// client like a appserver have to define multiple certs without importing
// all the certificates into one single certificate
// 3) else = javax properties; this is default way to define the SSL anywhere.
- if (anon) {
- result = getAnonSSLContext();
- } else if (keystore != null) {
+ if (keystore != null) {
// 2 way SSL
result = getClientSSLContext(keystore, keystorePassword, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
} else if(truststore != null) {
@@ -149,7 +145,7 @@
}
public static SSLContext getAnonSSLContext() throws IOException, GeneralSecurityException {
- return getSSLContext(null, null, null, null, null, null, ANON_PROTOCOL);
+ return getSSLContext(null, null, null, null, null, null, DEFAULT_PROTOCOL);
}
public static SSLContext getSSLContext(String keystore,
@@ -208,7 +204,7 @@
try {
stream = new FileInputStream(name);
} catch (FileNotFoundException e) {
- IOException exception = new IOException(NetPlugin.Util.getString("SocketHelper.keystore_not_found", name)); //$NON-NLS-1$
+ IOException exception = new IOException(JDBCPlugin.Util.getString("SocketHelper.keystore_not_found", name)); //$NON-NLS-1$
exception.initCause(e);
throw exception;
}
Modified: trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,4 +1,3 @@
-#
# 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
@@ -18,70 +17,38 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
-#
# ==========================================
# Error Messages for the JDBC Package
# ==========================================
DataTypeTransformer.Err_converting=Unable to transform the column value {0} to a {1}.
-DataTypeTransformer.Runtime_err_converting=Unable to transform {0} to a {1} value: {2}.
-DataTypeTransformer.Err_converting_boolean=Unable to transform the column value {0} to Boolean. Expected 0 or 1.
-DataTypeTransformer.Err_converting_date=Failed to transform String to Date. Expected format = yyyy-mm-dd for {0}.
-DataTypeTransformer.Err_converting_time=Failed to transform String to Time. Expected format = hh:mm:ss for {0}.
-DataTypeTransformer.Err_converting_timestamp=Failed to transform String to Timestamp. Expected format = yyyy-mm-dd hh:mm:ss.fffffffff for {0}.
JDBC.Method_not_supported=This method is not supported.
-MMCallableStatement.Unable_to_transform=The parameter value {0} could not be transformed into a {1} value.
-MMCallableStatement.SQL3_types_not_supported=SQL3 data types are not supported.
MMPreparedStatement.Err_transform_obj=Unable to transform the object into the target JDBC type.
MMCallableStatement.Param_not_found=Parameter is not found at index {0}.
-MMCallableStatement.parse_error=Parsing error: The required escape syntax is {[?=]call procedure_name[(?,?,...)]}
-MMConnection.Err_closing_conn=Error trying to close connection.
MMConnection.Err_closing_stmts=Error trying to close statements on this connection.
-MMConnection.Err_committing=Unable to commit the current transaction: {0}.
-MMConnection.Err_rollingback=Error while trying to roll back the transaction: {0}.
MMConnection.Cant_use_closed_connection=Cannot perform operations on a closed connection.
MMConnection.Scrollable_type_not_supported=Scrollable type {0} is not supported.
MMConnection.Concurrency_type_not_supported=Concurrency type {0} is not supported.
MMConnection.SQL_cannot_be_null=SQL cannot be null for CallableStatement or PreparedStatement.
MMDatabaseMetadata.Err_getting_primary_keys=Error trying to get metadata information about primary/foreign keys.
-MMDataSource.Cant_load_driver=Unable to load JDBC driver - check class path for jar files.
MMDataSource.Err_connecting=Error while connecting: {0}.
-MMDataSource.Err_creating_XAConn=JDBC XADataSource failed to create XAConnection: {0}
-MMDriver.Invalid_log_name=Invalid file name for the log file : {0}
MMPreparedStatement.Err_prep_sql=Error preparing sql for MMPreparedStatement as the sql is null.
MMPreparedStatement.Invalid_param_index=The index of a parameter must be a positive integer.
-MMPreparedStatement.No_param_value=No value is set for parameter {0}.
MMResultSet.Cant_call_closed_resultset=Error trying to operate on a closed ResultSet object.
-MMResultSet.cannot_convert_to_character_stream=Cannot convert to character stream
MMResultSet.cannot_convert_to_binary_stream=Cannot convert to binary stream
-MMStatement.Err_getting_update_row=Unable to get the current row in this ResultSet.
MMStatement.Error_executing_stmt=Error trying to execute a statement {0}.
-ResultsImpl.Metadata_null=ResultSetMetadata shouldn''t be null.
-MMStatement.Timeout_before_execute=Request timed out before it could execute, change the timeout value and re-execute the request.
MMStatement.Cancel_before_execute=Request was canceled before it could finish executing.
MMStatement.Invalid_fetch_size=Fetch size should always be a value of 0 <= fetch size <= max rows.
-MMStatement.Invalid_feild_size=Field size should be >= 0.
-MMStatement.Err_start_auto_txn=Failed automatically creating a transaction for request {0}.
-MMStatement.Err_end_auto_txn=Failed ending automatically started transaction.
-MMStatement.Cancel_before_complete=Statement was canceled before operation completed.
MMStatement.Timeout_before_complete=Operation timed out before completion.
-MMStatement.Stmt_closed_before_complete=Statement was closed before operation completed.
-ResultsImpl.Fwd_only=This method cannot be called on a TYPE_FORWARD_ONLY resultSet.
-CursorResultsImpl.Moving_back_on_fwd_only=Unable to move back on a TYPE_FORWARD_ONLY resultSet.
MMResultsImpl.Col_doesnt_exist=Column name "{0}" does not exist.
ResultsImpl.Op_invalid_fwd_only=This operation cannot be executed on TYPE_FORWARD_ONLY ResultSets.
-ResultsImpl.Null_results=Unable to execute this operation because the results are null.
ResultsImpl.Invalid_col_index=Column index {0} is invalid. Index must be >= 0 and <= column count.
-ResultsImpl.Cant_check_method=Cannot check {0} - no results are available.
-CursorResultsImpl.Exception_during_processing=Exception occured during results processing. Use getException() for a more detailed exception and information.
MMConnection.Session_success=Successfully obtained a session.
MMConnection.Connection_close_success=Connection successfully closed.
MMConnection.Err_connection_close=Error trying to close driver connection: {0}
MMConnection.Commit_success=Successfully committed transactions on all open statements on this connection.
-MMConnection.Commit_failed=Unable to commit the present transaction: {0}.
MMConnection.Rollback_success=Successfully rolled back transactions on all open statements on this connection.
-MMConnection.Rollback_failed=Unable to rollback the present transaction: {0}.
MMDatabaseMetadata.Best_row_sucess=Successfully obtained best row identifier information for the table {0}.
MMDatabaseMetadata.Catalog_success=Catalog metadata info successfully obtained for this connection.
MMDatabaseMetadata.getCols_error=Error trying to get metadata info for the columns that match {0} present in the tables that match {1} - {2}.
@@ -105,65 +72,27 @@
MMDatabaseMetadata.getTable_error=Error trying to obtain metadata information for the tables that match {0}: {1}.
MMDatabaseMetadata.getTable_success=Successfully obtained metadata information for the table names that match {0}.
MMDatabaseMetadata.getTableType_success=Successfully obtained metadata information for the table types.
-MMDatabaseMetadata.getTypes_error=Error trying to obtain metadata information for supported data types {0}.
MMDatabaseMetadata.getTypes_success=Successfully obtained metadata info for supported data types.
-MMDatabaseMetadata.getUserDefTypes_error=Error trying to obtain metadata information for supported user defined data types: {0}.
-MMDatabaseMetadata.getUserDefTypes_success=Successfully obtained metadata info for supported user defined data types.
MMDatabaseMetadata.getVersionCols_success=Successfully obtained version column information for this connection.
MMDatabaseMetadata.getIndex_error=Error trying to get metadata information for indexes present on the table {0} - {1}.
-MMDatabaseMetadata.getModels_error=Error trying to get metadata information for models that match {0} - {1}.
MMDriver.Err_registering=JDBC driver could not be registered with the DriverManager: {0}.
MMDriver.urlFormat=The required url format is jdbc:teiid:VDBName@mm[s]://server1:port1[,server2:port2][;optional properties]
JDBCDriver.Connection_sucess=The JDBC Driver successfully obtained a connection.
-MMDriver.Err_init_appinfo=Could not initialize ApplicationInfo (Version number): {0}.
MMStatement.Close_stmt_success=Statement closed successfully.
MMStatement.Stmt_closed=Unable to perform operations on an already closed statement.
-MMStatement.Invalid_query_type= Invalid query type, the query {0} cannot be executed.
-MMStatement.Err_query=Error trying to execute a query statement {0}: {1}
MMStatement.Success_query=Successfully executed a query {0} and obtained results
-MMStatement.Err_update=Error trying to execute an Update statement {0}: {1}
-MMStatement.Success_update= Successfully executed an update {0}.
-MMBlob.Unable_to_get_bytes_from_pos_to_length._{0}_1=Unable to get bytes from pos to length. {0}
-MMBlob.Unable_to_get_the_position_for_the_byte_array._{0}_2=Unable to get the position for the byte array. {0}
-MMClob.Unable_to_get_chars_from_pos_to_length._{0}_1=Unable to get chars from pos to length. {0}
-MMClob.Unable_to_get_the_position_of___{0}__._{1}_2=Unable to get the position of ''{0}''. {1}
-MMDataSource.Credentials_string_must_begin_with_(=Credentials string must begin with ''('' and end with '')''
+MMStatement.Invalid_field_size=Invalid MaxFieldSize {0}
MMDataSource.Port_number_must_be_positive=The port number must be a positive number
MMDataSource.serverPort_must_be_a_number=The serverPort property must be a number.
MMDataSource.Server_name_required=The server name must be specified
MMDataSource.Invalid_trans_auto_wrap_mode=The transaction auto-wrap setting must be one of \"{0}\", \"{1}\", or \"{2}\".
-MMDataSource.Name_value_pair_missing_name=The name-value pair \"{0}\" is missing a name
-MMDataSource.Name_value_pair_missing_value=The name-value pair \"{0}\" is missing a value
-MMDataSource.Name_value_pair_used=There name-value pair \"{0}\" has the same name as a previous pair in the same credential specification
-MMDataSource.Missing_system_property=Missing ''system'' property in credential specification "{0}"
MMDataSource.Sockets_per_vm_invalid=The property socketsPerVM must be a positive number.
MMDataSource.Sticky_connections_invalid=The property stickyConnections must be boolean.
MMDataSource.Alternate_Servers_format=The format for the alternateServers property is <server2>[:<port2>][,<server3>[:<port3>],...].
MMDataSource.alternateServer_is_invalid=The alternateServers property contains the following {0} error(s): {1}
-MMStatement.Unable_to_communicate_with_server_13=Unable to communicate with server
-MMStatement.Unable_to_communicate_with_server_16=Unable to communicate with server
-StreamImpl._Unable_to_initialize_the_stream_implementation_and_get_the_first_chunk_of_stream.__{0}_1=\ Unable to initialize the stream implementation and get the first chunk of stream. {0}
-StreamImpl._Unable_to_operate_on_already_closed_stream._2=\ Unable to operate on already closed stream.
StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
-StreamImpl.Unable_to_get_stream_length=Unable to get value chunk for valueID: {0}
-StoredProcedureCall.whitespace_in_name=The procedure name contains whitespace
-LocalTransportHandler.Failed_to_initialize_factory_1=Failed to initialize factory
-LocalTransportHandler.Invalid_config_file_extension=Invalid configuration file extension: {0}.
-LocalTransportHandler.No_configuration_file_set_in_property=No configuration file set in property: \"{0}\"
-LocalTransportHandler.Transport_shutdown=Tranport has been shutdown.
-LocalTransportHandler.session_inactive=execution denied; The session is in-active.
-MultiTransportFactory.Invalid_transport__{0}_1=Invalid transport: {0}
-MultiTransportFactory.Unable_to_find_transport_handler_class__{0}_2=Unable to find transport handler class: {0}
-MultiTransportFactory.Unable_to_instantiate_transport_handler_class,_likely_because_the_class_is_an_interface_or_abstract_class__{0}_3=Unable to instantiate transport handler class, likely because the class is an interface or abstract class: {0}
-MultiTransportFactory.Not_able_to_construct_transport_handler_class_due_to_security_restrictions__{0}_4=Not able to construct transport handler class due to security restrictions: {0}
-MultiTransportFactory.Transport_handler_class_does_not_implement_TransportHandler_interface__{0}_5=Transport handler class does not implement TransportHandler interface: {0}
-MMStatement.Time_out_for_current_request_with_ID___1=Time out for current request with ID:
-MMStatement.Request_is_cancelled_for___3=Request is cancelled for:
-MMStatement.Time_out_happened__n_1=Time out happened:
-MMStatement.Statement_is_cancelled__n_2=Statement is cancelled:
-MMStatement.Operation_Not_Supported=Update/Insert/Delete operation is not supported on read only connection state.(SQL: {0}).
+
MMStatement.Invalid_During_Transaction=Call to method {0} not valid during a transaction.
-MMStatement.Starting_transaction=Starting a transaction for this connection: {0}
StoredProcedureResultsImpl.ResultSet_cursor_is_after_the_last_row._1=ResultSet cursor is after the last row.
StoredProcedureResultsImpl.Invalid_parameter_index__{0}_2=Invalid parameter index: {0}
ResultsImpl.The_cursor_is_not_on_a_valid_row._1=The cursor is not on a valid row.
@@ -174,81 +103,49 @@
MMXAResource.FailedForgetTXN=Failed forgetting back transaction for xid "{0}".
MMXAResource.FailedEndTXN=Failed ending transaction for xid "{0}" with flag "{1}".
MMXAResource.FailedCommitTXN=Failed comitting transaction for xid "{0}" with flag "{1}".
-MMXAResource.FailedSetTXNTimeout=Failed setting timeout to "{0}". Default timeout will be used.
MMXAResource.FailedISSameRM=Failed determining isSameRM
MMXAConnection.connection_is_closed=Connection is closed and can not be reused.
-StaticMetadataProvider.No_metadata=No metadata is defined
StaticMetadataProvider.Invalid_column=Invalid column index: {0}
-StoredProcedureCall.unnecessary_paren=Unnecessary '')'' after procedure name
-StoredProcedureCall.unexpected_tokens=Unexpected token(s) between '')'' and ''}''
-ResultsMetadataWithProvider.No_provider=Unable to retrieve metadata as no metadata provider has been set.
DeferredMetadataProvider.Invalid_data=Invalid data for DeferredMetadataProvider: {0}, {1}
-MMStatement.Automatic_transaction_wrapping_failed._1=Automatic transaction wrapping failed.
FilteredResultsMetadata.Invalid_index=Invalid column index: {0}
-UserTransactionProxy.Received_exception_when_begining_transaction=Received exception when begining transaction.
-UserTransactionProxy.Received_exception_when_committing_transaction=Received exception when committing transaction.
-UserTransactionProxy.Received_exception_when_rolling_back_transaction=Received exception when rolling back transaction.
-UserTransactionProxy.Received_exception_when_setting_transaction_to_rollback_only=Received exception when setting transaction to rollback only.
-UserTransactionProxy.Received_exception_when_getting_transaction_status=Received exception when getting transaction status.
-UserTransactionProxy.Not_involved_in_transaction=Not involved in transaction.
-UserTransactionProxy.Unknown_msg_type=Unable to determine returned message type {0}
-TransactionHelper.Unable_to_check_for_required_transaction=Unable to check for required transaction.
-MMStatement.Autowrapping_request_in_transaction=Autowrapping request in transaction.
MMStatement.Timeout_ocurred_in_Statement.=Timeout ocurred in Statement.
MMStatement.Error_timing_out.=Error timing out.
MMStatement.Bad_timeout_value=Invalid timeout value supplied. Valid range is greater than or equal to zero.
-MMStatement.no_result_set=Statement does not return a result set.
-MMCallableStatement.Timeout_ocurred_in_CallableStatement.=Timeout ocurred in CallableStatement.
-MMPreparedStatement.Timeout_ocurred_in_PreparedStatement.=Timeout ocurred in PreparedStatement.
WarningUtil.Failures_occurred=Partial results failures occurred
-DQPAdminImpl.DQP_restarted=DQP already restarted.
-DataTypeTransformer.char_transform_failed=Unable to transform the parameter value {0} to a Character: {1}
DataTypeTransformer.blob_too_big=The blob value is too large for the max supported length of 2147483647 bytes
DataTypeTransformer.cannot_get_bytes=Cannot convert this value to a byte array.
-EmbeddedConnectionFactory.NoClassDefFoundError=Unable to find the following class definition: {0}
-EmbeddedConnectionFactoryImpl.connection_limit=Reached license limit of {0} connections.
-EmbeddedConnectionFactoryImpl.no_product_license=Could not find a license for the embedded query product.
-EmbeddedConnectionFactory.vdb_notactive=Failed to create connection to VDB \"{0}\" with version \"{1}\", because this VDB status is not \"active\"
-EmbeddedConnectionFactory.vdb_notavailable=Failed to create connection to newest version of VDB \"{0}\". The VDB is not active or does not exist.
-EmbeddedConnection.DQP_shutDown=Embedded service has been shutdown, restart by connecting again.
-EmbeddedConnection.txn_notsupported=Transaction support is currently not available in the EmbeddedDriver
-MMDriver.Log_level_invalid=Invalid logging level, valid logging levels are {0}, {1}, {2}, {3}.
-BatchResults.Invalid_Batch=Invalid batch: begin row "{0}", end row "{1}"
-StoredProcedureCall.curlies=The escape syntax must start with ''{'' and end with ''}''
-StoredProcedureCall.equals=Expected ''='' after ''?''
-StoredProcedureCall.call=Could not find the CALL keyword
-StoredProcedureCall.no_whitespace=Expected whitespace after the CALL keyword
-StoredProcedureCall.procname=Expected a procedure name
WrapperImpl.wrong_class=Wrapped object is not an instance of {0}
-MMSQLXML.unsupported_source=Unsupported source class {0}
MMXAConnection.rolling_back=rolling back transaction.
MMXAConnection.rolling_back_error=Error while rolling back transaction.
MMDataSource.Virtual_database_name_must_be_specified=The virtual database name must be specified.
-MMDataSource.Log_level_invalid=Invalid logging level, valid logging levels are {0}, {1}, {2}, {3}.
MMDataSource.The_partial_mode_must_be_boolean._47=The partial mode must be boolean.
MMDataSource.The_fetch_size_must_be_greater_than_zero=The fetch size must be greater than zero.
-EmbeddedDataSource.Application_name_must_be_specified=The property ''applicationName'' must be specified.
-EmbeddedDataSource.Configuration_file_must_be_specified=The Embedded Service Bootstrap file must be specified.
EmbeddedDriver.URL_must_be_specified=The JDBC URL must be specified.
-EmbeddedDriver.Invalid_URL_format=The URL is invalid. Example: jdbc:teiid:<VDB Name>@<Path to embedded service configuration File>;key=value
-EmbeddedDriver.DQP_Application_Name_Undefined=This Application Name {0} does not exist. Please use a valid Application Name.
-EmbeddedDriver.DQP_ConfigFile_Name_Already_In_Use=This Embedded Service Bootstrap File {0} is already being used in conjunction with another Application Name. Application Names and Embedded Service Boostrap Files have a one to one relationship.
-EmbeddedDriver.MMDQP_DRIVER_could_not_be_registered=Embedded driver could not be registered with the DriverManager: {0}.
-EmbeddedDriver.use_existing_transport=Embedded driver is using the existing embedded service instance to create connection.
-EmbeddedDriver.use_new_transport=Embedded driver is creating a new embedded service instance for create connection.
-EmbeddedDriver.use_classpath=Embedded driver is using the following classpath to load the embedded service.
-EmbeddedDriver.use_properties=Embedded driver is using the following properties to load the embedded service.
-EmbeddedDriver.shutdown_sucessful=Shutdown request successful.
-EmbeddedDriver.shutdown_failure=Shutdown request failed.
-EmbeddedDataSource.Unable_to_load_MMDQP_Driver=Unable to load JDBC driver - check class path for jar files.
-EmbeddedDataSource.The_configFile_property_is_null=The configFile property is null.
-EmbeddedDataSource.The_configFile_does_not_exist_or_cant_be_read=The configFile does not exist or cannot be read.
-EmbeddedTransport.no_classpath=The Embedded Service Bootstrap does not contain a dqp.classpath property. Add the dqp.classpath property or specify unifiedClassLoader=true on the DQP JDBC URL.
-EmbeddedTransport.invalid_dqpproperties_path=The path {0} is invalid. Please check your file system and correct your JDBC URL.
StatementImpl.show_update_count=SHOW does not return an update count
-StatementImpl.set_result_set=SET does not return a result set.
\ No newline at end of file
+StatementImpl.set_result_set=SET does not return a result set.
+
+StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
+RequestMessage.invalid_txnAutoWrap=''{0}'' is an invalid transaction autowrap mode.
+LocalTransportHandler.Transport_shutdown=Tranport has been shutdown.
+PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to=Unable to find a component used authenticate on to Teiid
+
+admin_conn_closed = The Admin connection has been closed.
+invalid_parameter = The user parameter may not be null or empty.
+
+SocketServerInstance.Connection_Error.Unknown_Host = Error establishing socket. Unknown host: {0}
+SocketServerInstance.Connection_Error.Connect_Failed = Error establishing socket to host and port: {0}:{1}. Reason: {2}
+SocketServerInstancePool.No_valid_host_available=No valid host available. Attempted connections to: {0}
+SocketServerInstanceImpl.handshake_error=Handshake error
+
+
+SocketServerConnection.closed=Server connection is closed
+SocketHelper.keystore_not_found=Key store ''{0}'' was not found.
+
+MMURL.INVALID_FORMAT=The required url format is {0}
+
+BatchSerializer.datatype_mismatch=The modeled datatype {0} for column {1} doesn''t match the runtime type "{2}". Please ensure that the column''s modeled datatype matches the expected data.
Deleted: trunk/client/src/main/resources/org/teiid/net/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/net/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/resources/org/teiid/net/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,134 +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.
-#
-
-LocalClientConnection.No_listener_found_1=No listener found
-LocalServerConnection.client_shutdown=Client connection has been terminated by the server
-SessionToken.sessionid_null=The session ID may not be null
-SessionToken.session_compare_null = Attempt to compare null to SessionToken.
-TrustedSessionToken.token_null = The trusted token for a session token may not be null.
-StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
-
-RequestMessage.invalid_txnAutoWrap=''{0}'' is an invalid transaction autowrap mode.
-
-LocalTransportHandler.Transport_shutdown=Tranport has been shutdown.
-
-AbstractServerConnection.Created=AbstractServerConnection created - session ID: {0}
-AbstractServerConnection.Shutdown=AbstractServerConnection shutdown - session ID: {0}
-AbstractServerConnection.Unable_to_find_resources_with_ResourceFinder_1=Unable to find resources to load Server Instances
-AbstractServerConnection.Lost_communication_with_server_-_shutting_down.=Lost communication with server - shutting down.
-AbstractServerConnection.Error_attempting_server_connection_shutdown.=Error attempting server connection shutdown.
-
-PlatformServerConnection.Unable_to_create_new_PlatformMessageReceiver_2=Unable to create new PlatformMessageReceiver
-PlatformServerConnection.Error_attempting_server_connection_shutdown.=Error attempting server connection shutdown.
-PlatformServerConnection.Cant_get_resource=Unable to obtain a remote resource of type {0}
-
-PlatformServerConnectionFactory.Missing_required_property=Missing required property:
-PlatformServerConnectionFactory.Error_encrypting_user_password=Error encrypting user password
-PlatformServerConnectionFactory.Error_communicating_with_app_server=Error communicating with app server
-PlatformServerConnectionFactory.Error_logging_on_to_MetaMatrix=Error logging on to Teiid: {0}
-PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to=Unable to find a component used authenticate on to Teiid
-PlatformServerConnectionFactory.Unable_to_get_a_PlatformServerConnection=Unable to get a PlatformServerConnection
-PlatformServerConnectionFactory.Error_comunicating_with_LogonAPI=Error communicating with LogonAPI
-PlatformServerConnectionFactory.JNDI_library_mismatch_plugin=Client library may not match server vendor or version for server {1}. Client code loaded from plugin: {2}, initial context factory: {0}.
-PlatformServerConnectionFactory.JNDI_library_mismatch=Client library may not match server vendor or version for server {1}. Client code loaded from: bootstrap class loader, initial context factory: {0}.
-
-RemoteResourceFinder.Invalid_user_session=Unable to find resources: invalid user session.
-RemoteResourceFinder.Unable_to_find_component=Unable to find resources: Unable to find component.
-RemoteResourceFinder.Error_communicating=Unable to find resources: Error communicating.
-
-ClientHeartbeat.Pinging_server_failed_after_{0}_retries.__Notifying_connection.=Pinging server failed after {0} retries. Notifying connection.
-
-PlatformMessageReceiver.Unable_to_receive_message_[{0}],_no_listeners_for_topic_[{1}]=Unable to receive message [{0}], no listeners for topic [{1}].
-ObjectSocket.write_on_closed_socket=Attempting to write to a closed socket.
-ObjectSocket.read_on_closed_socket=Attempting to read from a closed socket.
-ObjectSocket.eof=Reached end of input stream.
-ObjectSocket.peek_failed=Exception ''{0}'' while peeking a byte. Assuming end-of-stream.
-
-ConsoleConnectionFactory.established_connection=ConsoleConnectionFactory established a connection.
-
-
-
-MSG.014.010.0010 = Usage: VMController <vm_name> <host_name> <startDeployServices> [<log_file>]
-MSG.014.010.0011 = If startDeployedServices = true, deployedServices will be started.
-
-ERR.014.001.0099 = The user parameter may not be null or empty.
-ERR.014.001.0100 = The user password may not be null or empty.
-ERR.014.001.0101 = NamingException while getting new initialcontext for LogonAPI.
-ERR.014.001.0102 = Error trying to connect to server: {0} at {1}
-ERR.014.001.0103 = CreateException while getting home interface for LogonAPI.
-ERR.014.001.0104 = RemoteException while getting home interface for LogonAPI.
-ERR.014.001.0105 = Unknown error while obtaining a reference to LogonAPI.
-ERR.014.001.0106 = NamingException while getting new initialcontext for AdminAPI.
-ERR.014.001.0107 = NamingException while getting home interface for AdminAPI.
-ERR.014.001.0108 = CreateException while getting home interface for AdminAPI.
-ERR.014.001.0109 = RemoteException while getting home interface for AdminAPI.
-ERR.014.001.0110 = Unknown error while obtaining a reference to AdminAPI for user <{0}>
-
-
-SocketServerConnection.0=Connection refused: {0}
-
-SocketServerInstance.Connection_Error.Unknown_Host = Error establishing socket. Unknown host: {0}
-SocketServerInstance.Connection_Error.Connect_Failed = Error establishing socket to host and port: {0}:{1}. Reason: {2}
-SocketServerInstance.Connection_Error.Connect_Failed_to_HostInfo_Max_Attempts = Failed to connect to {0} on try [{1}]. Maximum number of retries reached.
-
-SocketServerInstance.Connection_Warning.Connect_Failed_to_HostInfo_Will_retry = Failed to connect to {0} on try [{1}]. Will attempt up to [{2}] time(s).
-
-SocketServerInstance.Connection_Detail.Connected_to_HostInfo = Connected to {0} on attempt number [{1}].
-SocketServerInstance.Connection_Detail.Connecting_to_HostInfo = Connecting to {0}. Attempt [{1}] of [{2}].
-
-ERR.014.001.0001 = Lost communication with the AdminAPI - the connection has been closed.
-ERR.014.001.0002 = Lost communication with the AdminAPI.
-
-MSG.014.001.0001 = Starting AdminAPIConnection for session <{0}>
-
-SocketServerInstancePool.No_valid_host_available=No valid host available. Attempted connections to: {0}
-
-AdminAuthorizationInterceptor.Admin_Session_not_valid=Unable to perform the action [{0}]. Unable to validate session.
-AdminAuthorizationInterceptor.Admin_Audit_request=Administrator [{0}], session [{1}] requesting access which requires role {2} to method [{3}].
-AdminAuthorizationInterceptor.Admin_not_authorized=Administrator [{0}], session [{1}] does not have any required role {2} so is not authorized to perform the action [{3}].
-AdminAuthorizationInterceptor.Admin_granted=Administrator [{0}], session [{1}] granted access to method [{3}].
-
-
-ClientConnectionImpl.ConnectionID=ClientConnectionImpl - connectionID: {0} message receiver: {1} properties: {2}
-ClientConnectionImpl.Send=ClientConnectionImpl.send - connectionID: {0} message key: {1} message {2}
-
-RemoteResourceImpl.Send_asynch=RemoteResourceImpl.send (asynch) - ClientID: {0} Message {1}
-RemoteResourceImpl.Send_synch=RemoteResourceImpl.send (synch) - ClientID: {0} Message {1}
-RemoteResourceImpl.Set_message_receiver=RemoteResourceImpl.setMessageReceiver - ClientID: {0} Message Receiver {1} Properties {2}
-
-SocketServerInstanceImpl.version_mismatch=Handshake failed due to version mismatch -- Client Version: {0}, Server Version: {1}
-SocketServerInstanceImpl.handshake_error=Handshake error
-SocketServerInstanceImpl.handshake_timeout=Handshake timeout
-SocketServerInstanceImpl.secure_error_during_handshake=Unable to complete handshake with the server. Ensure that the server is using secure sockets.
-SocketServerInstanceImpl.error_during_handshake=Unable to complete handshake with the server. Ensure that the server is not using secure sockets.
-SocketClientInstance.invalid_sessionkey=Invalid session key used during handshake
-
-SSLAwareChannelHandler.channel_closed=Channel closed
-
-SocketServerConnection.closed=Server connection is closed
-
-SocketHelper.keystore_not_found=Key store ''{0}'' was not found.
-
-MMURL.INVALID_FORMAT=The required url format is {0}
-
-BatchSerializer.datatype_mismatch=The modeled datatype {0} for column {1} doesn''t match the runtime type "{2}". Please ensure that the column''s modeled datatype matches the expected data.
-
Modified: trunk/client/src/main/resources/teiid-client-settings.properties
===================================================================
--- trunk/client/src/main/resources/teiid-client-settings.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/main/resources/teiid-client-settings.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -44,9 +44,6 @@
# authentication that requires trust not provided
# by the system defaults.
#
-# Set to NONE for anonymous authentication using
-# the TLS_DH_anon_WITH_AES_128_CBC_SHA cipher suite
-#
#org.teiid.ssl.trustStore=
@@ -57,11 +54,19 @@
#org.teiid.ssl.trustStorePassword=
#
-# The cipher protocol, defaults to SSLv3
+# The cipher protocol, defaults to TLSv1
#
-org.teiid.ssl.protocol=SSLv3
+org.teiid.ssl.protocol=TLSv1
+#
+# Whether to allow anonymous SSL
+# (the TLS_DH_anon_WITH_AES_128_CBC_SHA cipher suite)
+# defaults to true
+#
+
+org.teiid.ssl.allowAnon=true
+
########################################
# Misc Socket Configuration
########################################
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -118,4 +118,27 @@
assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals("Client")); //$NON-NLS-1$
assertEquals(7, p.size());
}
+
+ @Test
+ public void testIPV6() throws SQLException{
+ assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb@mm://[::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
+ assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb@mm://[3ffe:ffff:0100:f101::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
+
+ Properties p = new Properties();
+ SocketProfile.parseURL("jdbc:teiid:BQT@mms://[3ffe:ffff:0100:f101::1]:1234;version=3", p); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
+ assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://[3ffe:ffff:0100:f101::1]:1234")); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
+ }
+
+ @Test
+ public void testIPV6MultipleHosts() throws SQLException{
+ Properties p = new Properties();
+ SocketProfile.parseURL("jdbc:teiid:BQT@mms://[3ffe:ffff:0100:f101::1]:1234,[::1]:31000,127.0.0.1:2134;version=3", p); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
+ assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://[3ffe:ffff:0100:f101::1]:1234,[::1]:31000,127.0.0.1:2134")); //$NON-NLS-1$
+ assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
+ }
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -84,5 +84,18 @@
assertEquals(Boolean.TRUE.toString(), p.getProperty(ExecutionProperties.ANSI_QUOTED_IDENTIFIERS));
}
+ @Test public void testTransactionStatements() throws Exception {
+ ConnectionImpl conn = Mockito.mock(ConnectionImpl.class);
+ Properties p = new Properties();
+ Mockito.stub(conn.getExecutionProperties()).toReturn(p);
+ StatementImpl statement = new StatementImpl(conn, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
+ assertFalse(statement.execute("start transaction")); //$NON-NLS-1$
+ Mockito.verify(conn).setAutoCommit(false);
+ assertFalse(statement.execute("commit")); //$NON-NLS-1$
+ Mockito.verify(conn).setAutoCommit(true);
+ assertFalse(statement.execute("start transaction")); //$NON-NLS-1$
+ assertFalse(statement.execute("rollback")); //$NON-NLS-1$
+ Mockito.verify(conn).rollback(false);
+ }
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -483,6 +483,43 @@
"jdbc:teiid:vdbName@mm://hostname:7001;fetchSize=500;ApplicationName=JDBC;VirtualDatabaseVersion=1.2.3;partialResultsMode=true;VirtualDatabaseName=vdbName"); //$NON-NLS-1$
}
+ public void testBuildingIPv6() {
+ final String serverName = "3ffe:ffff:0100:f101::1"; //$NON-NLS-1$
+ final String vdbName = "vdbName"; //$NON-NLS-1$
+ final String vdbVersion = "1"; //$NON-NLS-1$
+ final int portNumber = 7001;
+ final String transactionAutoWrap = null;
+ final String partialMode = "true"; //$NON-NLS-1$
+ final boolean secure = false;
+ helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,null,transactionAutoWrap, partialMode, 500, false, secure,
+ "jdbc:teiid:vdbName@mm://[3ffe:ffff:0100:f101::1]:7001;fetchSize=500;ApplicationName=JDBC;VirtualDatabaseVersion=1;partialResultsMode=true;VirtualDatabaseName=vdbName"); //$NON-NLS-1$
+ }
+
+ public void testBuildingIPv6WithBrackets() {
+ final String serverName = "[3ffe:ffff:0100:f101::1]"; //$NON-NLS-1$
+ final String vdbName = "vdbName"; //$NON-NLS-1$
+ final String vdbVersion = "1"; //$NON-NLS-1$
+ final int portNumber = 7001;
+ final String transactionAutoWrap = null;
+ final String partialMode = "true"; //$NON-NLS-1$
+ final boolean secure = false;
+ helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,null,transactionAutoWrap, partialMode, 500, false, secure,
+ "jdbc:teiid:vdbName@mm://[3ffe:ffff:0100:f101::1]:7001;fetchSize=500;ApplicationName=JDBC;VirtualDatabaseVersion=1;partialResultsMode=true;VirtualDatabaseName=vdbName"); //$NON-NLS-1$
+ }
+
+ public void testBuildingIPv6Alternate() {
+ final String serverName = "3ffe:ffff:0100:f101::1"; //$NON-NLS-1$
+ final String vdbName = "vdbName"; //$NON-NLS-1$
+ final String vdbVersion = "1"; //$NON-NLS-1$
+ final int portNumber = 7001;
+ final String transactionAutoWrap = null;
+ final String partialMode = "true"; //$NON-NLS-1$
+ final boolean secure = false;
+ final String alternates = "[::1],127.0.0.1:1234"; //$NON-NLS-1$
+ helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,alternates,transactionAutoWrap, partialMode, 500, false, secure,
+ "jdbc:teiid:vdbName@mm://[3ffe:ffff:0100:f101::1]:7001,[::1]:7001,127.0.0.1:1234;fetchSize=500;ApplicationName=JDBC;VirtualDatabaseVersion=1;partialResultsMode=true;VirtualDatabaseName=vdbName"); //$NON-NLS-1$
+ }
+
public void testBuildingURL2() {
final String serverName = "hostName"; //$NON-NLS-1$
final String vdbName = "vdbName"; //$NON-NLS-1$
Modified: trunk/client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/test/java/org/teiid/jdbc/util/ResultSetUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,9 +32,12 @@
import java.io.PrintStream;
import java.io.StringWriter;
import java.lang.reflect.Method;
+import java.sql.Blob;
+import java.sql.Clob;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
+import java.sql.SQLXML;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -279,12 +282,19 @@
int totalRows = 0;
while (rs.next()) {
for (int j = 1; j <= count; j++) {
+ Object obj = rs.getObject(j);
+ if (obj instanceof SQLXML) {
+ obj = ((SQLXML)obj).getString();
+ } else if (obj instanceof Clob) {
+ obj = "Clob[" + ((Clob)obj).length() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (obj instanceof Blob) {
+ obj = "Blob[" + ((Blob)obj).length() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
if (maxColWidth == 0) {
- Object obj = rs.getObject(j);
- out.print(obj == null ? NULL : obj); //$NON-NLS-1$
+ out.print(obj == null ? NULL : obj);
if (j != count) out.print(SPACER);
} else {
- String resizedString = resizeString(rs.getObject(j), sizes[j-1]);
+ String resizedString = resizeString(obj, sizes[j-1]);
out.print(resizedString);
if (j != count && resizedString.length() <= sizes[j-1]) {
out.print(SPACER);
@@ -346,7 +356,7 @@
try {
Method m = RSMD.getMethod(METADATA_METHODS[i], params);
Object obj = m.invoke(rsmd, columnParam);
- String stringVal = (obj == null) ? NULL : obj.toString(); //$NON-NLS-1$
+ String stringVal = (obj == null) ? NULL : obj.toString();
metadataStrings[col - 1][i] = stringVal;
if (maxColWidths[i] < stringVal.length()) {
maxColWidths[i] = stringVal.length();
@@ -378,7 +388,7 @@
private static String resizeString(Object obj, int size) {
if (obj == null) {
- return resizeString(NULL, size); //$NON-NLS-1$
+ return resizeString(NULL, size);
}
String str = obj.toString();
if (str.length() == size) {
Deleted: trunk/client/src/test/java/org/teiid/net/TestMMURL.java
===================================================================
--- trunk/client/src/test/java/org/teiid/net/TestMMURL.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/client/src/test/java/org/teiid/net/TestMMURL.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,262 +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.net;
-
-import java.util.List;
-
-import org.teiid.net.HostInfo;
-import org.teiid.net.TeiidURL;
-
-import junit.framework.TestCase;
-
-
-
-/**
- * @since 4.2
- */
-public class TestMMURL extends TestCase {
-
- public static final String REQUIRED_URL = TeiidURL.FORMAT_SERVER;
-
- /**
- * Constructor for TestMMURL.
- * @param name
- */
- public TestMMURL(String name) {
- super(name);
- }
-
- public final void testMMURL() {
- String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$
- assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
-
- TeiidURL url = new TeiidURL(SERVER_URL);
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
- assertEquals(1,hosts.size());
- }
-
- public final void testBogusProtocol() {
- String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
- } catch (RuntimeException e) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
- }
- }
- public final void testBogusProtocol1() {
- String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
- } catch (RuntimeException e) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
- }
- }
-
- public final void testMMURLSecure() {
- String SERVER_URL = "mms://localhost:31000"; //$NON-NLS-1$
- assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
-
- TeiidURL url = new TeiidURL(SERVER_URL);
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
- assertEquals(1,hosts.size());
- }
-
- public final void testMMURLBadProtocolMM() {
- String SERVER_URL = "mmm://localhost:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLWrongSlash() {
- String SERVER_URL = "mm:\\\\localhost:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLOneSlash() {
- String SERVER_URL = "mm:/localhost:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLNoHost() {
- String SERVER_URL = "mm://:31000"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLNoHostAndPort() {
- String SERVER_URL = "mm://:"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLNoHostAndPort2() {
- String SERVER_URL = "mm://"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
- }
- }
-
- public final void testMMURLBadPort() {
- String SERVER_URL = "mm://localhost:port"; //$NON-NLS-1$
- assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
- try {
- new TeiidURL(SERVER_URL);
- fail("MMURL did not throw an Exception"); //$NON-NLS-1$
- } catch( IllegalArgumentException e ) {
- }
- }
-
- public final void testMMURL2Hosts() {
- String SERVER_URL = "mm://localhost:31000,localhost:31001"; //$NON-NLS-1$
- assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
-
- TeiidURL url = new TeiidURL(SERVER_URL);
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 2 Host", hosts ); //$NON-NLS-1$
- assertEquals(2,hosts.size());
- }
-
- public final void testMMURL3Hosts() {
- String SERVER_URL = "mm://localhost:31000,localhost:31001,localhost:31002"; //$NON-NLS-1$
- assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
-
- TeiidURL url = new TeiidURL(SERVER_URL);
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 3 Host", hosts ); //$NON-NLS-1$
- assertEquals(3,hosts.size());
- }
-
- public final void testGetHostInfo() {
- String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$
- assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
-
- TeiidURL url = new TeiidURL(SERVER_URL);
- assertNotNull(url.getHostInfo() );
- }
-
- public final void testGetProtocolStandalone() {
- TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
- assertNotNull(url);
- assertEquals("mm://localhost:31000",url.getAppServerURL()); //$NON-NLS-1$
- }
-
- public final void testHasMoreElements() {
- TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
- assertNotNull(url);
- assertFalse(url.getHostInfo().isEmpty());
- }
-
- public final void testNextElement() {
- TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
- assertEquals(2, url.getHostInfo().size());
- }
-
- public final void testHostInfoEquals() {
- HostInfo expectedResults = new HostInfo("localhost",31000); //$NON-NLS-1$
- TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
- HostInfo actualResults = url.getHostInfo().get(0);
- assertEquals(expectedResults,actualResults);
- }
-
- public final void testWithEmbeddedSpaces() {
- HostInfo expectedResults = new HostInfo("localhost",12345); //$NON-NLS-1$
-
- TeiidURL url = new TeiidURL("mm://localhost : 12345"); //$NON-NLS-1$
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
- assertEquals(1,hosts.size());
- HostInfo actualResults = url.getHostInfo().get(0);
- assertEquals(expectedResults,actualResults);
- }
-
- public final void testHostPortConstructor() {
- HostInfo expectedResults = new HostInfo("myhost", 12345); //$NON-NLS-1$
-
- TeiidURL url = new TeiidURL("myhost", 12345, false); //$NON-NLS-1$
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
- assertEquals(1,hosts.size());
- HostInfo actualResults = url.getHostInfo().get(0);
- assertEquals(expectedResults,actualResults);
- assertEquals("mm://myhost:12345", url.getAppServerURL()); //$NON-NLS-1$
- }
-
- public final void testHostPortConstructorSSL() {
- HostInfo expectedResults = new HostInfo("myhost",12345); //$NON-NLS-1$
-
- TeiidURL url = new TeiidURL("myhost", 12345, true); //$NON-NLS-1$
- List hosts = url.getHostInfo();
- assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
- assertEquals(1,hosts.size());
- HostInfo actualResults = url.getHostInfo().get(0);
- assertEquals(expectedResults,actualResults);
- assertEquals("mms://myhost:12345", url.getAppServerURL()); //$NON-NLS-1$
- }
-
-}
Copied: trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java (from rev 2599, branches/7.1.x/client/src/test/java/org/teiid/net/TestTeiidURL.java)
===================================================================
--- trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java (rev 0)
+++ trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,298 @@
+/*
+ * 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.net;
+
+import java.util.List;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+
+public class TestTeiidURL {
+
+ public static final String REQUIRED_URL = TeiidURL.FORMAT_SERVER;
+
+ @Test
+ public final void testTeiidURL() {
+ String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ }
+
+ @Test
+ public final void testTeiidURLIPv6() {
+ String SERVER_URL = "mm://[3ffe:ffff:0100:f101::1]:31000"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List<HostInfo> hosts = url.getHostInfo();
+ assertNotNull("TeiidURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ assertEquals("3ffe:ffff:0100:f101::1", hosts.get(0).getHostName()); //$NON-NLS-1$
+ assertEquals(31000, hosts.get(0).getPortNumber());
+ }
+
+ @Test
+ public final void testBogusProtocol() {
+ String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
+ } catch (RuntimeException e) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testBogusProtocol1() {
+ String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
+ } catch (RuntimeException e) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLSecure() {
+ String SERVER_URL = "mms://localhost:31000"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ }
+
+ @Test
+ public final void testTeiidURLBadProtocolMM() {
+ String SERVER_URL = "mmm://localhost:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLWrongSlash() {
+ String SERVER_URL = "mm:\\\\localhost:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLOneSlash() {
+ String SERVER_URL = "mm:/localhost:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLNoHost() {
+ String SERVER_URL = "mm://:31000"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLNoHostAndPort() {
+ String SERVER_URL = "mm://:"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLNoHostAndPort2() {
+ String SERVER_URL = "mm://"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
+ }
+ }
+
+ @Test
+ public final void testTeiidURLBadPort() {
+ String SERVER_URL = "mm://localhost:port"; //$NON-NLS-1$
+ assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
+
+ try {
+ new TeiidURL(SERVER_URL);
+ fail("MMURL did not throw an Exception"); //$NON-NLS-1$
+ } catch( IllegalArgumentException e ) {
+ }
+ }
+
+ @Test
+ public final void testTeiidURL2Hosts() {
+ String SERVER_URL = "mm://localhost:31000,localhost:31001"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 2 Host", hosts ); //$NON-NLS-1$
+ assertEquals(2,hosts.size());
+ }
+
+ @Test
+ public final void testTeiidIPv6URL2Hosts() {
+ String SERVER_URL = "mm://[3ffe:ffff:0100:f101::1]:31000,[::1]:31001, 127.0.0.1:31003"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List<HostInfo> hosts = url.getHostInfo();
+ assertNotNull("TeiidURL should have 3 Host", hosts ); //$NON-NLS-1$
+ assertEquals(3, hosts.size());
+
+ assertEquals("3ffe:ffff:0100:f101::1", hosts.get(0).getHostName());//$NON-NLS-1$
+ assertEquals(31001, hosts.get(1).getPortNumber());
+ assertEquals("127.0.0.1", hosts.get(2).getHostName());//$NON-NLS-1$
+ }
+
+ @Test
+ public final void testTeiidURL3Hosts() {
+ String SERVER_URL = "mm://localhost:31000,localhost:31001,localhost:31002"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 3 Host", hosts ); //$NON-NLS-1$
+ assertEquals(3,hosts.size());
+ }
+
+ @Test
+ public final void testGetHostInfo() {
+ String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$
+ assertTrue(TeiidURL.isValidServerURL(SERVER_URL));
+
+ TeiidURL url = new TeiidURL(SERVER_URL);
+ assertNotNull(url.getHostInfo() );
+ }
+
+ @Test
+ public final void testGetProtocolStandalone() {
+ TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
+ assertNotNull(url);
+ assertEquals("mm://localhost:31000",url.getAppServerURL()); //$NON-NLS-1$
+ }
+
+ @Test
+ public final void testHasMoreElements() {
+ TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
+ assertNotNull(url);
+ assertFalse(url.getHostInfo().isEmpty());
+ }
+
+ @Test
+ public final void testNextElement() {
+ TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
+ assertEquals(2, url.getHostInfo().size());
+ }
+
+ @Test
+ public final void testHostInfoEquals() {
+ HostInfo expectedResults = new HostInfo("localhost",31000); //$NON-NLS-1$
+ TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
+ HostInfo actualResults = url.getHostInfo().get(0);
+ assertEquals(expectedResults,actualResults);
+ }
+
+ @Test
+ public final void testWithEmbeddedSpaces() {
+ HostInfo expectedResults = new HostInfo("localhost",12345); //$NON-NLS-1$
+
+ TeiidURL url = new TeiidURL("mm://localhost : 12345"); //$NON-NLS-1$
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ HostInfo actualResults = url.getHostInfo().get(0);
+ assertEquals(expectedResults,actualResults);
+ }
+
+ @Test
+ public final void testHostPortConstructor() {
+ HostInfo expectedResults = new HostInfo("myhost", 12345); //$NON-NLS-1$
+
+ TeiidURL url = new TeiidURL("myhost", 12345, false); //$NON-NLS-1$
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ HostInfo actualResults = url.getHostInfo().get(0);
+ assertEquals(expectedResults,actualResults);
+ assertEquals("mm://myhost:12345", url.getAppServerURL()); //$NON-NLS-1$
+ }
+
+ @Test
+ public final void testHostPortConstructorSSL() {
+ HostInfo expectedResults = new HostInfo("myhost",12345); //$NON-NLS-1$
+
+ TeiidURL url = new TeiidURL("myhost", 12345, true); //$NON-NLS-1$
+ List hosts = url.getHostInfo();
+ assertNotNull("MMURL should have 1 Host", hosts ); //$NON-NLS-1$
+ assertEquals(1,hosts.size());
+ HostInfo actualResults = url.getHostInfo().get(0);
+ assertEquals(expectedResults,actualResults);
+ assertEquals("mms://myhost:12345", url.getAppServerURL()); //$NON-NLS-1$
+ }
+
+}
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -52,6 +52,8 @@
public static final String SYSTEM_MODEL = "SYS"; //$NON-NLS-1$
+ public static final String SYSTEM_ADMIN_MODEL = "SYSADMIN"; //$NON-NLS-1$
+
public static final String ODBC_MODEL = "pg_catalog"; //$NON-NLS-1$
public static final String SYSTEM_VDB = "System.vdb"; //$NON-NLS-1$
Deleted: trunk/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,70 +0,0 @@
-package org.teiid.core;
-
-public interface ErrorMessageKeys {
-
- /** types (029) */
- public static final String TYPES_ERR_0001 = "ERR.003.029.0001"; //$NON-NLS-1$
- public static final String TYPES_ERR_0002 = "ERR.003.029.0002"; //$NON-NLS-1$
- public static final String TYPES_ERR_0003 = "ERR.003.029.0003"; //$NON-NLS-1$
- public static final String TYPES_ERR_0004 = "ERR.003.029.0004"; //$NON-NLS-1$
- public static final String TYPES_ERR_0005 = "ERR.003.029.0005"; //$NON-NLS-1$
- public static final String TYPES_ERR_0006 = "ERR.003.029.0006"; //$NON-NLS-1$
- public static final String TYPES_ERR_0007 = "ERR.003.029.0007"; //$NON-NLS-1$
- public static final String TYPES_ERR_0008 = "ERR.003.029.0008"; //$NON-NLS-1$
- public static final String TYPES_ERR_0009 = "ERR.003.029.0009"; //$NON-NLS-1$
- public static final String TYPES_ERR_0010 = "ERR.003.029.0010"; //$NON-NLS-1$
- public static final String TYPES_ERR_0011 = "ERR.003.029.0011"; //$NON-NLS-1$
- public static final String TYPES_ERR_0012 = "ERR.003.029.0012"; //$NON-NLS-1$
- public static final String TYPES_ERR_0013 = "ERR.003.029.0013"; //$NON-NLS-1$
- public static final String TYPES_ERR_0014 = "ERR.003.029.0014"; //$NON-NLS-1$
- public static final String TYPES_ERR_0015 = "ERR.003.029.0015"; //$NON-NLS-1$
- public static final String TYPES_ERR_0016 = "ERR.003.029.0016"; //$NON-NLS-1$
- public static final String TYPES_ERR_0017 = "ERR.003.029.0017"; //$NON-NLS-1$
- public static final String TYPES_ERR_0018 = "ERR.003.029.0018"; //$NON-NLS-1$
- public static final String TYPES_ERR_0019 = "ERR.003.029.0019"; //$NON-NLS-1$
- public static final String TYPES_ERR_0020 = "ERR.003.029.0020"; //$NON-NLS-1$
- public static final String TYPES_ERR_0021 = "ERR.003.029.0021"; //$NON-NLS-1$
- public static final String TYPES_ERR_0022 = "ERR.003.029.0022"; //$NON-NLS-1$
- public static final String TYPES_ERR_0023 = "ERR.003.029.0023"; //$NON-NLS-1$
- public static final String TYPES_ERR_0024 = "ERR.003.029.0024"; //$NON-NLS-1$
- public static final String TYPES_ERR_0025 = "ERR.003.029.0025"; //$NON-NLS-1$
- public static final String TYPES_ERR_0026 = "ERR.003.029.0026"; //$NON-NLS-1$
-
- public static final String CM_UTIL_ERR_0068 = "ERR.003.030.0068"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0062 = "ERR.003.030.0062"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0064 = "ERR.003.030.0064"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0066 = "ERR.003.030.0066"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0067 = "ERR.003.030.0067"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0071 = "ERR.003.030.0071"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0072 = "ERR.003.030.0072"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0073 = "ERR.003.030.0073"; //$NON-NLS-1$
-
- public static final String CM_UTIL_ERR_0074 = "ERR.003.030.0074"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0075 = "ERR.003.030.0075"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0076 = "ERR.003.030.0076"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0077 = "ERR.003.030.0077"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0078 = "ERR.003.030.0078"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0079 = "ERR.003.030.0079"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0081 = "ERR.003.030.0081"; //$NON-NLS-1$
-
-
- public static final String PROPERTIES_ERR_0010 = "ERR.003.021.0010"; //$NON-NLS-1$
- public static final String PROPERTIES_ERR_0011 = "ERR.003.021.0011"; //$NON-NLS-1$
-
- public static final String SEC_MEMBERSHIP_0013 = "ERR.014.407.0013"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0014 = "ERR.014.407.0014"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0015 = "ERR.014.407.0015"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0016 = "ERR.014.407.0016"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0017 = "ERR.014.407.0017"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0018 = "ERR.014.407.0018"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0019 = "ERR.014.407.0019"; //$NON-NLS-1$
-
-
- public static final String CM_UTIL_ERR_0176 = "ERR.003.030.0176"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0177 = "ERR.003.030.0177"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0178 = "ERR.003.030.0178"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0179 = "ERR.003.030.0179"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0180 = "ERR.003.030.0180"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0181 = "ERR.003.030.0181"; //$NON-NLS-1$
-
-}
Modified: trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -41,7 +41,7 @@
public static final long serialVersionUID = -4035276728007979320L;
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- public static final String CAUSED_BY_STRING = CorePlugin.Util.getString("MetaMatrixRuntimeException.Caused_by"); //$NON-NLS-1$
+ public static final String CAUSED_BY_STRING = CorePlugin.Util.getString("RuntimeException.Caused_by"); //$NON-NLS-1$
//############################################################################################################################
//# Static Methods #
Modified: trunk/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,7 +32,6 @@
import javax.crypto.SealedObject;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.util.Base64;
@@ -76,13 +75,13 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0071, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0071, e.getClass().getName(), e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0071", CorePlugin.Util.getString("ERR.003.030.0071", e.getClass().getName(), e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public String decrypt( String ciphertext ) throws CryptoException {
if ( ciphertext == null ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0074, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0074));
+ throw new CryptoException( "ERR.003.030.0074", CorePlugin.Util.getString("ERR.003.030.0074")); //$NON-NLS-1$ //$NON-NLS-2$
}
ciphertext = stripEncryptionPrefix(ciphertext);
@@ -92,7 +91,7 @@
try {
cipherBytes = Base64.decode(ciphertext);
} catch ( IllegalArgumentException e ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0075, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0075, e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0075", CorePlugin.Util.getString("ERR.003.030.0075", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
// Perform standard decryption
byte[] cleartext = decrypt( cipherBytes );
@@ -121,11 +120,11 @@
decryptCipher = Cipher.getInstance( cipherAlgorithm);
decryptCipher.init( Cipher.DECRYPT_MODE, decryptKey );
} catch ( NoSuchAlgorithmException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0076, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0076, cipherAlgorithm ));
+ throw new CryptoException( e, "ERR.003.030.0076", CorePlugin.Util.getString("ERR.003.030.0076", cipherAlgorithm )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( NoSuchPaddingException e ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0077, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0077, cipherAlgorithm, e.getClass().getName(), e.getMessage() ));
+ throw new CryptoException( "ERR.003.030.0077", CorePlugin.Util.getString("ERR.003.030.0077", cipherAlgorithm, e.getClass().getName(), e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( InvalidKeyException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0079, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0079, e.getClass().getName(), e.getMessage()) );
+ throw new CryptoException( e, "ERR.003.030.0079", CorePlugin.Util.getString("ERR.003.030.0079", e.getClass().getName(), e.getMessage()) ); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -145,7 +144,7 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0071, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0071, e.getClass().getName(), e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0071", CorePlugin.Util.getString("ERR.003.030.0071", e.getClass().getName(), e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -163,17 +162,17 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, e.getMessage()));
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public String encrypt( String cleartext ) throws CryptoException {
if ( cleartext == null ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0072, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0072));
+ throw new CryptoException( "ERR.003.030.0072", CorePlugin.Util.getString("ERR.003.030.0072")); //$NON-NLS-1$ //$NON-NLS-2$
}
String clearString = new String(cleartext);
if ( clearString.trim().length() == 0 && clearString.length() == 0 ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0073, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0073));
+ throw new CryptoException( "ERR.003.030.0073", CorePlugin.Util.getString("ERR.003.030.0073")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Turn char array into string and get its bytes using "standard" encoding
byte[] clearBytes = clearString.getBytes();
@@ -197,17 +196,17 @@
encryptCipher = Cipher.getInstance( cipherAlgorithm );
encryptCipher.init( Cipher.ENCRYPT_MODE, encryptKey );
} catch ( NoSuchAlgorithmException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0076, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0076, cipherAlgorithm ));
+ throw new CryptoException( e, "ERR.003.030.0076", CorePlugin.Util.getString("ERR.003.030.0076", cipherAlgorithm )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( NoSuchPaddingException e ) {
- throw new CryptoException(e, ErrorMessageKeys.CM_UTIL_ERR_0072, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0077, cipherAlgorithm , e.getMessage() ));
+ throw new CryptoException(e, "ERR.003.030.0072", CorePlugin.Util.getString("ERR.003.030.0077", cipherAlgorithm , e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( InvalidKeyException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0078, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0078, e.getMessage() ));
+ throw new CryptoException( e, "ERR.003.030.0078", CorePlugin.Util.getString("ERR.003.030.0078", e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public synchronized Object sealObject(Object object) throws CryptoException {
if (object != null && !(object instanceof Serializable)) {
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, "not Serializable")); //$NON-NLS-1$
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", "not Serializable")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
try {
return new SealedObject((Serializable)object, encryptCipher);
@@ -217,7 +216,7 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, e.getMessage()));
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -41,7 +41,6 @@
import java.util.Set;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.basic.AnyToObjectTransform;
import org.teiid.core.types.basic.AnyToStringTransform;
import org.teiid.core.types.basic.BooleanToNumberTransform;
@@ -323,7 +322,7 @@
public static Transform getTransform(Class sourceType, Class targetType) {
if (sourceType == null || targetType == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0002, sourceType, targetType));
+ "ERR.003.029.0002", sourceType, targetType)); //$NON-NLS-1$
}
return getTransformFromMaps(
DataTypeManager.getDataTypeName(sourceType), DataTypeManager
@@ -345,7 +344,7 @@
String targetTypeName) {
if (sourceTypeName == null || targetTypeName == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0003, sourceTypeName,
+ "ERR.003.029.0003", sourceTypeName, //$NON-NLS-1$
targetTypeName));
}
return getTransformFromMaps(sourceTypeName, targetTypeName);
@@ -363,7 +362,7 @@
public static boolean isTransformable(Class sourceType, Class targetType) {
if (sourceType == null || targetType == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0002, sourceType, targetType));
+ "ERR.003.029.0002", sourceType, targetType)); //$NON-NLS-1$
}
return (getTransformFromMaps(DataTypeManager
.getDataTypeName(sourceType), DataTypeManager
@@ -385,7 +384,7 @@
String targetTypeName) {
if (sourceTypeName == null || targetTypeName == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0003, sourceTypeName,
+ "ERR.003.029.0003", sourceTypeName, //$NON-NLS-1$
targetTypeName));
}
return (getTransformFromMaps(sourceTypeName, targetTypeName) != null);
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.math.BigDecimal;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -44,7 +43,7 @@
try {
return new BigDecimal(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0014, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0014, value));
+ throw new TransformationException("ERR.003.029.0014", CorePlugin.Util.getString("ERR.003.029.0014", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.math.BigInteger;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -44,7 +43,7 @@
try {
return new BigInteger(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0015, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0015, value));
+ throw new TransformationException("ERR.003.029.0015", CorePlugin.Util.getString("ERR.003.029.0015", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Byte.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0016, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0016, value));
+ throw new TransformationException("ERR.003.029.0016", CorePlugin.Util.getString("ERR.003.029.0016", value));
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.sql.Date;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Date.valueOf( (String) value );
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0018, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0018, value));
+ throw new TransformationException(e, "ERR.003.029.0018", CorePlugin.Util.getString("ERR.003.029.0018", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!result.toString().equals(value)) {
throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Double.valueOf((String)value);
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0019, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0019, value));
+ throw new TransformationException("ERR.003.029.0019", CorePlugin.Util.getString("ERR.003.029.0019", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Float.valueOf((String)value);
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0020, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0020, value));
+ throw new TransformationException("ERR.003.029.0020", CorePlugin.Util.getString("ERR.003.029.0020", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Integer.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0021, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0021, value));
+ throw new TransformationException("ERR.003.029.0021", CorePlugin.Util.getString("ERR.003.029.0021", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Long.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0022, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0022, value));
+ throw new TransformationException("ERR.003.029.0022", CorePlugin.Util.getString("ERR.003.029.0022", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Short.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0023, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0023, value));
+ throw new TransformationException("ERR.003.029.0023", CorePlugin.Util.getString("ERR.003.029.0023", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.sql.Time;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Time.valueOf((String)value);
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0025, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0025, value));
+ throw new TransformationException(e, "ERR.003.029.0025", CorePlugin.Util.getString("ERR.003.029.0025", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!result.toString().equals(value)) {
throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
Modified: trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.sql.Timestamp;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Timestamp.valueOf( (String) value );
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0024, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0024, value));
+ throw new TransformationException(e, "ERR.003.029.0024", CorePlugin.Util.getString("ERR.003.029.0024", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
//validate everything except for fractional seconds
if (!((String)value).startsWith(result.toString().substring(0, 19))) {
Modified: trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -549,7 +549,7 @@
// ... and the previous character is not uppercase, then insert
if ( !previousCharUppercase ) {
// ... and this is not the 'M' of 'MetaMatrix' ...
- if ( currentChar != 'M' || i < 4 || (!newName.substring(i-4).startsWith(CorePlugin.Util.getString("StringUtil.Displayable.MetaMatrix"))) ) { //$NON-NLS-1$
+ if ( currentChar != 'M' || i < 4 || (!newName.substring(i-4).startsWith(CorePlugin.Util.getString("StringUtil.Displayable"))) ) { //$NON-NLS-1$
newName.insert(i, ' ' );
++i; // skip, since we just move the character back one position
}
Modified: trunk/common-core/src/main/resources/org/teiid/core/i18n.properties
===================================================================
--- trunk/common-core/src/main/resources/org/teiid/core/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/main/resources/org/teiid/core/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -20,48 +20,8 @@
# 02110-1301 USA.
#
-PluginUtilities.-consoleLog_11=-consoleLog
-PluginUtilities.Could_not_find___12=Could not find "
-PluginUtilities.__folder._13=" folder.
-PluginUtilities.Make_sure_the_executable_extension_class_contains_a_public_constructor_14=Make sure the executable extension class contains a public constructor
-PluginUtilities._with_no_arguments._15=\ with no arguments.
-PluginUtilities.One_of_the_other_PluginUtilities.getApplication_methods_must_first_be_called._16=One of the other PluginUtilities.getApplication methods must first be called.
-PluginUtilities.One_of_the_other_PluginUtilities.getApplication_methods_must_first_be_called._17=One of the other PluginUtilities.getApplication methods must first be called.
-PluginUtilities.The_installation_path_must_not_be_empty._18=The installation path must not be empty.
-Argument._must_not_be_empty._1=\ must not be empty.
-Argument._must_not_be_empty._2=\ must not be empty.
-Argument._must_not_be_empty._3=\ must not be empty.
-Argument._must_not_be_null._5=\ must not be null.
-RunnableState.Unknown_state_value___7=Unknown state value:
-RunnableState.Unable_to_change_the_state_to__8=Unable to change the state to
-RunnableState.Unable_to_change_the_state_from__9=Unable to change the state from
-RunnableState._to__10=\ to
-RunnableState.Unable_to_change_the_state_from__11=Unable to change the state from
-RunnableState._to__12=\ to
-RunnableState.Unable_to_change_the_state_from__13=Unable to change the state from
-RunnableState._to__14=\ to
-RunnableState.Unable_to_change_the_state_from__15=Unable to change the state from
-RunnableState._to__16=\ to
-RunnableState.Unable_to_change_the_state_from__17=Unable to change the state from
-RunnableState._to__18=\ to
-RunnableState.Unknown_state_value___19=Unknown state value:
-StreamPipe.The_output_stream_has_been_closed._1=The output stream has been closed.
-StreamPipe.The_input_stream_has_been_closed._2=The input stream has been closed.
-PlatformLogger._NullLogEntry_exception = A null log entry was logged
-SystemLogger._NullLogEntry_exception = A null log entry was logged
-PluginUtilImpl.Error_while_running=Error while executing runnable from plugin {0}
+StringUtil.Displayable=Teiid
-Stopwatch.seconds=\ seconds
-Stopwatch.milliseconds=\ milliseconds
-Stopwatch.Stopwatch_Statistics =Stopwatch Statistics:
-Stopwatch.Statistics_Total =\ \ Total = {0}
-Stopwatch.Statistics_Previous =\ \ Previous = {0}
-Stopwatch.Statistics_Count =\ \ Count = {0}
-Stopwatch.Statistics_Average =\ \ Average = {0}
-Stopwatch.Statistics_Minimum =\ \ Minimum = {0}
-Stopwatch.Statistics_Maximum =\ \ Maximum = {0}
-StringUtil.Displayable.MetaMatrix=MetaMatrix
-
ArgCheck.isNonNegativeInt=Expected argument to be non-negative but argument= {0}
ArgCheck.isNonPositiveInt=Expected argument to be non-positive but argument= {0}
ArgCheck.isNegativeInt=Expected argument to be negative but argument= {0}
@@ -78,43 +38,13 @@
ArgCheck.containsKey=Expected map to contain key, but it did not
ReflectionHelper.errorConstructing=Unable to create a ReflectionHelper instance with a null target class.
-ReflectionHelper.nullPointer=Unable to create class instance, the object class must be specified.
-ReflectionHelper.classNotFound=Unable to create class instance, {0} class not found
-ReflectionHelper.linkageError=Unable to link the object subclass {0}
-ReflectionHelper.instantiationError=Unable to instantiate the object subclass {0}
-ReflectionHelper.illegalAccess=Unable to access the the object subclass {0} or instance
-ReflectionHelper.exception=Unable to create subclass {0}
Assertion.Assertion_failed=Assertion failed.
Assertion.invalidClassMessage={0} must be an instance of {1}, but was an instance of {2}
-Assertion.isEqual=ASSERTION FAILED: expected values to be equal but they were different ({0} and {1})
-Assertion.isNotEqual=ASSERTION FAILED: expected values to be different but they were the same ({0} and {1})
-Assertion.isNonNegative=ASSERTION FAILED: expected value to be non-negative but value={0}
-Assertion.isNonPositive=ASSERTION FAILED: expected value to be non-positive but value={0}
-Assertion.isNegative=ASSERTION FAILED: expected value to be negative but value={0}
-Assertion.isPositive=ASSERTION FAILED: expected value to be positive but value={0}
-Assertion.isNotZeroLength=ASSERTION FAILED: expected string to have at least one character
Assertion.isNull=ASSERTION FAILED: expected reference to be null
Assertion.isNotNull=ASSERTION FAILED: expected reference to be not null
-Assertion.isIdentical=ASSERTION FAILED: expected objects to be identical ({0} and {1})
-Assertion.isEqual=ASSERTION FAILED: Objects are not equal: {0} and {1}
Assertion.invalidClassMessage=ASSERTION FAILED: The object {0} was expected to be an instance of {1} but was instance of {2}
-Assertion.isNotEmpty_Collection=ASSERTION FAILED: expected collection to not be empty, but it was
-Assertion.isNotEmpty_Map=ASSERTION FAILED: expected map to not be empty, but it was
-Assertion.contains_Collection=ASSERTION FAILED: expected collection to contain value, but it did not
-Assertion.contains_Map=ASSERTION FAILED: expected map to contain key, but it did not
-IDGenerator.The_preferred_factory_reference_may_not_be_null_1=The preferred factory reference may not be null
-IDGenerator.The_protocol_reference_may_not_be_null_2=The protocol reference may not be null
-IDGenerator.No_factory_for_the_specified_protocol_3=No factory for the specified protocol "{0}"
-IDGenerator.The_factory_reference_may_not_be_null_5=The factory reference may not be null
-IDGenerator.The_protocol_reference_may_not_be_null_6=The protocol reference may not be null
-IDGenerator.The_ObjectID_protocol_reference_may_not_be_null_7=The ObjectID protocol reference may not be null
IDGenerator.The_specified_ObjectID_protocol___8=The specified ObjectID protocol "{0}" is unknown
-IDGenerator.The_ObjectID_protocol_reference_may_not_be_null_10=The ObjectID protocol reference may not be null
-IDGenerator.The_specified_ObjectID_protocol___11=The specified ObjectID protocol "{0}" is unknown
-IDGenerator.The_ObjectID_reference_may_not_be_null_13=The ObjectID reference may not be null
-IDGenerator.The_stringified_ObjectID_may_not_be_null_14=The stringified ObjectID may not be null
-IDGenerator.The_stringified_ObjectID_does_not_have_a_protocol_15=The stringified ObjectID does not have a protocol
IDGenerator.The_stringified_ObjectID_has_an_unknown_protocol___16=The stringified ObjectID has an unknown protocol:
InvalidIDException.Invalid_ID_1=Invalid ID
IntegerIDFactory.The_specified_ID_value_is_invalid=The specified ID value "{0}" is invalid for the "{1}" protocol
@@ -122,20 +52,7 @@
UUID.ID_must_be_of_type_UUID_1=ID must be of type UUID
UUID.ID_must_be_of_type_UUID_to_parse_2=ID must be of type UUID to parse
-UUID.InvalidLengthForProtocol=The length of the specified ID value "{0}" is invalid for the "{1}" protocol
UUID.InvalidFormatForProtocol=The specified ID value "{0}" is invalid for the "{1}" protocol
-AbstractEventSource.The_event_listener_may_not_be_null=The event listener may not be null
-AbstractEventSource.The_event_class_may_not_be_null=The event class may not be null
-AsynchEventBroker.DefaultName=AsynchEventBroker
-SynchEventBroker.DefaultName=SynchEventBroker
-AbstractEventBroker.CannotAddSelfAsListener=An EventBroker cannot add itself to its list of listeners
-AbstractEventBroker.The_name_of_the_event_broker_may_not_be_null=The name of the event broker may not be null
-AbstractEventBroker.The_name_of_the_event_broker_may_not_be_zero-length=The name of the event broker may not be zero-length
-AbstractEventBroker.eventFloorExceeded=\ttime={0}\thandler={1}\n
-AbstractEventBroker.Error_during_event_processing=Error during processing of event in EventBroker \"{0}"
-AbstractEventBroker.basePerformanceMessage=\tTOTAL TIME={0}, TOTAL HANDLERS={1}, EVENT={2}, SOURCE={3}
-AbstractEventBroker.targetedPerformanceMessage=, TARGET={0}
-AbstractEventBroker.No_events_can_be_processed_EventBroker_is_shutdown=No events can be processed - EventBroker \"{0}\" is shutdown
IDGenerator.No_default_id_factory_has_been_defined=No default id factory has been defined
IntegerIDFactory.Description=An identifier that is composed of an integer value
LongIDFactory.Description=An identifier that is composed of an integer value
@@ -143,68 +60,14 @@
UUIDFactory.Description=An universally unique identifier that is composed of a 36-character formatted string.
ParsedObjectID.The_stringified_ObjectID_does_not_have_a_protocol=The stringified ObjectID does not have a protocol
ParsedObjectID.The_stringified_ObjectID_does_not_have_the_required_protocol_{0}=The stringified ObjectID does not have the required protocol {0}
-UUIDFactory.UUID_Initializer_thread_running=UUID Initializer thread running
-UUIDFactory.Instantiating_the_UUID_embedded_factory=Instantiating the UUID embedded factory
-UUIDFactory.UUID_Initializer_thread_notifying_all=UUID Initializer thread notifying all
-UUIDFactory.Attempting_to_create_UUID=Attempting to create UUID ...
-ClassLoaderUtil.Error_trying_to_load_file=Error trying to load file {0}
-ClassLoaderUtil.Error_trying_to_load_class_from_file=Error trying to load class {0} from {1}
-InterceptorStackImpl.New_Interceptor_may_not_be_null._1=New Interceptor may not be null.
-InterceptorStackImpl.Existing_Interceptor_may_not_be_null._2=Existing Interceptor may not be null.
-InterceptorStackImpl.not_same_interceptor=The interceptor does not match an interceptor already in the interceptor stack
-InterceptorStackImpl.Existing_firstInterceptor_must_already_exist_in_firstInterceptor_stack._7=Existing firstInterceptor must already exist in firstInterceptor stack.
-InterceptorStackImpl.Existing_interceptor_was_not_found_in_interceptor_stack._13=Existing interceptor was not found in interceptor stack.
-InterceptorStackImpl.Interceptor_stack_may_not_be_empty_14=Interceptor stack may not be empty
-InvocationImpl.Invocation_[__1=Invocation ["
-InvocationImpl.void_7=void
-DateUtil.The_string_is_not_of_the_expected_format_1=The string \" {0} \" is not of the expected format (\"{1}\")
-DateUtil.The_string_is_not_of_the_expected_format_2=The string \" {0} \" is not of the expected format (\"{1}\")
-DebuggerImpl.conflictWarning = Debug context "{0}" is defined in both plugins "{1}" and "{2}"; context from plugin "{1}" will be ignored.
-DebuggerImpl.timerStart=TIMER STARTED | |ID = {0} | {1}
-DebuggerImpl.timerStop =TIMER STOPPED | TIME={1} ms |ID = {0} | {2}
-DebuggerImpl.timerNotFound=***Timer not found***
ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._1=Error translating results from data type {0} to a byte[].
ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._2=Error translating results from data type {0} to a byte[].
ObjectConverterUtil.Object_type_not_supported_for_object_conversion._3=Object type {0} not supported for object conversion.
-ObjectConverterUtil.File_is_not_found_4=File {0} is not found
-ObjectConverterUtil.DEBUG.Converting_Blob_to_byte[];_size_is_1=Converting Blob to byte[]; size is {0}
FileUtils.File_does_not_exist._1=File {0} does not exist.
FileUtils.Not_a_directory=\"{0}\" is not a directory.
-SqlResourceBundle.unable_to_find_bundle=Unable to find SQL bundle with name {0} and language {1}
-MetaMatrixRuntimeException.Caused_by=Caused by:
-InterceptorStackImpl.Interceptor_array_cannot_be_empty_1=Interceptor array cannot be empty.
-ServiceInvocation.Method_not_found_{0}.{1}=Method not found {0}.{1}
-Command.Could_not_find_method=Could not find method ''{0}.{1}''.
-Command.Argument_count_mis-match,_expected_{0}_but_received_{1}=Argument count mis-match, expected {0} but received {1}.
-Command.Error_processing_file=Error processing file: ''{0}''.
-Command.Cannot_convert_to=Cannot convert to {0}
-CommandShell.Started=Started
-CommandShell.Finished=Finished
-CommandShell.Executing=Executing: {0}
-ScriptReader.Call_goto_first=Must call gotoTest() first.
-ScriptReader.Could_not_find_test_{0}=Could not find test: ''{0}''.
-ReflectionWrapper.Could_not_find_field_{0}.{1}=Could not find field ''{0}.{1}''.
-ComponentLoader.Resource_not_found__{0}_1=Resource not found: {0}.
-SqlResourceBundle.The_name_of_the_DBMS_language_may_not_be_null=The name of the DBMS language may not be null
-SqlResourceBundle.The_class_loader_may_not_be_null=The class loader may not be null
-SqlResourceBundle.The_name_of_the_SQL_resource_bundle_may_not_be_null=The name of the SQL resource bundle may not be null
-SqlResourceBundle.The_resource_bundle_reference_may_not_be_null=The resource bundle reference may not be null
+RuntimeException.Caused_by=Caused by:
IDGenerator.The_protocol_may_not_be_null=The protocol may not be null
IDGenerator.The_stringified_ID_may_not_be_null=The stringified ID may not be null
-InterceptorImpl.The_invocation_object_may_not_be_null=The invocation object may not be null
-InterceptorImpl.The_reference_to_the_next_interceptor_may_not_be_null=The reference to the next interceptor may not be null
-InterceptorStackImpl.The_reference_to_the_first_interceptor_may_not_be_null=The reference to the first interceptor may not be null
-FileLogWriter.The_File_reference_may_not_be_null=The File reference may not be null
-ServiceInvocation.The_Method_reference_may_not_be_null=The Method reference may not be null
-ServiceInvocation.The_arguments_array_may_not_be_null=The arguments array may not be null
-ServiceInvocation.The_stack_may_not_be_null=The stack may not be null
-ClassLoaderUtil.The_Class[]_of_types_may_not_be_null=The Class[] of types may not be null
-ClassLoaderUtil.The_Class[]_of_types_may_not_contain_null_references=The Class[] of types may not contain null references
-ClassLoaderUtil.The_name_of_the_class_may_not_be_null=The name of the class may not be null
-ClassUtil.The_Class_reference_may_not_be_null=The Class reference may not be null
-ClassUtil.The_instance_may_not_be_null=The instance may not be null
-DebuggerImpl.The_name_may_not_be_null=The name may not be null
-DebuggerImpl.The_value_may_not_be_null=The value may not be null
FileUtils.The_name_of_the_file_may_not_be_null=The name of the file may not be null
FileUtils.The_file_extension_may_not_be_null=The file extension may not be null
FileUtils.Unable_to_create_file_in=Unable to create file in \"{0}\"
@@ -213,86 +76,31 @@
FileUtils.Unable_to_rename_file_in=Unable to create file in \"{0}\"
FileUtils.Unable_to_delete_file_in=Unable to create file in \"{0}\"
FileUtils.File_already_exists=File "\{0}\" already exists
-FileUtils.Unable_to_rename=Unable to rename file "\{0}\" to "\{1}\"
-I18nUtil.The_object_reference_may_not_be_null=The object reference may not be null
-UserCancelledException.User_cancelled_operation_msg=User cancelled operation
-#=================================================================================================================================
-# PluginUtilImpl
-
-PluginUtilImpl.invalidJavaVersionMessage = \
- {0} requires Java version {1} or higher. Currently executing Java version {2}.
-ConfigContext.Argument_must_not_be_null_1=Argument must not be null
-PlatformPluginRegistry.Plugin_resource_not_found_{0}_1=Plugin resource not found {0}
-ScriptCommandTarget.Tests_run__{0}_test_failures__{1}_1=Tests run: {0} test failures: {1}
-ScriptCommandTarget.Test_{0}.{1}_failed.{2}_2=Test {0}.{1} failed. {2}
-
-#=================================================================================================================================
-# AspectJ
-
-AspectPreferencePage.description=Settings used while running with aspect-enabled code.
-PreferenceTimingFloor=Timing Floor (ms)
-FileLimitSizeLogWriter.Maximum_Log_Size___8=Monitoring is done every {0} mins for maximum log size {1} kbs
-FileLimitSizeLogWriter.Error_Checking_logwriter_rollover__10=Error Checking logwriter rollover <msg>:
-
-AbstractMetaMatrixAspect.0=Unexpected exception trying to resolve method for declarative txn processing
-AbstractMetaMatrixAspect.1=Unexpected Exception processing invocation
-
-EmbeddedUUIDFactory.10=\n There were ID''s that did not match...
-EmbeddedUUIDFactory.11=\ \ \ \
-EmbeddedUUIDFactory.12=\n The string conversions of all ID''s matched\!
-EmbeddedUUIDFactory.13=\n There were ID''s that were duplicated...
-EmbeddedUUIDFactory.14=\ \ \ \
-EmbeddedUUIDFactory.15=\n All ID''s generated were unique\!
-EmbeddedUUIDFactory.16=\nCompleted
-EmbeddedUUIDFactory.17=false
-
-URLClassLoaderRegistry.UnableToCreateClassLoaderForUrl_FileDoesNotExist=Unable to create class loader for the url {0}: file does not exist
-
StringIDFactory.The_specified_ID_value_is_invalid=The specified ID value \"{0}\" is invalid for the protocol \"{1}\".
-ResourceNameUtil.invalidFileExtensionError=The file name "{0}" is invalid. It must have a "{1}" file extension.
-MetaMatrixException.deserialization_exception=Could not deserialize the exception hierarchy.
stream_closed=The stream already closed
-lob.invaliddata=Invalid type of data has been retrieved from server.
-remote_lob_access=Lob object accessed is from a remote connector; Can not stream data from remote objects;
failed_convert=Failed to convert {0} into {1}
invalid_string=Value is not valid XML
-ClobImpl.Failed_copy_clob=Failed creating a new clob from the given clob: {0}.
-ClobImpl.Invalid_substring_position=The substring position "{0}" is not valid.
-ClobImpl.Invalid_substring_length=The substring length "{0}" is not valid.
-ClobImpl.Invalid_start_position=The position to begin searching, "{0}", is not valid.
-BlobImpl.Invalid_byte_position=The first byte position "{0}" is not valid.
-BlobImpl.Invalid_bytes_length=The length of the bytes, "{0}", is not valid.
-BlobImpl.Invalid_start_position=The position to begin searching, "{0}", is not valid.
Streamable.isNUll=Streamable object argument can not be null
-Streamable.InvalidReference=Streamable contents are not available, use the Streaming interface to get the contents.
-FloatToBooleanTransform.Failed_transform=Failed to transform Float to Boolean. Expected 0 or 1 for {0}
-NullToAnyTransform.Invalid_value=Invalid value for type {0}: {1} of type {2}
ObjectToAnyTransform.Invalid_value=Invalid conversion from type {0} with value ''{2}'' to type {1}
InvalidPropertyException.message=Property ''{0}'' with value ''{1}'' is not a valid {2}.
# types (029)
-ERR.003.029.0001=Cannot transform value of invalid type {0}: expecting value of type {1}
ERR.003.029.0002=Types cannot be null: (source={0}, target={1})
ERR.003.029.0003=Type names cannot be null: (source={0}, target={1})
-ERR.003.029.0004=Transform cannot be null.
-ERR.003.029.0005=Transform source name cannot be null: {0}
-ERR.003.029.0006=Transform target name cannot be null: {0}
-ERR.003.029.0013=Failed to transform {0} to Boolean. Expected 0, 1, ''TRUE'', ''FALSE'', or ''UNKNOWN'' for ''{1}''
ERR.003.029.0014=Invalid BigDecimal format in String: {0}
ERR.003.029.0015=Invalid BigInteger format in String: {0}
ERR.003.029.0016=Invalid Byte format in String: {0}
-ERR.003.029.0017=Cannot convert string of length > 1 to character: {0}
ERR.003.029.0018=Failed to transform String to Date. Expected format = yyyy-mm-dd for {0}
ERR.003.029.0019=Invalid double format in String: {0}
ERR.003.029.0020=Invalid float format in String: {0}
@@ -301,12 +109,8 @@
ERR.003.029.0023=Invalid short format in String: {0}
ERR.003.029.0024=Failed to transform String to Timestamp. Expected format = yyyy-mm-dd hh:mm:ss.fffffffff for {0}
ERR.003.029.0025=Failed to transform String to Time. Expected format = hh:mm:ss for {0}
-ERR.003.029.0026=The {0} data type mapping may not be modified.
#CM_UTIL_ERR
-ERR.003.030.0068=Init failed: {0}
-ERR.003.030.0069=Init failed: Unable to retrieve pass key.
-ERR.003.030.0070=Encryption failed: {0} {1}
ERR.003.030.0071=Decryption failed: {0} {1}
ERR.003.030.0072=Attempt to encrypt null cleartext.
ERR.003.030.0073=Attempt to encrypt zero-length cleartext.
@@ -316,30 +120,14 @@
ERR.003.030.0077=Could not get instance of cipher for encryption, invalid padding specified: {0} {1} {2}
ERR.003.030.0078=Could not initialize cipher for decryption, invalid key specified: {0} {1}
ERR.003.030.0079=Could not get encrypt cipher''s encoded algorithm parameters due to encoding error: {0} {1}
-ERR.003.030.0080=Could not initialize cipher for decryption, invalid padding specified: {0}
ERR.003.030.0081=Encryption failed: {0}
# PROPERTIES_ERR
-ERR.003.021.0010=Unable to create an unmodifiable properties from a null original instance.
-ERR.003.021.0011=Unable to modify this Properties instance.
# security.membership
-ERR.014.407.0013 = The name of a principal may not be null or zero-length.
-ERR.014.407.0014 = The name of a principal may not be greater than {0} characters.
-ERR.014.407.0015 = The type of this principal is out of range.
-ERR.014.407.0016 = Unable to make a copy of a null principal.
-ERR.014.407.0017 = Unable to use a null principal reference for merging.
-ERR.014.407.0018 = Unable to merge a {0} principal with a {1} principal.
-ERR.014.407.0019 = The two principals ("{0}" and "{1}") cannot be merged because they are not the same principal.
#JDBCUTIL
-ERR.003.030.0176=Missing JDBC driver class name.
-ERR.003.030.0177=Missing JDBC protocol name.
-ERR.003.030.0178=Missing JDBC database name.
-ERR.003.030.0179=Unable to load the JDBC driver class {0}
-ERR.003.030.0180=Driver {0} can not load {1}
-ERR.003.030.0181=Failed to connect to the Database at {0} check connection properties.
ExceptionHolder.converted_exception=Remote {1}: {0}
PropertiesUtils.failed_to_resolve_property=failed to completely resolve the property value for key {0}
Modified: trunk/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -97,11 +97,11 @@
}
public void testComputeDisplayableForm4() {
- helpTestComputeDisplayableForm("MetaMatrix", "MetaMatrix"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("MetaMatrix", "Meta Matrix"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm5() {
- helpTestComputeDisplayableForm("metaMatrix", "MetaMatrix"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("metaMatrix", "Meta Matrix"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm6() {
@@ -109,15 +109,15 @@
}
public void testComputeDisplayableForm7() {
- helpTestComputeDisplayableForm("SomeMetaMatrixEmbedded", "Some MetaMatrix Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomeMetaMatrixEmbedded", "Some Meta Matrix Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm8() {
- helpTestComputeDisplayableForm("SomeMetaMetaMatrixMetaEmbedded", "Some Meta MetaMatrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomeMetaMetaMatrixMetaEmbedded", "Some Meta Meta Matrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm9() {
- helpTestComputeDisplayableForm("SomemetaMatrixMetaMatrixMetaEmbedded", "Somemeta Matrix MetaMatrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomemetaMatrixMetaMatrixMetaEmbedded", "Somemeta Matrix Meta Matrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputePluralForm1() {
Modified: trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,7 +37,7 @@
private String parentDirectory;
@Override
- public Object createConnectionFactory() throws ResourceException {
+ public BasicConnectionFactory createConnectionFactory() throws ResourceException {
if (this.parentDirectory == null) {
throw new InvalidPropertyException(UTIL.getString("parentdirectory_not_set")); //$NON-NLS-1$
}
Modified: trunk/connectors/connector-ldap/src/main/resources/org/teiid/resource/adapter/ldap/i18n.properties
===================================================================
--- trunk/connectors/connector-ldap/src/main/resources/org/teiid/resource/adapter/ldap/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/connector-ldap/src/main/resources/org/teiid/resource/adapter/ldap/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -20,64 +20,11 @@
# 02110-1301 USA.
#
-LDAPConnector.loggerNotFound=Logger not found in current environment.
-LDAPConnector.getConnectionFailed=Connection pool is not initialized properly. Cannot create a new connection.
#
LDAPConnection.urlPropNotFound=Ldap URL property not found.
LDAPConnection.adminUserDNPropNotFound=Ldap Admin User DN property not found.
LDAPConnection.adminUserPassPropNotFound=Ldap Admin password property not found.
-LDAPConnection.maxCriteriaParseError=Ldap Max Criteria property has an invalid format.
-LDAPConnection.maxCriteriaPropNotFound=Ldap Max Criteria property not found.
-LDAPConnection.contextInitFailed=LDAP context initialization failed. Please check connector properties, and verify against LDAP server.
-LDAPConnection.propertyFileParseFailed=The Properties file could not be parsed.
LDAPConnection.directoryNamingError=Initializing LDAP directory context failed. Please check LDAP connection properties, including username and password: {0}
-LDAPConnection.directoryInitError=Initializing LDAP directory context failed.
-LDAPConnection.unsupportedExecMode=LDAPConnector does not support requested execution mode.
LDAPConnection.contextCloseError=The Connection failed to close LDAP context: {0}
-#
-IQueryToLdapSearchParser.noTablesInFromError=Cannot parse query - no tables defined in FROM clause.
-IQueryToLdapSearchParser.multiItemsInFromError=Cannot parse query - multiple items in FROM clause not supported.
-IQueryToLdapSearchParser.baseContextNameError=Base context name (DN) not specified in Name In Source or connector properties.
-IQueryToLdapSearchParser.groupCountExceededError=Query contained from clause that did not have exactly and only one group. Query not supported.
-IQueryToLdapSearchParser.criteriaNotParsableError=Compound criteria operator was not parsable.
-IQueryToLdapSearchParser.timestampClassNotFoundError=Timestamp class was not found.
-IQueryToLdapSearchParser.unsupportedElementError=Encountered an element type that is not supported. Revise the capabilities.
-IQueryToLdapSearchParser.missingNISError=An element (or expression) found in the query's compare criteria was missing a NameInSource definition (or name). Please ensure the name in source is defined for each element.
-IQueryToLdapSearchParser.criteriaNotSupportedError=Encountered a criteria that is not supported.
-IQueryToLdapSearchParser.searchDetailsLoggingError=Error writing LDAP search details to log
-#
-LDAPSyncQueryExecution.execModeError=Synchronous query was called by connector, but request does not match. Cannot execute request.
-LDAPSyncQueryExecution.setControlsError=Failed to set standard sort controls. Please verify that the server supports sorting, and that the bind user has permission to use sort controls.
-LDAPSyncQueryExecution.createContextError=Failed to create LDAP search context from the specified context name. Check the table/group name in source to ensure the context exists.
-LDAPSyncQueryExecution.configAttrsError=Failed to configure attributes properly.
-LDAPSyncQueryExecution.execSearchError=Execute search failed. Please check logs for search details.
-LDAPSyncQueryExecution.nullBatchError=A null Batch was encountered.
-LDAPSyncQueryExecution.nullAttrError=Encountered null attribute name for a select symbol. Please check name in source for each column.
-LDAPSyncQueryExecution.attrValueFetchError=Failed to fetch attribute value for attribute {0}. Rowset cannot be constructed from incomplete LDAP results.
-LDAPSyncQueryExecution.supportedClassNotFoundError=Supported class not found.
-LDAPSyncQueryExecution.closeContextError=LDAP error occurred during attempt to close context : {0}
-#
-LDAPUpdateExecution.execModeError=Update was called by connector, but request does not match. Cannot execute request.
-LDAPUpdateExecution.createContextError=Failed to create copy of the initial LDAP context: {0}
-LDAPUpdateExecution.incorrectCommandError=Incorrect command type. Expecting INSERT, UPDATE, or DELETE.
-LDAPUpdateExecution.columnSourceNameDNNullError=value for column with source name DN is null - must be set to distinguishedName for new record
-LDAPUpdateExecution.columnSourceNameDNTypeError=value for column with source name DN is not a string - must be set to distinguishedName string for new record
-LDAPUpdateExecution.noInsertSourceNameDNError=no column in insert statement with source name DN - must be present and set to distinguishedName for new record
-LDAPUpdateExecution.insertFailed=Insert of {0} failed: {1}
-LDAPUpdateExecution.insertFailedUnexpected=Insert of {0} failed for unexpected reason
-LDAPUpdateExecution.deleteFailed=Delete of {0} failed: {1}
-LDAPUpdateExecution.deleteFailedUnexpected=Delete of {0} failed for unexpected reason
-LDAPUpdateExecution.updateFailed=Update of {0} failed: {1}
-LDAPUpdateExecution.updateFailedUnexpected=Update of {0} failed for unexpected reason
-LDAPUpdateExecution.valueNotLiteralError=specified value for attribute {0} is not a literal
-LDAPUpdateExecution.criteriaEmptyError=No criteria specified on update - must specify DN in WHERE clause
-LDAPUpdateExecution.criteriaNotSimpleError=criteria is not a simple comparison - expecting simple equals comparison on DN as only item in WHERE clause
-LDAPUpdateExecution.criteriaNotEqualsError=criteria is not an equals comparison - expecting simple equals comparison on DN as only item in WHERE clause
-LDAPUpdateExecution.criteriaLHSNotElementError=left side of criteria is not an element name - expecting simple equals comparison on DN as only item in WHERE clause
-LDAPUpdateExecution.criteriaSrcColumnError=criteria is on source column {0}, but should be on a source column named DN
-LDAPUpdateExecution.criteriaRHSNotLiteralError=right side of equals comparison against DN is not a literal - must be a string literal
-LDAPUpdateExecution.criteriaRHSNotStringError=right side of equals comparison against DN is not a string - must be a string literal
-LDAPUpdateExecution.closeContextError=LDAP error occurred during attempt to close context : {0}
-#
-LDAPSourceConnectionFactory.creatingConnection=LDAPSourceConnectionFactory is creating a new connection.
+
Modified: trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -95,7 +95,7 @@
}
@Override
- public Object createConnectionFactory() throws ResourceException {
+ public BasicConnectionFactory createConnectionFactory() throws ResourceException {
return new BasicConnectionFactory() {
@Override
public SalesforceConnectionImpl getConnection() throws ResourceException {
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,7 +33,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.DataPayload;
import org.teiid.translator.salesforce.execution.DeletedObject;
@@ -115,7 +114,7 @@
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
throw new ResourceException(e.getCause().getMessage());
}
- LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username);
+ LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
sh = new SessionHeader();
sh.setSessionId(loginResult.getSessionId());
@@ -156,7 +155,7 @@
if(batchSize > 2000) {
batchSize = 2000;
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.reduced.batch.size")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "reduced.batch.size"); //$NON-NLS-1$
}
QueryResult qr = null;
@@ -216,7 +215,7 @@
DeleteResult result = results.get(i);
if(!result.isSuccess()) {
if(allGood) {
- errorMessages.append("Error(s) executing DELETE: ");
+ errorMessages.append("Error(s) executing DELETE: "); //$NON-NLS-1$
allGood = false;
}
List<com.sforce.soap.partner.Error> errors = result.getErrors();
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,4 +30,3 @@
YahooExecution.Parse_date_error=Unable to parse date value: {0}, got: {1}
YahooExecution.Parse_time_value=Unable to parse time value: {0}, got: {1}
YahooExecution.Invalid_select_symbol=Yahoo connector can''t handle {0} in SELECT
-YahooConnector.proxyPortNotSet=HTTP proxy port is not set. The default port number 80 will be used.
Modified: trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -221,4 +221,9 @@
param.setAnnotation("The contents to save. Can be one of CLOB, BLOB, or XML");
}
+ @Override
+ public boolean areLobsUsableAfterClose() {
+ return true;
+ }
+
}
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -34,7 +34,7 @@
public JDBCExecutionException(SQLException error,
TranslatedCommand... commands) {
- super(error.getErrorCode(), commands == null ? error.getMessage() : JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", //$NON-NLS-1$
+ super(error, error.getErrorCode(), commands == null || commands.length == 0 ? error.getMessage() : JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", //$NON-NLS-1$
error.getMessage(), Arrays.toString(commands)));
}
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeExecutionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,12 +35,16 @@
import org.teiid.language.LanguageObject;
import org.teiid.language.Literal;
import org.teiid.language.NamedTable;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.Translator;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.ConvertModifier;
import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
@@ -58,28 +62,8 @@
public void start() throws TranslatorException {
super.start();
- registerFunctionModifier("PATH", new FunctionModifier() { //$NON-NLS-1$
-
- @Override
- public List<?> translate(Function function) {
- List<Object> objs = new ArrayList<Object>();
-
- List<Expression> parms = function.getParameters();
-
- for (Expression s : parms)
- {
- String v = s.toString();
- v.replace('\'', ' ');
- objs.add(v);
- }
-
- return objs;
- }
- } );
-
-
-
-
+ registerFunctionModifier("PATH", new PathFunctionModifier());
+
//add in type conversion
ConvertModifier convertModifier = new ConvertModifier();
@@ -126,32 +110,50 @@
return null;
}
}, FunctionModifier.BOOLEAN);
+
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+
+
+ LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Started"); //$NON-NLS-1$
+
}
+ /**
+ * Create the {@link SQLConversionVisitor} that will perform translation. Typical custom
+ * JDBC connectors will not need to create custom conversion visitors, rather implementors
+ * should override existing {@link JDBCExecutionFactory} methods.
+ * @return the {@link SQLConversionVisitor}
+ */
+ public SQLConversionVisitor getSQLConversionVisitor() {
+ return new ModeShapeSQLVisitor(this);
+ }
+
@Override
public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ if (obj instanceof NamedTable) {
+ NamedTable nt = (NamedTable) obj;
+ List<String> ntlist = new ArrayList<String>(1);
+ ntlist.add(ModeShapeUtil.createJCRName(nt.getMetadataObject().getNameInSource()));
+ return ntlist;
+ } else if (obj instanceof ColumnReference) {
+ ColumnReference elem = (ColumnReference) obj;
+
+ String nameInSource = "NoNameInSource";
+ if (elem.getMetadataObject() != null) {
+ nameInSource = elem.getMetadataObject().getNameInSource();
+
+ List<String> ntlist = new ArrayList<String>(1);
+ ntlist.add(ModeShapeUtil.createJCRName(nameInSource));
- if (obj instanceof NamedTable) {
-
- NamedTable nt = (NamedTable) obj;
- List<String> ntlist = new ArrayList<String>(1);
-
- ntlist.add("[" + nt.getMetadataObject().getNameInSource() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- return ntlist;
- }
-
- if (obj instanceof ColumnReference) {
- ColumnReference elem = (ColumnReference) obj;
- List<String> ntlist = new ArrayList<String>(1);
- ntlist.add("[" + elem.getMetadataObject().getNameInSource() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
- return ntlist;
-
- }
-
- return super.translate(obj, context);
- }
-
+ return ntlist;
+ }
+ }
+
+ return super.translate(obj, context);
+ }
+
+
@Override
public String translateLiteralBoolean(Boolean booleanValue) {
if(booleanValue.booleanValue()) {
@@ -182,13 +184,13 @@
@Override
public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("PATH"); //$NON-NLS-1$
- supportedFunctions.add("NAME"); //$NON-NLS-1$
- supportedFunctions.add("ISCHILDNODE"); //$NON-NLS-1$
-
- return supportedFunctions;
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("PATH"); //$NON-NLS-1$
+ supportedFunctions.add("NAME"); //$NON-NLS-1$
+ supportedFunctions.add("ISCHILDNODE"); //$NON-NLS-1$
+
+ return supportedFunctions;
}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeSQLVisitor.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeSQLVisitor.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeSQLVisitor.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeSQLVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,95 @@
+package org.teiid.translator.jdbc.modeshape;
+
+import static org.teiid.language.SQLConstants.Reserved.BY;
+import static org.teiid.language.SQLConstants.Reserved.ORDER;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.teiid.language.ColumnReference;
+import org.teiid.language.DerivedColumn;
+import org.teiid.language.Expression;
+import org.teiid.language.OrderBy;
+import org.teiid.language.Select;
+import org.teiid.language.SortSpecification;
+import org.teiid.language.SQLConstants.Tokens;
+import org.teiid.metadata.Column;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+public class ModeShapeSQLVisitor extends SQLConversionVisitor {
+
+ private Map<String, Column> columnMap = new HashMap<String, Column>();
+ private Map<String, Column> aliasMap = new HashMap<String, Column>();
+
+ public ModeShapeSQLVisitor(JDBCExecutionFactory ef) {
+ super(ef);
+
+ }
+
+ public void visit(Select query) {
+
+ // if the query has an order by, then
+ // need to cache the columns so that the
+ // order by column name can be replaced by its
+ // correlating select column that has the nameInSource
+ if (query.getOrderBy() == null) {
+ super.visit(query);
+ return;
+ }
+
+ List<DerivedColumn> selectSymbols = query.getDerivedColumns();
+ Iterator<DerivedColumn> symbolIter = selectSymbols.iterator();
+ while (symbolIter.hasNext()) {
+ DerivedColumn symbol = symbolIter.next();
+ Expression expression = symbol.getExpression();
+
+ if (symbol.getAlias() != null) {
+
+ }
+ // cache the columns so that order by
+ if (expression instanceof ColumnReference) {
+ ColumnReference colRef = (ColumnReference) expression;
+ if (colRef.getMetadataObject() != null) {
+ Column element = colRef.getMetadataObject();
+ if (symbol.getAlias() != null) {
+ aliasMap.put(symbol.getAlias(), element);
+ }
+ columnMap.put(element.getName(), element);
+ }
+ }
+ }
+
+ super.visit(query);
+ }
+
+ public void visit(OrderBy obj) {
+ buffer.append(ORDER)
+ .append(Tokens.SPACE)
+ .append(BY)
+ .append(Tokens.SPACE);
+
+ List<SortSpecification> specs = obj.getSortSpecifications();
+ for (SortSpecification spec : specs) {
+ String specName = spec.getExpression().toString();
+ Column col = null;
+
+ col = aliasMap.get(specName);
+ if (col == null) {
+ col = columnMap.get(specName);
+ }
+ if (col != null) {
+ buffer.append(ModeShapeUtil.createJCRName(col.getNameInSource()))
+ .append(" ")
+ .append(spec.getOrdering().toString());
+
+ } else {
+ buffer.append(obj.getSortSpecifications());
+ }
+ }
+
+ }
+
+}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeUtil.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeUtil.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeUtil.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/ModeShapeUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,27 @@
+package org.teiid.translator.jdbc.modeshape;
+
+public class ModeShapeUtil {
+
+ public static final String createJCRName(String name) {
+ return "[" + ModeShapeUtil.trimTics(name) + "]";
+ }
+
+ /**
+ * Because the Teiid Designer Import from JDBC adds tic's to a nameInSource that has special characters,
+ * they have to be removed when building the sql syntax
+ * @param name
+ * @return
+ */
+ public static final String trimTics(String name) {
+ String rtn = name;
+ if (rtn.startsWith("'")) {
+ rtn = rtn.substring(1);
+ }
+
+ if (rtn.endsWith("'")) {
+ rtn = rtn.substring(0, rtn.indexOf("'"));
+ }
+ return rtn;
+ }
+
+}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/PathFunctionModifier.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/PathFunctionModifier.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/PathFunctionModifier.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/PathFunctionModifier.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,58 @@
+/*
+ * 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.jdbc.modeshape;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+
+/**
+ * Function to translate the PATH function
+ * @since 7.1
+ */
+public class PathFunctionModifier extends FunctionModifier {
+
+ public PathFunctionModifier() {
+ super();
+ }
+
+ public List<?> translate(Function function) {
+ List<Object> objs = new ArrayList<Object>();
+
+ List<Expression> parms = function.getParameters();
+
+ for (Expression s : parms)
+ {
+ String v = s.toString();
+ v.replace('\'', ' ');
+ objs.add(v);
+ }
+
+ return objs;
+ }
+
+}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions)
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java 2010-09-23 21:09:51 UTC (rev 2599)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,42 +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.jdbc.modeshape.functions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-/**
- * Function for Cast
- * @since 7.1
- */
-public class Cast {
-
- public Object cast(String literal, String asType) {
- return "";
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Cast.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,42 @@
+/*
+ * 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.jdbc.modeshape.functions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+/**
+ * Function for Cast
+ * @since 7.1
+ */
+public class Cast {
+
+ public Object cast(String literal, String asType) {
+ return "";
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java 2010-09-23 21:09:51 UTC (rev 2599)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,43 +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.jdbc.modeshape.functions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-
-/**
- * Function for IsChildNode
- * @since 7.1
- */
-public class IsChildNode {
-
- public boolean isChildNode(String childSelectorName, String parentSelectorName) {
- return false;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsChildNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,43 @@
+/*
+ * 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.jdbc.modeshape.functions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+
+/**
+ * Function for IsChildNode
+ * @since 7.1
+ */
+public class IsChildNode {
+
+ public boolean isChildNode(String childSelectorName, String parentSelectorName) {
+ return false;
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java 2010-09-23 21:09:51 UTC (rev 2599)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,47 +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.jdbc.modeshape.functions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-
-/**
- * Function for IsSameNode
- * @since 7.1
- */
-public class IsSameNode {
-
- public boolean isSameNode(String selectorName, String joinSelectorName) {
- return false;
- }
-
- public boolean isSameNode(String selectorName, String joinSelectorName, String selectorPathName) {
- return false;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/IsSameNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,47 @@
+/*
+ * 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.jdbc.modeshape.functions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+
+/**
+ * Function for IsSameNode
+ * @since 7.1
+ */
+public class IsSameNode {
+
+ public boolean isSameNode(String selectorName, String joinSelectorName) {
+ return false;
+ }
+
+ public boolean isSameNode(String selectorName, String joinSelectorName, String selectorPathName) {
+ return false;
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java 2010-09-23 21:09:51 UTC (rev 2599)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,42 +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.jdbc.modeshape.functions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-/**
- * Function for Name
- * @since 7.1
- */
-public class Name {
-
- public String name(String name) {
- return "";
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Name.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,42 @@
+/*
+ * 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.jdbc.modeshape.functions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+/**
+ * Function for Name
+ * @since 7.1
+ */
+public class Name {
+
+ public String name(String name) {
+ return "";
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java 2010-09-23 21:09:51 UTC (rev 2599)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,48 +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.jdbc.modeshape.functions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-
-/**
- * Function for Path
- * @since 7.1
- */
-public class Path {
-
-
- public String path() {
- return "";
- }
-
- public String path(String name) {
- return "";
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/functions/Path.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,48 @@
+/*
+ * 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.jdbc.modeshape.functions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+
+/**
+ * Function for Path
+ * @since 7.1
+ */
+public class Path {
+
+
+ public String path() {
+ return "";
+ }
+
+ public String path(String name) {
+ return "";
+ }
+
+}
Modified: trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
===================================================================
--- trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -20,57 +20,16 @@
# 02110-1301 USA.
#
-JDBCSourceConnectionFactory.Missing_JDBC_jndi_1=Missing JDBC Source JNDI Name
-JDBCSourceConnectionFactory.Missing_JDBC_protocol_name_2=Missing JDBC protocol name
-JDBCSourceConnectionFactory.Missing_JDBC_database_name_3=Missing JDBC database name
-JDBCSourceConnectionFactory.Unable_to_load_the_JDBC_driver_class_6=Unable to load the JDBC driver class "{0}".
-JDBCSourceConnectionFactory.Driver__7=Driver "{0}" can not load "{1}".
-JDBCUpdateExecution.batch_prep_stmt=Executing batched prepared statements is not supported: {0}
-JDBCUpdateExecution.batch_stored_proc=Executing batched stored procedures is not supported: {0}
-JDBCSourceConnectionFactory.til=Unsupported transaction isolation level "{0}".
-JDBCSourceConnectionFactory.MissingProp=Missing required property: {0}
-JDBCSourceXAConnecton.Connection_still_leased=Connection is still leased to connector worker. However, transaction ended, so terminating the lease.
-JDBCSourceConnectionFactory.Unable_to_find_jndi_ds=Failed to locate data source named {0} through JNDI lookup.
JDBCTranslator.Unexpected_exception_translating_results___8=Unexpected exception while translating results: {0}
-JDBCTranslator.Unknown_error_translating_results___9=Unknown error translating results: {0}
-JDBCTranslator._Unable_to_get_Blob_and_set_parameter._{0}=\ Unable to get Blob and set parameter. {0}
-JDBCTranslator._Unable_to_get_Clob_and_set_parameter._{0}=\ Unable to get Clob and set parameter. {0}
-JDBCTranslator.Unable_to_set_appropriate_output_parameter_type_of_class({0})=Unable to set the appropriate output parameter type of class({0}) to JDBC Driver
-JDBCConnector.No_license_found_for_{0}=No license found for {0}
-JDBCConnector.JDBCConnector_initialized._1=JDBCConnector initialized.
-JDBCConnector.JDBCConnector_stopped._3=JDBCConnector stopped.
-JDBCConnector.JDBCConnector_started._4=JDBCConnector started.
-JDBCConnector.JDBCConnector_is_not_started._5=JDBCConnector is not started.
-JDBCConnector.unsupported_identity_type=Unsupported identity type.
-JDBCConnector.non_xa_connection_source=Connection source does not support XA.
-JDBCConnector.invalid_source=Specified connection source {0} is not a XADataSource, DataSource, or Driver
-BlobValueReference.Unable_to_read_BLOB_data=Unable to read BLOB data from InputStream.
-ClobValueReference.Unable_to_read_CLOB_data=Unable to read CLOB data from character stream.
-BasicSQLTranslator.The_format_of_set_criteria_batch_size_is_incorrect._1=The format of set criteria batch size is incorrect.
-JDBCSynchExecution.Statement_type_not_support_for_command_1=Statement type {0} not support for command {1}
-JDBCSourceConnection.Property_{0}_is_required,_but_not_defined_1=Property {0} is required, but not defined
-DropFunctionModifier.DropFunctionModifier_can_only_be_used_on_functions_with___1=DropFunctionModifier can only be used on functions with minimum or more number of arguments:
-JDBCSourceConnection.Execution_mode_not_supported__{0}_1=Execution mode not supported: {0}
-JDBCProcedureExecution.The_parameter_direction_must_be_out_or_inout_1=The parameter direction must be out or inout
-JDBCProcedureExecution.Unexpected_exception_1=Unexpected exception
-JDBCQueryExecution.Error_executing_query__1 = {0}\n\nExecuting statement:\n\n {1}
-JDBCQueryExecution.Error_executing_query__2 = {0}\n\nAfter executing batch statements:\n
-JDBCQueryExecution.Error_executing_query__3 = {0}\n\nWhile executing batch statements:\n
+JDBCQueryExecution.Error_executing_query__1 = ''{0}'' error executing statement(s): {1}
-JDBCSingleIdentityDSConnectionFactory.Unable_to_set_DataSource_property=Unable to set DataSource property name \"{0}\" to value \"{1}"
-JDBCXAConnector.Connector_use_exclusive_mode_1=Connector uses exclusive connections for transactions.
ConnectionListener.failed_to_report_jdbc_connection_details=Failed to report the JDBC driver and connection information
-ConnectionListener.failed_to_report_oracle_connection_details=Failed to report Oracle driver and connection information, consider making the V$ tables public for providing useful information for tuning purposes
-StringToTimestampWithTimeZoneTransform=Unable to parse timestamp string: {0}
-JDBCUserIdentityConnectionFactory.Unable_to_get_credentials=Unable to extract credentials from command payload or trusted session payload for per-user connection.
-JDBCUserIdentityConnectionFactory.Connection_property_missing=Required connection property "{0}" missing for system "{1}".
-BasicResultsTranslator.Couldn__t_parse_property=Could not parse property: {0}
JDBCMetadataProcessor.cannot_find_primary=Cannot find primary key table {0}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,15 +22,15 @@
package org.teiid.translator.jdbc.modeshape;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.cdk.api.TranslationUtility;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Command;
+import org.teiid.language.LanguageFactory;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -46,14 +46,16 @@
.getTestDataPath()
: "src/test/resources")
+ "/ModeShape.vdb";
+
+
+ @BeforeClass
+ public static void setUp() throws TranslatorException {
+ TRANSLATOR = new ModeShapeExecutionFactory();
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
- @BeforeClass
- public static void setUp() throws TranslatorException {
- TRANSLATOR = new ModeShapeExecutionFactory();
- TRANSLATOR.start();
+ }
- }
-
public void helpTestVisitor(TranslationUtility util, String input,
String expectedOutput) throws TranslatorException {
// Convert from sql to objects
@@ -64,61 +66,55 @@
tc.translateCommand(obj);
assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
}
-
+
@Test
- public void testSimpleSelect() throws Exception {
- String input = "select Model from Car"; //$NON-NLS-1$
- String output = "SELECT [car:Model] FROM [car:Car]"; //$NON-NLS-1$
+ public void testSelectAllFromBase() throws Exception {
+ String input = "select * from nt_base"; //$NON-NLS-1$
+ String output = "SELECT [jcr:primaryType] FROM [nt:base]"; //$NON-NLS-1$
- // FakeTranslationFactory.getInstance().getExampleTranslationUtility(),
helpTestVisitor(new TranslationUtility(MODESHAPE_VDB), input, output);
}
-
+
@Test
- public void testWhereClause() throws Exception {
+ public void testSelectColumnFromBase() throws Exception {
+ String input = "select jcr_primaryType from nt_base"; //$NON-NLS-1$
+ String output = "SELECT [jcr:primaryType] FROM [nt:base]"; //$NON-NLS-1$
- String input = "select Model from Car WHERE Make = 'Honda'"; //$NON-NLS-1$
- String output = "SELECT [car:Model] FROM [car:Car] WHERE [car:Make] = 'Honda'"; //$NON-NLS-1$
-
- // FakeTranslationFactory.getInstance().getExampleTranslationUtility(),
helpTestVisitor(new TranslationUtility(MODESHAPE_VDB), input, output);
- }
+ }
@Test
- public void testOrderBy() throws Exception {
+ public void testWhereClause() throws Exception {
- String input = "select Model from Car ORDER BY Make"; //$NON-NLS-1$
- String output = "SELECT [car:Model] FROM [car:Car] ORDER BY [car:Make]"; //$NON-NLS-1$
+ String input = "SELECT jcr_primaryType from nt_base WHERE jcr_primaryType = 'relational:column'"; //$NON-NLS-1$
+ String output = "SELECT [jcr:primaryType] FROM [nt:base] WHERE [jcr:primaryType] = 'relational:column'"; //$NON-NLS-1$
- // FakeTranslationFactory.getInstance().getExampleTranslationUtility(),
helpTestVisitor(new TranslationUtility(MODESHAPE_VDB), input, output);
}
- @Ignore
@Test
- public void testUsingAlias() throws Exception {
+ public void testOrderBy() throws Exception {
- String input = "select c.Model from Car As c"; //$NON-NLS-1$
- String output = "SELECT c.[car:Model] FROM [car:Car] As c"; //$NON-NLS-1$
+ String input = "SELECT jcr_primaryType from nt_base ORDER BY jcr_primaryType"; //$NON-NLS-1$
+ String output = "SELECT [jcr:primaryType] FROM [nt:base] ORDER BY [jcr:primaryType] ASC"; //$NON-NLS-1$
- // FakeTranslationFactory.getInstance().getExampleTranslationUtility(),
helpTestVisitor(new TranslationUtility(MODESHAPE_VDB), input, output);
}
- @Ignore
@Test
- public void testUsingNameFunction() throws Exception {
+ public void testUsingLike() throws Exception {
- String input = "select Model from Car as car WHERE PATH('car') LIKE '%/Hybrid/%'"; //$NON-NLS-1$
- String output = "SELECT [car:Model] FROM [car:Car] WHERE PATH(car:Car) LIKE '%/Hybrid/%'"; //$NON-NLS-1$
+ String input = "SELECT jcr_primaryType from nt_base WHERE jcr_primaryType LIKE '%relational%'"; //$NON-NLS-1$
+ String output = "SELECT [jcr:primaryType] FROM [nt:base] WHERE [jcr:primaryType] LIKE '%relational%'"; //$NON-NLS-1$
- // FakeTranslationFactory.getInstance().getExampleTranslationUtility(),
helpTestVisitor(new TranslationUtility(MODESHAPE_VDB), input, output);
}
+
+
}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestPathFunctionModifier.java (from rev 2599, branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestPathFunctionModifier.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestPathFunctionModifier.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestPathFunctionModifier.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,87 @@
+/*
+ * 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.jdbc.modeshape;
+
+import java.util.Arrays;
+import java.util.Collections;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.language.Literal;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+
+/**
+ */
+public class TestPathFunctionModifier extends TestCase {
+
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ /**
+ * Constructor for TestMonthFunctionModifier.
+ * @param name
+ */
+ public TestPathFunctionModifier(String name) {
+ super(name);
+ }
+
+ public void helpTestMod(Expression c, String expectedStr, String target) throws Exception {
+ Function func = null;
+ if (c != null) {
+ func = LANG_FACTORY.createFunction(target,
+ Arrays.asList(c),
+ String.class);
+ } else {
+ func = LANG_FACTORY.createFunction(target,
+ Collections.EMPTY_LIST,
+ String.class);
+
+ }
+
+ ModeShapeExecutionFactory trans = new ModeShapeExecutionFactory();
+ trans.start();
+
+ SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
+
+ sqlVisitor.append(func);
+ assertEquals(expectedStr, sqlVisitor.toString());
+ }
+
+
+ public void test1() throws Exception {
+ Literal arg1 = LANG_FACTORY.createLiteral("car", String.class); //$NON-NLS-1$
+ helpTestMod(arg1, "PATH('car')", "PATH"); //$NON-NLS-1$
+ }
+
+ public void test2() throws Exception {
+ helpTestMod(null, "PATH()", "PATH"); //$NON-NLS-1$
+ }
+
+
+}
+
Modified: trunk/connectors/translator-jdbc/src/test/resources/ModeShape.vdb
===================================================================
(Binary files differ)
Modified: trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
===================================================================
--- trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -20,18 +20,43 @@
# 02110-1301 USA.
#
+IQueryToLdapSearchParser.noTablesInFromError=Cannot parse query - no tables defined in FROM clause.
+IQueryToLdapSearchParser.multiItemsInFromError=Cannot parse query - multiple items in FROM clause not supported.
+IQueryToLdapSearchParser.baseContextNameError=Base context name (DN) not specified in Name In Source or connector properties.
+IQueryToLdapSearchParser.groupCountExceededError=Query contained from clause that did not have exactly and only one group. Query not supported.
+IQueryToLdapSearchParser.criteriaNotParsableError=Compound criteria operator was not parsable.
+IQueryToLdapSearchParser.timestampClassNotFoundError=Timestamp class was not found.
+IQueryToLdapSearchParser.unsupportedElementError=Encountered an element type that is not supported. Revise the capabilities.
+IQueryToLdapSearchParser.missingNISError=An element (or expression) found in the query's compare criteria was missing a NameInSource definition (or name). Please ensure the name in source is defined for each element.
+IQueryToLdapSearchParser.criteriaNotSupportedError=Encountered a criteria that is not supported.
+IQueryToLdapSearchParser.searchDetailsLoggingError=Error writing LDAP search details to log
#
-LDAPConnection.urlPropNotFound=Ldap URL property not found.
-LDAPConnection.adminUserDNPropNotFound=Ldap Admin User DN property not found.
-LDAPConnection.adminUserPassPropNotFound=Ldap Admin password property not found.
-LDAPConnection.maxCriteriaParseError=Ldap Max Criteria property has an invalid format.
-LDAPConnection.maxCriteriaPropNotFound=Ldap Max Criteria property not found.
-LDAPConnection.contextInitFailed=LDAP context initialization failed. Please check connector properties, and verify against LDAP server.
-LDAPConnection.propertyFileParseFailed=The Properties file could not be parsed.
-LDAPConnection.directoryNamingError=Initializing LDAP directory context failed. Please check LDAP connection properties, including username and password: {0}
-LDAPConnection.directoryInitError=Initializing LDAP directory context failed.
-LDAPConnection.unsupportedExecMode=LDAPConnector does not support requested execution mode.
-LDAPConnection.contextCloseError=The Connection failed to close LDAP context: {0}
+LDAPSyncQueryExecution.setControlsError=Failed to set standard sort controls. Please verify that the server supports sorting, and that the bind user has permission to use sort controls.
+LDAPSyncQueryExecution.createContextError=Failed to create LDAP search context from the specified context name. Check the table/group name in source to ensure the context exists.
+LDAPSyncQueryExecution.execSearchError=Execute search failed. Please check logs for search details.
+LDAPSyncQueryExecution.nullAttrError=Encountered null attribute name for a select symbol. Please check name in source for each column.
+LDAPSyncQueryExecution.attrValueFetchError=Failed to fetch attribute value for attribute {0}. Rowset cannot be constructed from incomplete LDAP results.
+LDAPSyncQueryExecution.supportedClassNotFoundError=Supported class not found.
+LDAPSyncQueryExecution.closeContextError=LDAP error occurred during attempt to close context : {0}
#
-ILDAPSourceConnectionFactory.creatingConnection=LDAPSourceConnectionFactory is creating a new connection.
+LDAPUpdateExecution.createContextError=Failed to create copy of the initial LDAP context: {0}
+LDAPUpdateExecution.incorrectCommandError=Incorrect command type. Expecting INSERT, UPDATE, or DELETE.
+LDAPUpdateExecution.columnSourceNameDNNullError=value for column with source name DN is null - must be set to distinguishedName for new record
+LDAPUpdateExecution.columnSourceNameDNTypeError=value for column with source name DN is not a string - must be set to distinguishedName string for new record
+LDAPUpdateExecution.noInsertSourceNameDNError=no column in insert statement with source name DN - must be present and set to distinguishedName for new record
+LDAPUpdateExecution.insertFailed=Insert of {0} failed: {1}
+LDAPUpdateExecution.insertFailedUnexpected=Insert of {0} failed for unexpected reason
+LDAPUpdateExecution.deleteFailed=Delete of {0} failed: {1}
+LDAPUpdateExecution.deleteFailedUnexpected=Delete of {0} failed for unexpected reason
+LDAPUpdateExecution.updateFailed=Update of {0} failed: {1}
+LDAPUpdateExecution.updateFailedUnexpected=Update of {0} failed for unexpected reason
+LDAPUpdateExecution.valueNotLiteralError=specified value for attribute {0} is not a literal
+LDAPUpdateExecution.criteriaEmptyError=No criteria specified on update - must specify DN in WHERE clause
+LDAPUpdateExecution.criteriaNotSimpleError=criteria is not a simple comparison - expecting simple equals comparison on DN as only item in WHERE clause
+LDAPUpdateExecution.criteriaNotEqualsError=criteria is not an equals comparison - expecting simple equals comparison on DN as only item in WHERE clause
+LDAPUpdateExecution.criteriaLHSNotElementError=left side of criteria is not an element name - expecting simple equals comparison on DN as only item in WHERE clause
+LDAPUpdateExecution.criteriaSrcColumnError=criteria is on source column {0}, but should be on a source column named DN
+LDAPUpdateExecution.criteriaRHSNotLiteralError=right side of equals comparison against DN is not a literal - must be a string literal
+LDAPUpdateExecution.criteriaRHSNotStringError=right side of equals comparison against DN is not a string - must be a string literal
+LDAPUpdateExecution.closeContextError=LDAP error occurred during attempt to close context : {0}
Deleted: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,40 +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.salesforce;
-
-import java.util.MissingResourceException;
-
-import org.teiid.core.BundleUtil;
-
-public class Messages {
-
- private static final BundleUtil RESOURCE_BUNDLE = BundleUtil.getBundleUtil(Messages.class);
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,9 +30,9 @@
public class Util {
public static String stripQutes(String id) {
- if((id.startsWith("'") && id.endsWith("'"))) {
+ if((id.startsWith("'") && id.endsWith("'"))) { //$NON-NLS-1$ //$NON-NLS-2$
id = id.substring(1,id.length()-1);
- } else if ((id.startsWith("\"") && id.endsWith("\""))) {
+ } else if ((id.startsWith("\"") && id.endsWith("\""))) { //$NON-NLS-1$ //$NON-NLS-2$
id = id.substring(1,id.length()-1);
}
return id;
@@ -40,11 +40,11 @@
public static String addSingleQuotes(String text) {
StringBuffer result = new StringBuffer();
- if(!text.startsWith("'")) {
+ if(!text.startsWith("'")) { //$NON-NLS-1$
result.append('\'');
}
result.append(text);
- if(!text.endsWith("'")) {
+ if(!text.endsWith("'")) { //$NON-NLS-1$
result.append('\'');
}
return result.toString();
@@ -52,20 +52,20 @@
public static void validateQueryLength(StringBuffer query) throws TranslatorException {
if(query.length() >= 10000) {
- throw new TranslatorException(Messages.getString("Util.query.exceeds.max.length"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("Util.query.exceeds.max.length")); //$NON-NLS-1$
}
}
public static SimpleDateFormat getSalesforceDateTimeFormat() {
- return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+ return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); //$NON-NLS-1$
}
public static SimpleDateFormat getTimeZoneOffsetFormat() {
- return new SimpleDateFormat("Z");
+ return new SimpleDateFormat("Z"); //$NON-NLS-1$
}
public static DateFormat getSalesforceDateFormat() {
- return new SimpleDateFormat("yyyy-MM-dd");
+ return new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
}
}
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -49,7 +49,7 @@
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.Util;
import org.teiid.translator.salesforce.execution.visitors.JoinQueryVisitor;
@@ -104,11 +104,11 @@
}
public void cancel() throws TranslatorException {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
}
public void close() {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
}
@Override
@@ -248,7 +248,7 @@
if (element.getNameInSource().equalsIgnoreCase("id")) { //$NON-NLS-1$
setValueInColumn(j, sObject.getId(), result);
} else {
- throw new TranslatorException("SalesforceQueryExecutionImpl.missing.field"+ element.getNameInSource()); //$NON-NLS-1$
+ throw new TranslatorException(SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.missing.field")+ element.getNameInSource()); //$NON-NLS-1$
}
} else {
Object cell;
@@ -305,7 +305,7 @@
@SuppressWarnings("unchecked")
private Object getCellDatum(Column element, Element elem) throws TranslatorException {
if(!element.getNameInSource().equals(elem.getLocalName())) {
- throw new TranslatorException("SalesforceQueryExecutionImpl.column.mismatch1" + element.getNameInSource() + "SalesforceQueryExecutionImpl.column.mismatch2" + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException(SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.column.mismatch1") + element.getNameInSource() + SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.column.mismatch2") + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
}
String value = elem.getTextContent();
Object result = null;
@@ -318,37 +318,31 @@
result = Boolean.valueOf(value);
} else if (type.equals(Double.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = Double.valueOf(value);
}
}
} else if (type.equals(Integer.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = Integer.valueOf(value);
}
}
} else if (type.equals(java.sql.Date.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = java.sql.Date.valueOf(value);
}
}
} else if (type.equals(java.sql.Timestamp.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else try {
- Date date = Util.getSalesforceDateTimeFormat().parse(value);
- result = new Timestamp(date.getTime());
- } catch (ParseException e) {
- throw new TranslatorException(e, "SalesforceQueryExecutionImpl.datatime.parse" + value); //$NON-NLS-1$
+ if(!value.isEmpty()) {
+ try {
+ Date date = Util.getSalesforceDateTimeFormat().parse(value);
+ result = new Timestamp(date.getTime());
+ } catch (ParseException e) {
+ throw new TranslatorException(e, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.datatime.parse") + value); //$NON-NLS-1$
+ }
}
}
} else {
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -45,7 +45,7 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.Util;
@@ -54,21 +54,21 @@
*/
public abstract class CriteriaVisitor extends HierarchyVisitor implements ICriteriaVisitor {
- private static final String RESTRICTEDMULTISELECTPICKLIST = "restrictedmultiselectpicklist";
- private static final String MULTIPICKLIST = "multipicklist";
- protected static final String SELECT = "SELECT";
- protected static final String FROM = "FROM";
- protected static final String WHERE = "WHERE";
- protected static final String ORDER_BY = "ORDER BY";
- protected static final String LIMIT = "LIMIT";
- protected static final String SPACE = " ";
- protected static final String EXCLUDES = "EXCLUDES";
- protected static final String INCLUDES = "includes";
- protected static final String COMMA = ",";
- protected static final String SEMI = ";";
- protected static final String APOS = "'";
- protected static final String OPEN = "(";
- protected static final String CLOSE = ")";
+ private static final String RESTRICTEDMULTISELECTPICKLIST = "restrictedmultiselectpicklist"; //$NON-NLS-1$
+ private static final String MULTIPICKLIST = "multipicklist"; //$NON-NLS-1$
+ protected static final String SELECT = "SELECT"; //$NON-NLS-1$
+ protected static final String FROM = "FROM"; //$NON-NLS-1$
+ protected static final String WHERE = "WHERE"; //$NON-NLS-1$
+ protected static final String ORDER_BY = "ORDER BY"; //$NON-NLS-1$
+ protected static final String LIMIT = "LIMIT"; //$NON-NLS-1$
+ protected static final String SPACE = " "; //$NON-NLS-1$
+ protected static final String EXCLUDES = "EXCLUDES"; //$NON-NLS-1$
+ protected static final String INCLUDES = "includes"; //$NON-NLS-1$
+ protected static final String COMMA = ","; //$NON-NLS-1$
+ protected static final String SEMI = ";"; //$NON-NLS-1$
+ protected static final String APOS = "'"; //$NON-NLS-1$
+ protected static final String OPEN = "("; //$NON-NLS-1$
+ protected static final String CLOSE = ")"; //$NON-NLS-1$
protected RuntimeMetadata metadata;
private HashMap<Comparison.Operator, String> comparisonOperators;
@@ -87,12 +87,12 @@
public CriteriaVisitor( RuntimeMetadata metadata ) {
this.metadata = metadata;
comparisonOperators = new HashMap<Comparison.Operator, String>();
- comparisonOperators.put(Operator.EQ, "=");
- comparisonOperators.put(Operator.GE, ">=");
- comparisonOperators.put(Operator.GT, ">");
- comparisonOperators.put(Operator.LE, "<=");
- comparisonOperators.put(Operator.LT, "<");
- comparisonOperators.put(Operator.NE, "!=");
+ comparisonOperators.put(Operator.EQ, "="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.GE, ">="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.GT, ">"); //$NON-NLS-1$
+ comparisonOperators.put(Operator.LE, "<="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.LT, "<"); //$NON-NLS-1$
+ comparisonOperators.put(Operator.NE, "!="); //$NON-NLS-1$
}
@Override
@@ -111,12 +111,11 @@
public void visit( Like criteria ) {
try {
if (isIdColumn(criteria.getLeftExpression())) {
- TranslatorException e = new TranslatorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
+ TranslatorException e = new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.LIKE.not.supported.on.Id")); //$NON-NLS-1$
exceptions.add(e);
}
if (isMultiSelectColumn(criteria.getLeftExpression())) {
- TranslatorException e = new TranslatorException(
- Messages.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect"));
+ TranslatorException e = new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect")); //$NON-NLS-1$
exceptions.add(e);
}
} catch (TranslatorException e) {
@@ -187,9 +186,9 @@
public void parseFunction( Function func ) {
String functionName = func.getName();
try {
- if (functionName.equalsIgnoreCase("includes")) {
+ if (functionName.equalsIgnoreCase("includes")) { //$NON-NLS-1$
generateMultiSelect(func, INCLUDES);
- } else if (functionName.equalsIgnoreCase("excludes")) {
+ } else if (functionName.equalsIgnoreCase("excludes")) { //$NON-NLS-1$
generateMultiSelect(func, EXCLUDES);
}
} catch (TranslatorException e) {
@@ -238,13 +237,13 @@
private void validateFunction( List<Expression> expressions ) throws TranslatorException {
if (expressions.size() != 2) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.invalid.arg.count")); //$NON-NLS-1$
}
if (!(expressions.get(0) instanceof ColumnReference)) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.column.arg")); //$NON-NLS-1$
}
if (!(expressions.get(1) instanceof Literal)) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.literal.arg")); //$NON-NLS-1$
}
}
@@ -253,7 +252,7 @@
criterion.append(OPEN);
boolean first = true;
String fullParam = param.toString();
- String[] params = fullParam.split(",");
+ String[] params = fullParam.split(","); //$NON-NLS-1$
for (int i = 0; i < params.length; i++) {
String token = params[i];
if (first) {
@@ -309,7 +308,7 @@
criteriaList.add(queryString.toString());
- if (columnName.equals("IsDeleted")) {
+ if (columnName.equals("IsDeleted")) { //$NON-NLS-1$
Literal isDeletedLiteral = (Literal)compCriteria.getRightExpression();
Boolean isDeleted = (Boolean)isDeletedLiteral.getValue();
if (isDeleted) {
@@ -328,9 +327,9 @@
queryString.append(getValue(leftExp));
queryString.append(' ');
if (criteria.isNegated()) {
- queryString.append("NOT ");
+ queryString.append("NOT "); //$NON-NLS-1$
}
- queryString.append("IN");
+ queryString.append("IN"); //$NON-NLS-1$
queryString.append('(');
Column column = ((ColumnReference)criteria.getLeftExpression()).getMetadataObject();
boolean timeColumn = isTimeColumn(column);
@@ -366,17 +365,16 @@
Literal literal = (Literal)expr;
result = literal.getValue().toString();
} else {
- throw new RuntimeException("unknown type in SalesforceQueryExecution.getValue(): " + expr.toString());
+ throw new RuntimeException("unknown type in SalesforceQueryExecution.getValue(): " + expr.toString()); //$NON-NLS-1$
}
return result;
}
protected void loadColumnMetadata( NamedTable group ) throws TranslatorException {
table = group.getMetadataObject();
- String supportsQuery = table.getProperties().get("Supports Query");
+ String supportsQuery = table.getProperties().get("Supports Query"); //$NON-NLS-1$
if (!Boolean.valueOf(supportsQuery)) {
- throw new TranslatorException(table.getNameInSource() + " "
- + Messages.getString("CriteriaVisitor.query.not.supported"));
+ throw new TranslatorException(table.getNameInSource() + " " + SalesForcePlugin.Util.getString("CriteriaVisitor.query.not.supported")); //$NON-NLS-1$ //$NON-NLS-2$
}
List<Column> columnIds = table.getColumns();
for (Column element : columnIds) {
@@ -384,7 +382,7 @@
columnElementsByName.put(name, element);
// influences queryAll behavior
- if (element.getNameInSource().equals("IsDeleted")) {
+ if (element.getNameInSource().equals("IsDeleted")) { //$NON-NLS-1$
String isDeleted = element.getDefaultValue();
if (Boolean.parseBoolean(isDeleted)) {
this.queryAll = true;
@@ -398,7 +396,7 @@
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
String nameInSource = element.getNameInSource();
- if (nameInSource.equalsIgnoreCase("id")) {
+ if (nameInSource.equalsIgnoreCase("id")) { //$NON-NLS-1$
result = true;
}
}
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -40,7 +40,7 @@
import org.teiid.metadata.Table;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Constants;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.Util;
@@ -61,8 +61,7 @@
public void visit(Select query) {
super.visit(query);
if (query.isDistinct()) {
- exceptions.add(new TranslatorException(
- Messages.getString("SelectVisitor.distinct.not.supported")));
+ exceptions.add(new TranslatorException(SalesForcePlugin.Util.getString("SelectVisitor.distinct.not.supported")));
}
selectSymbols = query.getDerivedColumns();
selectSymbolCount = selectSymbols.size();
@@ -78,9 +77,7 @@
selectSymbolNameToIndex .put(element.getNameInSource(), index);
String nameInSource = element.getNameInSource();
if (null == nameInSource || nameInSource.length() == 0) {
- exceptions.add(new TranslatorException(
- "name in source is null or empty for column "
- + symbol.toString()));
+ exceptions.add(new TranslatorException("name in source is null or empty for column "+ symbol.toString()));
continue;
}
if (nameInSource.equalsIgnoreCase("id")) {
@@ -98,8 +95,7 @@
String supportsQuery = table.getProperties().get(Constants.SUPPORTS_QUERY);
objectSupportsRetrieve = Boolean.valueOf(table.getProperties().get(Constants.SUPPORTS_RETRIEVE));
if (!Boolean.valueOf(supportsQuery)) {
- throw new TranslatorException(table.getNameInSource() + " "
- + Messages.getString("CriteriaVisitor.query.not.supported"));
+ throw new TranslatorException(table.getNameInSource() + " " + SalesForcePlugin.Util.getString("CriteriaVisitor.query.not.supported"));
}
loadColumnMetadata(obj);
} catch (TranslatorException ce) {
Modified: trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties
===================================================================
--- trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties 2010-09-24 18:51:07 UTC (rev 2603)
@@ -19,13 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
#
-SalesforceConnection.update.not.supported=Update Execution is not supported.
-SalesforceConnection.procedures.not.supported=Procedure Execution is not supported.
-SalesforceConnection.invalid.execution.mode=Execution mode not supported.
-SalesforceConnection.bad.IN.value=Exception parsing the IN Criteria Limit value.
-SalesforceConnection.bad.ping.value=Exception parsing the Data Source Test Connect Interval value.
-SalesforceSourceConnectionFactory.Invalid.username.password.pair=Invalid credential configuration. The Username and Password binding properties must both be empty or both have values.
SalesforceQueryExecutionImpl.cancel=SynchQueryExecution.cancel() called
SalesforceQueryExecutionImpl.close=SynchQueryExecution.close() called
@@ -33,7 +27,6 @@
SalesforceQueryExecutionImpl.column.mismatch1=Error: Column mismatch, expected
SalesforceQueryExecutionImpl.column.mismatch2= received
SalesforceQueryExecutionImpl.datatime.parse=Error parsing date_time: Value =
-SalesforceQueryExecutionImpl.reduced.batch.size=Reduced batch size to 2000
SelectVisitor.distinct.not.supported=Distinct is not supported by the connector.
@@ -41,8 +34,7 @@
CriteriaVisitor.invalid.arg.count=The includes and excludes functions require two parameters.
CriteriaVisitor.function.not.column.arg=The first parameter of the includes and excludes functions must be a column name.
CriteriaVisitor.function.not.literal.arg=The second parameter of the includes and excludes functions must be a literal value.
-CriteriaVisitor.IN.not.supported.on.col=The IN criteria is not supported on multi-select columns:
CriteriaVisitor.LIKE.not.supported.on.Id=LIKE criteria are not allowed on columns of native type Id
CriteriaVisitor.LIKE.not.supported.on.multiselect=LIKE criteria are not allowed on columns of native type Multi-Select Picklist
-Util.query.exceeds.max.length=Queries cannot exceed 10,000 characters
\ No newline at end of file
+Util.query.exceeds.max.length=Queries cannot exceed 10,000 characters
Modified: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -159,5 +159,10 @@
metadataFactory.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.BLOB, Type.ReturnValue, p); //$NON-NLS-1$
metadataFactory.addProcedureParameter("contentType", TypeFacility.RUNTIME_NAMES.STRING, Type.Out, p); //$NON-NLS-1$
}
+
+ @Override
+ public boolean areLobsUsableAfterClose() {
+ return true;
+ }
}
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/console/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Copied: trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java (from rev 2599, branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java)
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java (rev 0)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,287 @@
+/*
+ * 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.rhq.plugin;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.NamingException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValue;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.mc4j.ems.connection.EmsConnection;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
+import org.rhq.plugins.jbossas5.util.ConversionUtils;
+import org.teiid.adminapi.impl.PropertyMetadata;
+import org.teiid.rhq.admin.DQPManagementView;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+import org.teiid.rhq.plugin.util.PluginConstants.Operation;
+import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
+import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
+
+/**
+ * Component class for a Teiid VDB
+ *
+ */
+public class DataRoleComponent extends Facet {
+ private final Log LOG = LogFactory
+ .getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
+ */
+ @Override
+ public void start(ResourceContext context) {
+ this.resourceConfiguration = context.getPluginConfiguration();
+ this.componentType = PluginConstants.ComponentType.DATA_ROLE.NAME;
+ super.start(context);
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.teiid.rhq.plugin.Facet#getAvailability()
+ */
+ @Override
+ public AvailabilityType getAvailability() {
+ return ((VDBComponent)this.resourceContext.getParentResourceComponent()).getAvailability();
+ }
+
+ @Override
+ String getComponentType() {
+ return PluginConstants.ComponentType.DATA_ROLE.NAME;
+ }
+
+ @Override
+ public void getValues(MeasurementReport arg0,
+ Set<MeasurementScheduleRequest> arg1) throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * The plugin container will call this method when it has a new
+ * configuration for your managed resource. Your plugin will re-configure
+ * the managed resource in your own custom way, setting its configuration
+ * based on the new values of the given configuration.
+ *
+ * @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
+ */
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+
+ Configuration resourceConfig = report.getConfiguration();
+ resourceConfiguration = resourceConfig.deepCopy();
+
+ // Get the vdb and update date role anyAuthenticated and MappedRoleNames
+ ManagementView managementView = null;
+ ComponentType componentType = new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE);
+
+ ManagedComponent managedComponent = null;
+ ManagedProperty anyAuthenticatedMp = null;
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ try {
+
+ managementView = getConnection().getManagementView();
+ managedComponent = managementView.getComponent(
+ ((VDBComponent) this.resourceContext
+ .getParentResourceComponent()).name, componentType);
+ ManagedProperty mp = managedComponent.getProperty("dataPolicies");//$NON-NLS-1$
+ List<ManagedObject> dataRolesListMp = (List<ManagedObject>) MetaValueFactory
+ .getInstance().unwrap(mp.getValue());
+ String name = resourceConfiguration.getSimpleValue("name", null); //$NON-NLS-1$
+ String anyAuthenticated = resourceConfiguration.getSimpleValue(
+ "anyAuthenticated", null); //$NON-NLS-1$
+
+ for (ManagedObject mo : dataRolesListMp) {
+
+ String pname = ProfileServiceUtil.stringValue(mo.getProperty(
+ "name").getValue()); //$NON-NLS-1$
+ if (!pname.equals(name)) {
+ continue;
+ }
+ anyAuthenticatedMp = mo.getProperty("anyAuthenticated"); //$NON-NLS-1$
+ anyAuthenticatedMp.setValue(ProfileServiceUtil.wrap(
+ SimpleMetaType.BOOLEAN, anyAuthenticated));
+ List<Property> mappedRoleNamePropertyList = resourceConfiguration
+ .getList("mappedRoleNameList").getList(); //$NON-NLS-1$
+
+ List<String> mappedRoleNameList = new ArrayList<String>();
+
+ for (Property mappedRoleNameProperty : mappedRoleNamePropertyList){
+ String mappedRoleNameString = ((PropertyMap)mappedRoleNameProperty).getSimpleValue("name", null); //$NON-NLS-1$
+ mappedRoleNameList.add(mappedRoleNameString);
+ }
+ ManagedProperty mappedRoleNameMp = mo.getProperty("mappedRoleNames"); //$NON-NLS-1$
+ mappedRoleNameMp.setValue(MetaValueFactory.getInstance().create(mappedRoleNameList));
+ }
+
+ try {
+ managementView.updateComponent(managedComponent);
+ } catch (Exception e) {
+ LOG.error("Unable to update component [" //$NON-NLS-1$
+ + managedComponent.getName() + "] of type " //$NON-NLS-1$
+ + componentType + ".", e); //$NON-NLS-1$
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to process update request", e); //$NON-NLS-1$
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessageFromThrowable(e);
+ }
+
+ }
+
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ VDBComponent parentComponent = (VDBComponent) this.resourceContext
+ .getParentResourceComponent();
+ ManagedComponent mcVdb = null;
+ Configuration configuration = resourceContext.getPluginConfiguration();
+ try {
+ mcVdb = ProfileServiceUtil.getManagedComponent(getConnection(),
+ new ComponentType(PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ parentComponent.name);
+ } catch (NamingException e) {
+ final String msg = "NamingException in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ } catch (Exception e) {
+ final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ }
+
+ // Get data roles from VDB
+ ManagedProperty property = mcVdb.getProperty("dataPolicies"); //$NON-NLS-1$
+ if (property != null) {
+ CollectionValueSupport valueSupport = (CollectionValueSupport) property
+ .getValue();
+ MetaValue[] metaValues = valueSupport.getElements();
+
+ for (MetaValue value : metaValues) {
+ GenericValueSupport genValueSupport = (GenericValueSupport) value;
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
+
+ String dataRoleName = ProfileServiceUtil.getSimpleValue(
+ managedObject, "name", String.class); //$NON-NLS-1$
+ Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
+ managedObject, "anyAuthenticated", Boolean.class); //$NON-NLS-1$
+ String description = ProfileServiceUtil.getSimpleValue(
+ managedObject, "description", String.class); //$NON-NLS-1$
+
+ configuration.put(new PropertySimple("name", dataRoleName)); //$NON-NLS-1$
+ configuration.put(new PropertySimple("anyAuthenticated", //$NON-NLS-1$
+ anyAuthenticated));
+ configuration
+ .put(new PropertySimple("description", description)); //$NON-NLS-1$
+
+ PropertyList mappedRoleNameList = new PropertyList(
+ "mappedRoleNameList"); //$NON-NLS-1$
+ configuration.put(mappedRoleNameList);
+ ManagedProperty mappedRoleNames = managedObject
+ .getProperty("mappedRoleNames"); //$NON-NLS-1$
+ if (mappedRoleNames != null) {
+ List<String> props = (List<String>) MetaValueFactory
+ .getInstance().unwrap(mappedRoleNames.getValue());
+ for (String mappedRoleName : props) {
+ PropertyMap mappedRoleNameMap = null;
+
+ mappedRoleNameMap = new PropertyMap("map", //$NON-NLS-1$
+ new PropertySimple("name", mappedRoleName)); //$NON-NLS-1$
+ mappedRoleNameList.add(mappedRoleNameMap);
+ }
+ }
+ }
+ }
+
+ return configuration;
+
+ }
+
+ @Override
+ public CreateResourceReport createResource(
+ CreateResourceReport createResourceReport) {
+
+ createContentBasedResource(createResourceReport);
+ return createResourceReport;
+ }
+
+ @Override
+ public ProfileServiceConnection getConnection() {
+ return ((VDBComponent) this.resourceContext
+ .getParentResourceComponent()).getConnection();
+ }
+
+ @Override
+ public EmsConnection getEmsConnection() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Copied: trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java (from rev 2599, branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java)
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java (rev 0)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -0,0 +1,139 @@
+/*
+ * 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.rhq.plugin;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+
+/**
+ * Discovery component for Data Roles of a VDB
+ *
+ */
+public class DataRoleDiscoveryComponent implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory
+ .getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
+
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext discoveryContext)
+ throws InvalidPluginConfigurationException, Exception {
+ Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
+ VDBComponent parenComponent = (VDBComponent) discoveryContext
+ .getParentResourceComponent();
+ ProfileServiceConnection connection = parenComponent.getConnection();
+
+ ManagedComponent mcVdb = ProfileServiceUtil.getManagedComponent(
+ connection, new ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ parenComponent.name);
+
+ // Get data roles from VDB
+ ManagedProperty property = mcVdb.getProperty("dataPolicies");
+ if (property != null) {
+ CollectionValueSupport valueSupport = (CollectionValueSupport) property
+ .getValue();
+ MetaValue[] metaValues = valueSupport.getElements();
+
+ for (MetaValue value : metaValues) {
+ GenericValueSupport genValueSupport = (GenericValueSupport) value;
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
+
+ String dataRoleName = ProfileServiceUtil.getSimpleValue(
+ managedObject, "name", String.class);
+ Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
+ managedObject, "anyAuthenticated", Boolean.class);
+ String description = ProfileServiceUtil.getSimpleValue(
+ managedObject, "description", String.class);
+
+ /**
+ *
+ * A discovered resource must have a unique key, that must stay
+ * the same when the resource is discovered the next time
+ */
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(), // ResourceType
+ dataRoleName, // Resource Key
+ dataRoleName, // Resource Name
+ null, // Version
+ PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
+ discoveryContext.getDefaultPluginConfiguration(), // Plugin
+ // Config
+ null // Process info from a process scan
+ );
+
+ Configuration configuration = detail.getPluginConfiguration();
+
+ configuration.put(new PropertySimple("name", dataRoleName));
+ configuration.put(new PropertySimple("anyAuthenticated",
+ anyAuthenticated));
+ configuration
+ .put(new PropertySimple("description", description));
+
+ PropertyList mappedRoleNameList = new PropertyList(
+ "mappedRoleNameList");
+ configuration.put(mappedRoleNameList);
+ ManagedProperty mappedRoleNames = managedObject
+ .getProperty("mappedRoleNames");
+ if (mappedRoleNames != null) {
+ List<String> props = (List<String>) MetaValueFactory
+ .getInstance().unwrap(mappedRoleNames.getValue());
+ for (String mappedRoleName : props) {
+ mappedRoleNameList.add(new PropertySimple("name", mappedRoleName));
+ }
+
+ }
+ // Add to return values
+ discoveredResources.add(detail);
+ log.debug("Discovered Teiid VDB Data Role: " + dataRoleName);
+ }
+ }
+
+ return discoveredResources;
+
+ }
+}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -21,17 +21,19 @@
*/
package org.teiid.rhq.plugin;
+import java.io.BufferedOutputStream;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.InputStream;
-import java.util.Collections;
+import java.io.OutputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.naming.NamingException;
-
+import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.deployers.spi.management.ManagementView;
@@ -49,6 +51,8 @@
import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.PackageType;
+import org.rhq.core.domain.content.transfer.ContentResponseResult;
+import org.rhq.core.domain.content.transfer.DeployIndividualPackageResponse;
import org.rhq.core.domain.content.transfer.DeployPackageStep;
import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
@@ -72,6 +76,7 @@
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.plugins.jbossas5.ProfileServiceComponent;
import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
import org.teiid.rhq.admin.DQPManagementView;
@@ -85,11 +90,13 @@
* This class implements required RHQ interfaces and provides common logic used
* by all MetaMatrix components.
*/
-public abstract class Facet implements ProfileServiceComponent<ResourceComponent>, MeasurementFacet,
+public abstract class Facet implements
+ ProfileServiceComponent<ResourceComponent>, MeasurementFacet,
OperationFacet, ConfigurationFacet, ContentFacet, DeleteResourceFacet,
CreateChildResourceFacet {
- protected final Log LOG = LogFactory.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
+ protected final Log LOG = LogFactory
+ .getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
/**
* Represents the resource configuration of the custom product being
@@ -113,11 +120,15 @@
private final Log log = LogFactory.getLog(this.getClass());
+ private File deploymentFile;
+ private static final String BACKUP_FILE_EXTENSION = ".rej"; //$NON-NLS-1$
+
/**
* The name of the ManagedDeployment (e.g.:
* C:/opt/jboss-5.0.0.GA/server/default/deploy/foo.vdb).
*/
protected String deploymentName;
+ protected String deploymentUrl;
private PackageVersions versions = null;
@@ -128,12 +139,12 @@
* "vdb". This is still unique within the context of the parent resource
* type and lets this class use the same package type name in both cases.
*/
- private static final String PKG_TYPE_VDB = "vdb";
+ private static final String PKG_TYPE_VDB = "vdb"; //$NON-NLS-1$
/**
* Architecture string used in describing discovered packages.
*/
- private static final String ARCHITECTURE = "noarch";
+ private static final String ARCHITECTURE = "noarch"; //$NON-NLS-1$
abstract String getComponentType();
@@ -149,8 +160,6 @@
deploymentName = context.getResourceKey();
}
-
-
/**
* This is called when the component is being stopped, usually due to the
* plugin container shutting down. You can perform some cleanup here; though
@@ -176,7 +185,7 @@
public void setResourceConfiguration(Configuration resourceConfiguration) {
this.resourceConfiguration = resourceConfiguration;
}
-
+
public String componentType() {
return name;
}
@@ -197,8 +206,8 @@
Configuration configuration, Map<String, Object> argumentMap) {
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
- "Not implemented on component type " + this.getComponentType()
- + " named " + this.name);
+ "Not implemented on component type " + this.getComponentType() //$NON-NLS-1$
+ + " named " + this.name); //$NON-NLS-1$
}
@@ -206,12 +215,13 @@
Map<String, Object> argumentMap) {
// moved this logic up to the associated implemented class
throw new InvalidPluginConfigurationException(
- "Not implemented on component type " + this.getComponentType()
- + " named " + this.name);
+ "Not implemented on component type " + this.getComponentType() //$NON-NLS-1$
+ + " named " + this.name); //$NON-NLS-1$
}
- protected void execute(final ProfileServiceConnection connection, final ExecutedResult result, final Map valueMap) {
+ protected void execute(final ProfileServiceConnection connection,
+ final ExecutedResult result, final Map<String, Object> valueMap) {
DQPManagementView dqp = new DQPManagementView();
dqp.executeOperation(connection, result, valueMap);
@@ -262,7 +272,7 @@
*/
public OperationResult invokeOperation(String name,
Configuration configuration) {
- Map valueMap = new HashMap();
+ Map<String, Object> valueMap = new HashMap<String, Object>();
Set operationDefinitionSet = this.resourceContext.getResourceType()
.getOperationDefinitions();
@@ -317,24 +327,27 @@
resourceConfiguration = report.getConfiguration().deepCopy();
Configuration resourceConfig = report.getConfiguration();
-
- ManagementView managementView = null;
+
+ ManagementView managementView = null;
ComponentType componentType = null;
- if (this.getComponentType().equals(PluginConstants.ComponentType.VDB.NAME)) {
+ if (this.getComponentType().equals(
+ PluginConstants.ComponentType.VDB.NAME)) {
componentType = new ComponentType(
PluginConstants.ComponentType.VDB.TYPE,
PluginConstants.ComponentType.VDB.SUBTYPE);
} else {
report.setStatus(ConfigurationUpdateStatus.FAILURE);
- report.setErrorMessage("Update not implemented for the component type.");
+ report
+ .setErrorMessage("Update not implemented for the component type."); //$NON-NLS-1$
}
ManagedComponent managedComponent = null;
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
-
+
managementView = getConnection().getManagementView();
- managedComponent = managementView.getComponent(this.name, componentType);
+ managedComponent = managementView.getComponent(this.name,
+ componentType);
Map<String, ManagedProperty> managedProperties = managedComponent
.getProperties();
@@ -343,16 +356,16 @@
.getResourceType());
try {
- managementView.updateComponent(managedComponent);
+ managementView.updateComponent(managedComponent);
} catch (Exception e) {
- LOG.error("Unable to update component ["
- + managedComponent.getName() + "] of type "
- + componentType + ".", e);
+ LOG.error("Unable to update component [" //$NON-NLS-1$
+ + managedComponent.getName() + "] of type " //$NON-NLS-1$
+ + componentType + ".", e); //$NON-NLS-1$
report.setStatus(ConfigurationUpdateStatus.FAILURE);
report.setErrorMessageFromThrowable(e);
}
} catch (Exception e) {
- LOG.error("Unable to process update request", e);
+ LOG.error("Unable to process update request", e); //$NON-NLS-1$
report.setStatus(ConfigurationUpdateStatus.FAILURE);
report.setErrorMessageFromThrowable(e);
}
@@ -373,11 +386,11 @@
*/
protected void updateComponent(ManagedComponent managedComponent)
throws Exception {
- log.trace("Updating " + this.name + " with component "
- + managedComponent.toString() + "...");
+ log.trace("Updating " + this.name + " with component " //$NON-NLS-1$ //$NON-NLS-2$
+ + managedComponent.toString() + "..."); //$NON-NLS-1$
ManagementView managementView = getConnection().getManagementView();
managementView.updateComponent(managedComponent);
-
+
}
@Override
@@ -386,25 +399,25 @@
DeploymentManager deploymentManager = getConnection()
.getDeploymentManager();
- log.debug("Stopping deployment [" + this.deploymentName + "]...");
+ log.debug("Stopping deployment [" + this.deploymentName + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
DeploymentProgress progress = deploymentManager
.stop(this.deploymentName);
DeploymentStatus stopStatus = DeploymentUtils.run(progress);
if (stopStatus.isFailed()) {
- log.error("Failed to stop deployment '" + this.deploymentName
- + "'.", stopStatus.getFailure());
- throw new Exception("Failed to stop deployment '"
- + this.deploymentName + "' - cause: "
+ log.error("Failed to stop deployment '" + this.deploymentName //$NON-NLS-1$
+ + "'.", stopStatus.getFailure()); //$NON-NLS-1$
+ throw new Exception("Failed to stop deployment '" //$NON-NLS-1$
+ + this.deploymentName + "' - cause: " //$NON-NLS-1$
+ stopStatus.getFailure());
}
- log.debug("Removing deployment [" + this.deploymentName + "]...");
+ log.debug("Removing deployment [" + this.deploymentName + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
progress = deploymentManager.remove(this.deploymentName);
DeploymentStatus removeStatus = DeploymentUtils.run(progress);
if (removeStatus.isFailed()) {
- log.error("Failed to remove deployment '" + this.deploymentName
- + "'.", removeStatus.getFailure());
- throw new Exception("Failed to remove deployment '"
- + this.deploymentName + "' - cause: "
+ log.error("Failed to remove deployment '" + this.deploymentName //$NON-NLS-1$
+ + "'.", removeStatus.getFailure()); //$NON-NLS-1$
+ throw new Exception("Failed to remove deployment '" //$NON-NLS-1$
+ + this.deploymentName + "' - cause: " //$NON-NLS-1$
+ removeStatus.getFailure());
}
@@ -414,13 +427,257 @@
public DeployPackagesResponse deployPackages(
Set<ResourcePackageDetails> packages,
ContentServices contentServices) {
- return null;
+ // You can only update the one application file referenced by this
+ // resource, so punch out if multiple are
+ // specified.
+ if (packages.size() != 1) {
+ log
+ .warn("Request to update a VDB file contained multiple packages: " //$NON-NLS-1$
+ + packages);
+ DeployPackagesResponse response = new DeployPackagesResponse(
+ ContentResponseResult.FAILURE);
+ response
+ .setOverallRequestErrorMessage("When updating a VDB, only one VDB can be updated at a time."); //$NON-NLS-1$
+ return response;
+ }
+
+ ResourcePackageDetails packageDetails = packages.iterator().next();
+
+ log.debug("Updating VDB file '" + this.deploymentFile + "' using [" //$NON-NLS-1$ //$NON-NLS-2$
+ + packageDetails + "]..."); //$NON-NLS-1$
+
+ log.debug("Writing new VDB bits to temporary file..."); //$NON-NLS-1$
+ File tempFile;
+ try {
+ tempFile = writeNewAppBitsToTempFile(contentServices,
+ packageDetails);
+ } catch (Exception e) {
+ return failApplicationDeployment(
+ "Error writing new application bits to temporary file - cause: " //$NON-NLS-1$
+ + e, packageDetails);
+ }
+ log.debug("Wrote new VDB bits to temporary file '" + tempFile //$NON-NLS-1$
+ + "'."); //$NON-NLS-1$
+
+ boolean deployExploded = this.deploymentFile.isDirectory();
+
+ // Backup the original app file/dir to <filename>.rej.
+ File backupOfOriginalFile = new File(this.deploymentFile.getPath()
+ + BACKUP_FILE_EXTENSION);
+ log.debug("Backing up existing VDB '" + this.deploymentFile //$NON-NLS-1$
+ + "' to '" + backupOfOriginalFile + "'..."); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ if (backupOfOriginalFile.exists())
+ FileUtils.forceDelete(backupOfOriginalFile);
+ if (this.deploymentFile.isDirectory())
+ FileUtils.copyDirectory(this.deploymentFile,
+ backupOfOriginalFile, true);
+ else
+ FileUtils.copyFile(this.deploymentFile, backupOfOriginalFile,
+ true);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to backup existing EAR/WAR '" //$NON-NLS-1$
+ + this.deploymentFile + "' to '" + backupOfOriginalFile //$NON-NLS-1$
+ + "'."); //$NON-NLS-1$
+ }
+
+ // Now stop the original app.
+ try {
+ DeploymentManager deploymentManager = getConnection()
+ .getDeploymentManager();
+ DeploymentProgress progress = deploymentManager
+ .stop(this.deploymentUrl);
+ DeploymentUtils.run(progress);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to stop deployment [" //$NON-NLS-1$
+ + this.deploymentUrl + "].", e); //$NON-NLS-1$
+ }
+
+ // And then remove it (this will delete the physical file/dir from the
+ // deploy dir).
+ try {
+ DeploymentManager deploymentManager = getConnection()
+ .getDeploymentManager();
+ DeploymentProgress progress = deploymentManager
+ .remove(this.deploymentUrl);
+ DeploymentUtils.run(progress);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to remove deployment [" //$NON-NLS-1$
+ + this.deploymentUrl + "].", e); //$NON-NLS-1$
+ }
+
+ // Deploy away!
+ log.debug("Deploying '" + tempFile + "'..."); //$NON-NLS-1$ //$NON-NLS-2$
+ DeploymentManager deploymentManager = getConnection()
+ .getDeploymentManager();
+ try {
+ DeploymentUtils.deployArchive(deploymentManager, tempFile,
+ deployExploded);
+ } catch (Exception e) {
+ // Deploy failed - rollback to the original app file...
+ log.debug("Redeploy failed - rolling back to original archive...", //$NON-NLS-1$
+ e);
+ String errorMessage = ThrowableUtil.getAllMessages(e);
+ try {
+ // Delete the new app, which failed to deploy.
+ FileUtils.forceDelete(this.deploymentFile);
+ // Need to re-deploy the original file - this generally should
+ // succeed.
+ DeploymentUtils.deployArchive(deploymentManager,
+ backupOfOriginalFile, deployExploded);
+ errorMessage += " ***** ROLLED BACK TO ORIGINAL APPLICATION FILE. *****"; //$NON-NLS-1$
+ } catch (Exception e1) {
+ log.debug("Rollback failed!", e1); //$NON-NLS-1$
+ errorMessage += " ***** FAILED TO ROLLBACK TO ORIGINAL APPLICATION FILE. *****: " //$NON-NLS-1$
+ + ThrowableUtil.getAllMessages(e1);
+ }
+ log.info("Failed to update VDB file '" + this.deploymentFile //$NON-NLS-1$
+ + "' using [" + packageDetails + "]."); //$NON-NLS-1$ //$NON-NLS-2$
+ return failApplicationDeployment(errorMessage, packageDetails);
+ }
+
+ // Deploy was successful!
+
+ deleteBackupOfOriginalFile(backupOfOriginalFile);
+ persistApplicationVersion(packageDetails, this.deploymentFile);
+
+ DeployPackagesResponse response = new DeployPackagesResponse(
+ ContentResponseResult.SUCCESS);
+ DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(
+ packageDetails.getKey(), ContentResponseResult.SUCCESS);
+ response.addPackageResponse(packageResponse);
+
+ log.debug("Updated VDB file '" + this.deploymentFile //$NON-NLS-1$
+ + "' successfully - returning response [" + response + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
+
+ return response;
}
+ private void deleteBackupOfOriginalFile(File backupOfOriginalFile) {
+ log.debug("Deleting backup of original file '" + backupOfOriginalFile //$NON-NLS-1$
+ + "'..."); //$NON-NLS-1$
+ try {
+ FileUtils.forceDelete(backupOfOriginalFile);
+ } catch (Exception e) {
+ // not critical.
+ log.warn("Failed to delete backup of original file: " //$NON-NLS-1$
+ + backupOfOriginalFile);
+ }
+ }
+
+ private void persistApplicationVersion(ResourcePackageDetails packageDetails, File appFile)
+ {
+ String packageName = appFile.getName();
+ log.debug("Persisting application version '" + packageDetails.getVersion() + "' for package '" + packageName //$NON-NLS-1$ //$NON-NLS-2$
+ + "'"); //$NON-NLS-1$
+ PackageVersions versions = loadPackageVersions();
+ versions.putVersion(packageName, packageDetails.getVersion());
+ }
+
+ private File writeNewAppBitsToTempFile(ContentServices contentServices,
+ ResourcePackageDetails packageDetails) throws Exception {
+ File tempDir = this.resourceContext.getTemporaryDirectory();
+ File tempFile = new File(tempDir, this.deploymentFile.getName());
+
+ OutputStream tempOutputStream = null;
+ try {
+ tempOutputStream = new BufferedOutputStream(new FileOutputStream(
+ tempFile));
+ long bytesWritten = contentServices.downloadPackageBits(
+ this.resourceContext.getContentContext(), packageDetails
+ .getKey(), tempOutputStream, true);
+ log
+ .debug("Wrote " + bytesWritten + " bytes to '" + tempFile //$NON-NLS-1$ //$NON-NLS-2$
+ + "'."); //$NON-NLS-1$
+ } catch (IOException e) {
+ log.error(
+ "Error writing updated application bits to temporary location: " //$NON-NLS-1$
+ + tempFile, e);
+ throw e;
+ } finally {
+ if (tempOutputStream != null) {
+ try {
+ tempOutputStream.close();
+ } catch (IOException e) {
+ log.error("Error closing temporary output stream", e); //$NON-NLS-1$
+ }
+ }
+ }
+ if (!tempFile.exists()) {
+ log.error("Temporary file for application update not written to: " //$NON-NLS-1$
+ + tempFile);
+ throw new Exception();
+ }
+ return tempFile;
+ }
+
+ /**
+ * Creates the necessary transfer objects to report a failed application
+ * deployment (update).
+ *
+ * @param errorMessage
+ * reason the deploy failed
+ * @param packageDetails
+ * describes the update being made
+ * @return response populated to reflect a failure
+ */
+ private DeployPackagesResponse failApplicationDeployment(
+ String errorMessage, ResourcePackageDetails packageDetails) {
+ DeployPackagesResponse response = new DeployPackagesResponse(
+ ContentResponseResult.FAILURE);
+
+ DeployIndividualPackageResponse packageResponse = new DeployIndividualPackageResponse(
+ packageDetails.getKey(), ContentResponseResult.FAILURE);
+ packageResponse.setErrorMessage(errorMessage);
+
+ response.addPackageResponse(packageResponse);
+
+ return response;
+ }
+
@Override
public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType arg0) {
- // Teiid does not support the versions yet.
- return Collections.EMPTY_SET;
+
+ // PLEASE DO NOT REMOVE THIS METHOD. IT IS REQUIRED FOR THE CONTENT TAB.
+
+ Configuration pluginConfig = this.resourceContext
+ .getPluginConfiguration();
+ this.deploymentUrl = pluginConfig.getSimple("url").getStringValue(); //$NON-NLS-1$
+
+ if (this.deploymentUrl != null) {
+ this.deploymentFile = new File(this.deploymentUrl
+ .substring(deploymentUrl.indexOf(":/") + 1)); //$NON-NLS-1$
+ }
+
+ if (!deploymentFile.exists())
+ throw new IllegalStateException("Deployment file '" //$NON-NLS-1$
+ + this.deploymentFile + "' for " + this.getComponentType() //$NON-NLS-1$
+ + " does not exist."); //$NON-NLS-1$
+
+ String fileName = deploymentFile.getName();
+ org.rhq.core.pluginapi.content.version.PackageVersions packageVersions = loadPackageVersions();
+ String version = packageVersions.getVersion(fileName);
+ if (version == null) {
+ // This is either the first time we've discovered this VDB, or
+ // someone purged the PC's data dir.
+ version = "1.0"; //$NON-NLS-1$
+ packageVersions.putVersion(fileName, version);
+ packageVersions.saveToDisk();
+ }
+
+ // Package name is the deployment's file name (e.g. foo.ear).
+ PackageDetailsKey key = new PackageDetailsKey(fileName, version,
+ PKG_TYPE_VDB, ARCHITECTURE);
+ ResourcePackageDetails packageDetails = new ResourcePackageDetails(key);
+ packageDetails.setFileName(fileName);
+ packageDetails.setLocation(deploymentFile.getPath());
+ if (!deploymentFile.isDirectory())
+ packageDetails.setFileSize(deploymentFile.length());
+ packageDetails.setFileCreatedDate(null);
+ Set<ResourcePackageDetails> packages = new HashSet<ResourcePackageDetails>();
+ packages.add(packageDetails);
+
+ return packages;
}
@Override
@@ -459,11 +716,11 @@
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
ResourceType resourceType = report.getResourceType();
-// if (resourceType.getName().equals("Translators")) {
-// createConfigurationBasedResource(report);
-// } else {
- createContentBasedResource(report);
-// }
+ // if (resourceType.getName().equals("Translators")) {
+ // createConfigurationBasedResource(report);
+ // } else {
+ createContentBasedResource(report);
+ // }
return report;
}
@@ -481,12 +738,12 @@
ManagementView managementView = null;
;
managementView = getConnection().getManagementView();
-
- if (ProfileServiceUtil.isManagedComponent(getConnection(), resourceName,
- componentType)) {
+
+ if (ProfileServiceUtil.isManagedComponent(getConnection(),
+ resourceName, componentType)) {
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
- createResourceReport.setErrorMessage("A " + resourceType.getName()
- + " named '" + resourceName + "' already exists.");
+ createResourceReport.setErrorMessage("A " + resourceType.getName() //$NON-NLS-1$
+ + " named '" + resourceName + "' already exists."); //$NON-NLS-1$ //$NON-NLS-2$
return createResourceReport;
}
@@ -499,7 +756,6 @@
String templateName = templateNameProperty.getStringValue();
DeploymentTemplateInfo template;
- Set templateNamesSet = managementView.getTemplateNames();
try {
template = managementView.getTemplate(templateName);
Map<String, ManagedProperty> managedProperties = template
@@ -508,26 +764,26 @@
ProfileServiceUtil.convertConfigurationToManagedProperties(
managedProperties, resourceConfig, resourceType);
- LOG.debug("Applying template [" + templateName
- + "] to create ManagedComponent of type [" + componentType
- + "]...");
+ LOG.debug("Applying template [" + templateName //$NON-NLS-1$
+ + "] to create ManagedComponent of type [" + componentType //$NON-NLS-1$
+ + "]..."); //$NON-NLS-1$
try {
managementView.applyTemplate(resourceName, template);
managementView.process();
createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
} catch (Exception e) {
- LOG.error("Unable to apply template [" + templateName
- + "] to create ManagedComponent of type "
- + componentType + ".", e);
+ LOG.error("Unable to apply template [" + templateName //$NON-NLS-1$
+ + "] to create ManagedComponent of type " //$NON-NLS-1$
+ + componentType + ".", e); //$NON-NLS-1$
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(e);
}
} catch (NoSuchDeploymentException e) {
- LOG.error("Unable to find template [" + templateName + "].", e);
+ LOG.error("Unable to find template [" + templateName + "].", e); //$NON-NLS-1$ //$NON-NLS-2$
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(e);
} catch (Exception e) {
- LOG.error("Unable to process create request", e);
+ LOG.error("Unable to process create request", e); //$NON-NLS-1$
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(e);
}
@@ -551,8 +807,8 @@
resourceContext.getResourceType())) {
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport
- .setErrorMessage("Incorrect extension specified on filename ["
- + archivePath + "]");
+ .setErrorMessage("Incorrect extension specified on filename [" //$NON-NLS-1$
+ + archivePath + "]"); //$NON-NLS-1$
}
@@ -567,7 +823,7 @@
createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
} catch (Throwable t) {
- log.error("Error deploying application for report: "
+ log.error("Error deploying application for report: " //$NON-NLS-1$
+ createResourceReport, t);
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
createResourceReport.setException(t);
@@ -581,15 +837,15 @@
.getSimple(TranslatorComponent.Config.RESOURCE_NAME);
if (resourceNameProp == null
|| resourceNameProp.getStringValue() == null)
- throw new IllegalStateException("Property ["
+ throw new IllegalStateException("Property [" //$NON-NLS-1$
+ TranslatorComponent.Config.RESOURCE_NAME
- + "] is not defined in the default plugin configuration.");
+ + "] is not defined in the default plugin configuration."); //$NON-NLS-1$
String resourceNamePropName = resourceNameProp.getStringValue();
PropertySimple propToUseAsResourceName = resourceConfig
.getSimple(resourceNamePropName);
if (propToUseAsResourceName == null)
- throw new IllegalStateException("Property [" + resourceNamePropName
- + "] is not defined in initial Resource configuration.");
+ throw new IllegalStateException("Property [" + resourceNamePropName //$NON-NLS-1$
+ + "] is not defined in initial Resource configuration."); //$NON-NLS-1$
return propToUseAsResourceName.getStringValue();
}
@@ -597,9 +853,9 @@
ComponentType componentType = ProfileServiceUtil
.getComponentType(resourceType);
if (componentType == null)
- throw new IllegalStateException("Unable to map " + resourceType
- + " to a ComponentType.");
- return componentType.getType() + ":" + componentType.getSubtype() + ":"
+ throw new IllegalStateException("Unable to map " + resourceType //$NON-NLS-1$
+ + " to a ComponentType."); //$NON-NLS-1$
+ return componentType.getType() + ":" + componentType.getSubtype() + ":" //$NON-NLS-1$ //$NON-NLS-2$
+ resourceName;
}
@@ -615,9 +871,9 @@
File dataDirectoryFile = resourceContext.getDataDirectory();
dataDirectoryFile.mkdirs();
String dataDirectory = dataDirectoryFile.getAbsolutePath();
- log.trace("Creating application versions store with plugin name ["
- + pluginName + "] and data directory [" + dataDirectory
- + "]");
+ log.trace("Creating application versions store with plugin name [" //$NON-NLS-1$
+ + pluginName + "] and data directory [" + dataDirectory //$NON-NLS-1$
+ + "]"); //$NON-NLS-1$
this.versions = new PackageVersions(pluginName, dataDirectory);
this.versions.loadFromDisk();
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -118,7 +118,20 @@
}
}
+
+ public interface DATA_ROLE {
+ public final static String NAME = "VDB Data Role"; //$NON-NLS-1$
+ public final static String DESCRIPTION = "Data/Security Role for a Teiid Virtual Database (VDB)"; //$NON-NLS-1$
+
+ public static interface Operations {
+ }
+
+ public static interface Metrics {
+ }
+
+ }
+
public interface Translator {
public final static String TYPE = "teiid"; //$NON-NLS-1$
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -154,20 +154,22 @@
</c:list-property>
</results>
</operation>
-
+
<operation name="deployVdbByUrl" displayName="Deploy a VDB via URL"
description="Deploy a VDB using a URL">
<parameters>
<c:simple-property displayName="VDB URL" name="vdbUrl"
type="file" required="true" description="The URL of the VDB to deploy" />
- <c:simple-property displayName="VDB Deploy File Name" name="vdbDeployName"
- type="string" required="true" description="The deployment file name to use. Must match the VDB Name you are deploying." />
+ <c:simple-property displayName="VDB Deploy File Name"
+ name="vdbDeployName" type="string" required="true"
+ description="The deployment file name to use. Must match the VDB Name you are deploying." />
<c:simple-property displayName="VDB Version" name="vdbVersion"
- type="integer" required="false" description="The version to use for the deployed VDB (leave blank for overwrite of version one)" />
+ type="integer" required="false"
+ description="The version to use for the deployed VDB (leave blank for overwrite of version one)" />
</parameters>
</operation>
-
+
<operation name="terminateSession" displayName="Terminate Session"
description="Terminate a specified session">
<parameters>
@@ -269,30 +271,30 @@
displayType="detail" category="throughput" property="userBufferSpace"
description="The currently used file buffer space in MB." />
- <metric displayName="Prepared Plan Cache Hit Ratio %" defaultOn="true"
- displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.hitRatio"
- description="Percentage of positive cache hits" />
+ <metric displayName="Prepared Plan Cache Hit Ratio %"
+ defaultOn="true" displayType="detail" category="performance"
+ property="PREPARED_PLAN_CACHE.hitRatio" description="Percentage of positive cache hits" />
- <metric displayName="Prepared Plan Cache Size" defaultOn="true"
- displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.totalEntries"
- description="Current number of entries in cache" />
+ <metric displayName="Prepared Plan Cache Size" defaultOn="true"
+ displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.totalEntries"
+ description="Current number of entries in cache" />
- <metric displayName="Prepared Plan Cache # of Requests" defaultOn="true"
- displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.requestCount"
- description="Total number of requests made against cache" />
-
- <metric displayName="ResultSet Cache Hit Ratio %" defaultOn="true"
- displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.hitRatio"
- description="Percentage of positive cache hits" />
+ <metric displayName="Prepared Plan Cache # of Requests"
+ defaultOn="true" displayType="detail" category="performance"
+ property="PREPARED_PLAN_CACHE.requestCount" description="Total number of requests made against cache" />
- <metric displayName="ResultSet Cache Size" defaultOn="true"
- displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.totalEntries"
- description="Current number of entries in cache" />
+ <metric displayName="ResultSet Cache Hit Ratio %" defaultOn="true"
+ displayType="detail" category="performance"
+ property="QUERY_SERVICE_RESULT_SET_CACHE.hitRatio" description="Percentage of positive cache hits" />
- <metric displayName="ResultSet Cache # of Requests" defaultOn="true"
- displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount"
- description="Total number of requests made against cache" />
+ <metric displayName="ResultSet Cache Size" defaultOn="true"
+ displayType="detail" category="performance"
+ property="QUERY_SERVICE_RESULT_SET_CACHE.totalEntries" description="Current number of entries in cache" />
+ <metric displayName="ResultSet Cache # of Requests" defaultOn="true"
+ displayType="detail" category="performance"
+ property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount" description="Total number of requests made against cache" />
+
<resource-configuration>
<c:group name="teiidProperties" displayName="Runtime Engine Properties"
hiddenByDefault="false">
@@ -498,7 +500,7 @@
<c:option value="INACTIVE" name="DOWN" default="true" />
</c:property-options>
</c:simple-property>
- <c:simple-property name="connectionType" type="string"
+ <c:simple-property name="connectionType" type="string"
description="Allowable Connections: 1) NONE - disallow new connections 2) BY VERSION - allow connections only if the version is specified or if this is the earliest 'BY VERSION' vdb and there are no vdbs marked as 'ANY'
3) ANY - allow connections with or without a version specified. If multiple versions of same VDB are deployed, connect to one specified with ANY, or if there are multiple VDBs with ANY then connect to the latest version with ANY "
required="false">
@@ -598,6 +600,32 @@
</c:group>
</resource-configuration>
+ <service name="Data Roles" description="Data Roles for this VDB"
+ class="DataRoleComponent" discovery="DataRoleDiscoveryComponent">
+
+ <resource-configuration>
+ <c:simple-property name="name" displayName="Name"
+ description="Name of the data role" readOnly="true" required="false" />
+ <c:simple-property name="anyAuthenticated"
+ displayName="Any Authenticated" type="boolean"
+ description="Indicates if the role is mapped to any authenticated user"
+ readOnly="false" required="false" />
+ <c:simple-property name="description"
+ displayName="Description" type="string"
+ description="Description of this data role"
+ readOnly="true" required="false" />
+ <c:list-property name="mappedRoleNameList"
+ readOnly="false" required="false" displayName="Mapped Role Names"
+ description="Mapped role names for this data role">
+ <c:map-property name="map" readOnly="false">
+ <c:simple-property name="name" displayName="Name"
+ description="Name of this mapped role" readOnly="true" />
+ </c:map-property>
+ </c:list-property>
+ </resource-configuration>
+
+ </service>
+
</service>
<service name="Translators" description="Teiid Translators"
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -50,6 +50,7 @@
<xi:include href="content/security.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/logging.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/clustering.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/performance.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/admin-console.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/adminshell.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/appendix-a.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/adminshell.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/adminshell.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/adminshell.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -274,5 +274,21 @@
// close the connection in the "conn1"
disconnectAll();]]></programlisting>
</section>
-
+ <section>
+ <title>Interactive Shell Nuances</title>
+ <para>The interactive shell uses a special shell interpretter and therefore has different behavior than just writting a script in Groovy.
+ See the <ulink url="http://groovy.codehaus.org/Groovy+Shell">Groovy Shell Documentation</ulink> for more on its usage. Notable differences:
+ <itemizedlist>
+ <listitem>
+ <para>Def statements do not define a variable in the context of the Shell, e.g. do not use <code>def x = 1</code>, use <code>x = 1</code></para>
+ </listitem>
+ <listitem>
+ <para>Shell commands (as seen through <code>help</code>) using the non-functional shell syntax are only available in the shell.</para>
+ </listitem>
+ <listitem>
+ <para>Groovy classes using annotations cannot be parsed in the Shell.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
</chapter>
\ No newline at end of file
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-b.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-b.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-b.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -16,6 +16,7 @@
that would work in Java,
BeanShell, Groovy, etc.</para>
<programlisting><![CDATA[import static org.teiid.adminshell.AdminShell.*;
+import static org.teiid.adminshell.GroovySqlExtensions.*;
import org.teiid.adminapi.*;]]></programlisting>
<para>Note that the provided shell and console executables
automatically have the proper class path set and inject the proper
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/clustering.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/clustering.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/clustering.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -6,12 +6,12 @@
To cluster JBoss AS instances use these <ulink url="http://www.jboss.org/jbossas/docs/5-x.html">instructions</ulink> then Teiid instances
are clustered as well. Just make sure that you installed Teiid in every JBoss AS node before starting the cluster.
There is one specific configuration that needs to be done for enabling the replicated (distributed) cache in Teiid.
- To enable distributed cache rename "<jboss-as>/server/<profile>/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml" file
- to "<jboss-as>/server/<profile>/deploy/teiid/teiid-cache-manager-jboss-beans.xml".
+ To enable distributed caching, rename the "<jboss-as>/server/<profile>/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml" file
+ to "<jboss-as>/server/<profile>/deploy/teiid/teiid-cache-manager-jboss-beans.xml".
</para>
<para>
- Typically users create clusters to improve the performance of the system through
+ Typically users create clusters to improve the performance of the system through:
<orderedlist>
<listitem> <para>Load Balancing: Take look at the Client developers guide on how to use load balancing between multiple nodes.</para> </listitem>
<listitem> <para>Fail Over: Take look at the Client developers guide on how to use fail over between multiple nodes.</para> </listitem>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,28 +1,127 @@
-<!--
-TODO: incorporate a performance chapter.
-
-The information about document materialization belongs in the reference though. And is not completely correct
-w.r.t. the use of document projection.
-
- <para>Your application can use a statement object to execute queries that return XML documents.
- The query must specify a valid document in VDB, or should have used SQL XML functions
- to create a XMl document.</para>
- <section>
- <title>XML Streaming</title>
- <para>XML documents are streamed from Teiid Server to the Teiid JDBC API.
- Normally, the document never materializes in the server memory, avoiding potential
- out-of-memory issues and improving the first response time for large documents.
- When using style sheets, or XQuery, the whole document
- must be materialized on the server. Therefore memory issues may occur for large documents.
- A result document can be obtained from the JDBC resultset using <code>getSQLXML</code> method.
- </para>
- <para>The document is broken into pieces when being created and streamed.
- The maximum size of each piece in the stream can be configured with the
- <code>"lobChunkSizeInKB"</code> system property on the Server. The default value is 100 KB.
- At any given time, this is the maximum amount of memory that can be held by a particular
- XML query against the system. In heavily loaded or memory-constrained scenarios,
- this value can decrease the amount of memory used. As a side effect, streaming will occur in smaller pieces, reducing initial document response time while
- increasing full response time (as this is less efficient).</para>
- </section>
-
- -->
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter id="performance">
+ <title>Performance Tuning</title>
+ <section id="memory_management">
+ <title>Memory Management</title>
+ <para>The BufferManager is responsible for tracking both memory and disk usage
+ by Teiid. Configuring the BufferManager properly is one of the most
+ important parts of ensuring high performance. See the &jboss-beans;
+ file for all BufferManager settings.
+ </para>
+ <para>
+ The Teiid engine uses batching to reduce the number of memory
+ rows processed at a given time. The batch sizes may be adjusted to larger values if few clients will be
+ accessing the Teiid server simultaneously.
+ </para>
+ <para>
+ The <code>maxReserveBatchColumns</code>
+ setting determines the total number of batches (with a max of
+ <code>processorBatchSize</code> rows) multiplied by their column width
+ that can be held in memory directly by the BufferManager.
+ This number does not include persistent batches held by soft (such as
+ index pages) or weak references. When your installation can dedicate
+ more memory to Teiid, consider increasing this value in proportion to the number of gigabytes you
+ wish Teiid to use - e.g. 2GB on a 32 bit VM would double the value to
+ 32768. For 64 bit VMs you should use a value of approximately 11000
+ per GB.
+ The BufferManager automatically triggers the use of a canonical
+ value cache when more than 25% of the reserve is in use.
+ This can dramatically cut the memory usage in situations where similar
+ value sets are being read through Teiid, but does introduce a lookup cost.
+ If you are processing large (100s of MBs) of highly unique datasets
+ through Teiid, you should consider <link linkend="system_properties">disabling value caching</link> since it
+ will not significantly reduce memory consumption.
+ </para>
+ <para>
+ Each intermediate result buffer, temporary LOB, and temporary table
+ is stored in its own set of buffer files,
+ where an individual file is
+ limited to <code>maxFileSize</code> megabytes.
+ Consider increasing the storage space available to all such
+ files <code>maxBufferSpace</code>
+ if your installation makes use of internal materialization, makes
+ heavy use of SQL/XML, or processes large row counts.
+ </para>
+ </section>
+ <section>
+ <title>Threading</title>
+ <para>Socket threads are configured for each <link linkend="socket_transport">transport</link>.
+ They handle NIO non-blocking IO operations as well as directly servicing any operation that can run without blocking.</para>
+ <para>For longer running operations, the socket threads queue with work the query engine.
+ The query engine has two settings that determine its thread utilization.
+ <code>maxThreads</code> sets the total number of threads available for query engine work (processing plans, transaction control operations, processing source queries, etc.).
+ You should consider increasing the maximum threads on systems with a large number of available processors and/or when it's common to issue non-transactional queries with that
+ issue a large number of concurrent source requests.
+ <code>maxActivePlans</code>, which should always be smaller than maxThreads, sets the number of the maxThreads
+ that should be used for user query processing. Increasing the maxActivePlans should be considered for workloads with a high number of long
+ running queries and/or systems with a large number of available processors. If memory issues arise from increasing the max threads and the
+ max active plans, then consider decreasing the processor/connector batch sizes to limit the base number of memory rows consumed by each plan.</para>
+ </section>
+ <section>
+ <title>Cache Tuning</title>
+ <para>Caching can be tuned for cached result (including user query results and procedure results) and prepared plans (including user and stored procedure plans).
+ Even though it is possible to disable or otherwise severely constrain these caches, this would probably never be done in practice as it would lead to poor performance.
+ </para><para>Cache statistics can be obtained through the Admin Console or Adminshell. The statistics can be used to help tune cache parameters and ensure a hit ratio.</para>
+ <para>Plans are currently fully held in memory and may have a significant memory footprint. When making extensive use of prepared statements and/or virtual procedures,
+ the size of the plan cache may be increased proportionally to number of GB intended for use by Teiid.
+ </para><para>While the result cache parameters control the cache result entries (max number, eviction, etc.), the result batches themselves are accessed through the <link linkend="memory_management">BufferManager</link>.
+ If the size of the result cache is increased, you may need to tune the BufferManager configuration to ensure there is enough buffer space.
+ </para>
+ </section>
+ <section id="socket_transport">
+ <title>Socket Transports</title>
+ <para>Teiid separates the configuration of its socket transports for
+ JDBC, ODBC, and Admin access.
+ Typical installations will not need to
+ adjust the default thread and buffer
+ size settings. At this time, ODBC
+ queries are executed synchronously from the socket thread.
+ Simultaneous long-running queries may exhaust the available threads.
+ Consider increasing the default max threads (15) for ODBC if you
+ expect a higher concurrent load of long-running queries.</para>
+ </section>
+ <section>
+ <title>LOBs</title>
+ <para>LOBs and XML documents are streamed from the Teiid Server to the
+ Teiid JDBC API.
+ Normally, these values are not materialized in the
+ server memory - avoiding potential out-of-memory issues.
+ When using style sheets, or XQuery, whole XML documents must be
+ materialized on the server.
+ Even when using the XMLQuery or XMLTable functions and
+ document projection is applied, memory issues may occur for large
+ documents.
+ </para>
+ <para>
+ LOBs are broken into pieces when being created and streamed.
+ The maximum size of each piece when fetched by the client can be
+ configured with the <code>"lobChunkSizeInKB"</code>
+ property in the &jboss-beans; file. The default value is 100 KB.
+ When dealing with extremely large LOBs, you may consider increasing this
+ value to decrease the amount of round-trips to stream the result.
+ Setting the value too high may cause the server or client to have
+ memory issues.
+ </para>
+ <para>Source LOB values are typically accessed by reference, rather
+ than having the value copied to a temporary location.
+ Thus care must be taken to ensure that source LOBs are returned in a
+ memory-safe manner.
+ </para>
+ </section>
+ <section>
+ <title>Other Considerations</title>
+ <para>When
+ using Teiid in a development environment, you may consider setting
+ the maxSourceRows property in the &jboss-beans;
+ file to reasonably small level value (e.g. 10000) to prevent large
+ amounts of data from being pulled from sources.
+ Leaving the exceptionOnMaxSourceRows set to true will alert the developer
+ through an exception that an attempt was made to retrieve more than
+ the specified number of rows.
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/security.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/security.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/security.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -29,7 +29,7 @@
application's security domain name in the "teiid-jboss-beans.xml" file in the SessionService section.
Please note that for this to work, the security-domain
must be a JAAS based Login Module and your client application MUST obtain Teiid connection
- using <emphasis>Local</emphasis> Connection.</para>
+ using <emphasis>Local</emphasis> Connection, with <emphasis>PassthroughAuthentication=true</emphasis> flag set.</para>
</section>
</section>
<section>
@@ -74,7 +74,7 @@
successfully or unsuccessfully authenticates the
user.
</para>
- <para>If no domain can authenticate the user, the logon
+ <para>If no domain can authenticate the user, the login
attempt will fail.
Details of the failed attempt including invalid users, which
domains were consulted, etc. will be in the server log with appropriate
@@ -102,19 +102,20 @@
</section>
- <section id="connfigure_server">
+ <section id="ssl_config">
<title>Configuring SSL</title>
<para>The Teiid's configuration file
<code><jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml</code>,
- contains the properties to configure SSL.</para>
+ contains the properties to configure SSL per socket transport.</para>
<itemizedlist>
- <para>There are two separate connection profiles:</para>
- <listitem><para>JDBC Connection - The <code>JdbcSslConfiguration</code> bean configuration defines this.</para></listitem>
- <listitem><para>Admin Connection - The <code>AdminSslConfiguration</code> bean configuration defines this.</para></listitem>
+ <para>There are three socket transports, each with it's own SSL configuration:</para>
+ <listitem><para>JDBC Connections - uses the <code>JdbcSslConfiguration</code> bean configuration. Defaults to only encrypt login traffic, none of the other properties are used.</para></listitem>
+ <listitem><para>Admin Connections - uses the <code>AdminSslConfiguration</code> bean configuration. Defaults to encrypting all traffic with anonymous SSL, none of the other properties are used.</para></listitem>
+ <listitem><para>ODBC Connections - uses the <code>OdbcSslConfiguration</code> bean configuration. Defaults to no SSL.</para></listitem>
</itemizedlist>
<example><title>Example Configuration</title>
<programlisting><![CDATA[<bean name="JdbcSslConfiguration" class="org.teiid.transport.SSLConfiguration">
- <property name="sslEnabled">false</property>
+ <property name="mode">login</property>
<property name="keystoreFilename">cert.keystore</property>
<property name="keystorePassword">passwd</property>
<property name="keystoreType">JKS</property>
@@ -124,27 +125,50 @@
<property name="truststorePassword">passwd</property>
<!-- 1-way, 2-way, anonymous -->
<property name="authenticationMode">1-way</property>
- <property name="clientEncryptionEnabled">true</property>
</bean>]]></programlisting>
</example>
- <orderedlist>
+ <itemizedlist>
<title>Properties</title>
- <listitem><para>sslEnabled - true|false, SSL usage either turned ON or OFF </para></listitem>
- <listitem><para>sslProtocol- Type of SSL protocol to be used. Default is SSLv3</para></listitem>
+ <listitem><para>mode - diabled|login|enabled, disabled = no transport or message level security will be used.
+ login = only the login traffic will be encrypted at a message level using 128 bit AES with an ephemerial DH key exchange. No other config values are needed in this mode.
+ enabled = traffic will be secured using the other configuration properties.</para></listitem>
+ <listitem><para>sslProtocol- Type of SSL protocol to be used. Default is TLSv1</para></listitem>
<listitem><para>keystoreType - Keystore type created by the keytool. Default "JKS" is used.</para></listitem>
- <listitem><para>authenticationMode - anonymous|1-way|2-way, Type of SSL mode, see
- above about different <link linkend="ssl_modes">SSL modes</link> available.</para></listitem>
+ <listitem><para>authenticationMode - anonymous|1-way|2-way, Type of <link linkend="ssl_aut">SSL Authentication Mode</link>.</para></listitem>
<listitem><para>keymanagementAlgorithm - Type of key algorithm used. Default
is based upon the VM, e.g. "SunX509"</para></listitem>
<listitem><para>keystoreFilename - The file name of the keystore, which contains the
- private key of the Server. This must be available in the classpath of Teiid Server</para></listitem>
+ private key of the Server. This must be available in the classpath of Teiid Server.</para></listitem>
<listitem><para>keystorePassword - password for the keystore.</para></listitem>
<listitem><para>truststoreFilename - if "authenticationMode" is chosen
as "2-way", then this property must be provided. This is the truststore that contains the
public key for the client. Depending upon how you created the keystore and truststores,
this may be same file as defined under "keystoreFilename" property.</para></listitem>
<listitem><para>truststorePassword - password for the truststore. </para></listitem>
- </orderedlist>
-
+ </itemizedlist>
+ <section id="ssl_auth">
+ <title>SSL Authentication Modes</title>
+ <para>SSL supports multiple authentication modes. In most secure intranet environments, anonymous is suitable to just bulk encrypt traffic without the need
+ to setup SSL certificates.
+ </para>
+ <itemizedlist>
+ <listitem><para><emphasis>anonymous</emphasis> - no certificates are exchanged, settings are not needed for the keystore and truststore properties.
+ Client must have <code>org.teiid.ssl.allowAnon</code> set to true (the default) to connect to an anonymous server.
+ </para></listitem>
+ <listitem><para><emphasis>1-way</emphasis> - the server will present a certificate, which is obtained from the keystore related properties.
+ The client should have a truststore configured to accept the server certificate.
+ </para></listitem>
+ <listitem><para><emphasis>2-way</emphasis> - the server will present a certificate, which is obtained from the keystore related properties.
+ The client should have a truststore configured to accept the server certificate. The client is also expected to present a certificate, which is obtained from its
+ keystore. The client certificate should be accepted by the trust store configured by the truststore related properties.
+ </para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="encryption_strength">
+ <title>Encryption Strength</title>
+ <para>Both anonymous SSL and login only encryption are configured to use 128 bit AES encryption.
+ 1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.
+ </para>
+ </section>
</section>
</chapter>
\ No newline at end of file
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -11,8 +11,15 @@
<section>
<title>Deploying a VDB</title>
- <para>Once you have a "VDB" built it can be deployed in Teiid runtime in different ways.</para>
+ <para>Once you have a "VDB" built it can be deployed/removed in Teiid runtime in different ways.</para>
+ <warning><para>If <link linkend="vdb-versioning">VDB versioning</link> is not used to give distinct version numbers, overwriting a VDB of the same name
+ will terminate all connections to the old VDB. It is recommended that VDB versioning be used for production systems.
+ </para></warning>
+
+ <note><para>Removing an existing VDB will immediately clean up VDB file resources, but will not automatically terminate existing sessions.
+ </para></note>
+
<section>
<title>Direct File Deployment</title>
<para>Copy the VDB file into the "<jboss-install>/server/<profile>/deploy" directory.
@@ -47,7 +54,7 @@
deploy a VDB use this method. This method is preferable for OEM users, who are trying to extend the
Teiid's capabilities through their applications.</para>
</section>
-
+
</section>
<section>
Modified: trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
===================================================================
--- trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -108,22 +108,23 @@
<title>Loading And Refreshing</title>
<para>An internal materialized view table is initially in an invalid state (there is no data). The first user query will trigger an implicit loading of the data.
All other queries against the materialized view will block until the load completes.
- In some situations administrators may wish to better control when the cache is loaded with a call to <code>SYS.refreshMatView</code>. The initial load may itself trigger the initial load
+ In some situations administrators may wish to better control when the cache is loaded with a call to <code>SYSADMIN.refreshMatView</code>. The initial load may itself trigger the initial load
of dependent materialized views. After the initial load user queries against the materialized view table will only block if it is in an invalid state.
- The valid state may also be controled through the <code>SYS.refreshMatView</code> procedure.
+ The valid state may also be controled through the <code>SYSADMIN.refreshMatView</code> procedure.
<example>
<title>Invalidating Refresh</title>
- <programlisting>CALL SYS.refreshMatView(viewname=>'schema.matview', invalidate=>true)</programlisting>
+ <programlisting>CALL SYSADMIN.refreshMatView(viewname=>'schema.matview', invalidate=>true)</programlisting>
<para>matview will be refreshed and user queries will block until the refresh is complete (or fails).</para>
</example>
While the initial load may trigger a transitive loading of dependent materialized views,
subsequent refreshes performed with <code>refreshMatView</code> will use dependent materialized view tables if they exist. Only one load may occur at a time. If a load is already in progress when
- the <code>SYS.refreshMatView</code> procedure is called, it will return -1 immediately rather than preempting the current load.
+ the <code>SYSADMIN.refreshMatView</code> procedure is called, it will return -1 immediately rather than preempting the current load.
</para>
<section>
<title>TTL Snapshot Refresh</title>
- <para>The <link linkend="cache-hint">cache hint</link> may be used to automatically trigger a full snapshot refresh after a specified time to live.
- The refresh is equivalent to <code>CALL SYS.refreshMatView('view name', false)</code>, but performed asynchronously so that user queries do not block on the load.</para>
+ <para>The <link linkend="cache-hint">cache hint</link> may be used to automatically trigger a full snapshot refresh after a specified time to live (ttl).
+ The ttl starts from the time the table is finished loading.
+ The refresh is equivalent to <code>CALL SYSADMIN.refreshMatView('view name', false)</code>, but performed asynchronously so that user queries do not block on the load.</para>
<example>
<title>Auto-refresh Transformation Query</title>
<programlisting>/*+ cache(ttl:3600000) */ select t.col, t1.col from t, t1 where t.id = t1.id</programlisting>
@@ -143,13 +144,13 @@
<section>
<title>Updatable</title>
<para>In advanced use-cases the <link linkend="cache-hint">cache hint</link> may also be used to mark an internal materialized view as updatable.
- An updatable internal materialized view may use the <code>SYS.refreshMatViewRow</code> procedure to update a single row in the materialized table.
+ An updatable internal materialized view may use the <code>SYSADMIN.refreshMatViewRow</code> procedure to update a single row in the materialized table.
If the source row exists, the materialized view table row will be updated. If the source row does not exist, the correpsonding materialized row will be deleted.
- To be updatable the materialized view must have a single column primary key. Composite keys are not yet supported by <code>SYS.refreshMatViewRow</code>.
+ To be updatable the materialized view must have a single column primary key. Composite keys are not yet supported by <code>SYSADMIN.refreshMatViewRow</code>.
<example>
<title>Updatable Transformation Query</title>
<para>Transofrmation Query: <programlisting>/*+ cache(updatable) */ select t.col, t1.col from t, t1 where t.id = t1.id</programlisting></para>
- <para>Update SQL: <programlisting>CALL SYS.updateMatViewRow(viewname=>'schema.matview', key=>5)</programlisting></para>
+ <para>Update SQL: <programlisting>CALL SYSADMIN.updateMatViewRow(viewname=>'schema.matview', key=>5)</programlisting></para>
<para>Given that the schema.matview defines an interger column col as it's primary key, the update will check the live source(s) for the row values.</para>
</example>
The update query will not use dependent materialized view tables, so care should be taken to ensure that getting a single
@@ -178,5 +179,16 @@
</itemizedlist>
</para>
</section>
+ <section>
+ <title>Clustering Considerations</title>
+ <para>Each member in a cluster maintains its own copy of each materialized table and associated indexes.
+ With cache clustering enabled, an additional snapshot copy of the table is maintained for loading by other members.
+ An attempt is made to ensure each member receives the same full refresh events as the others.
+ Full consistency for updatable materialized views however is not guarenteed.
+ Periodic full refreshes of updatable materialized view tables helps ensure consistency among members.
+ <note><para>Loads of materialized tables are not coordinated across the cluster. It is possible for the same ttl expiration to trigger a load at each member.</para></note>
+ In many clustered scenarios using external materialization is advantagious to fully control the loading of the tables and to have materialized data that is durable.
+ </para>
+ </section>
</section>
</chapter>
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -53,7 +53,7 @@
the "version" property at the same time is not allowed.
</para></listitem>
<listitem><para>mm - defines Teiid JDBC protocol, mms defines a secure channel (see the <link linkend="ssl">SSL chapter</link> for more)</para></listitem>
- <listitem><para><host> - defines the server where the Teiid Server is installed</para></listitem>
+ <listitem><para><host> - defines the server where the Teiid Server is installed. If you are using IPv6 binding address as the host name, place it in square brackets. ex:[::1]</para></listitem>
<listitem><para><port> - defines the port on which the Teiid Server is listening for incoming JDBC connections.</para></listitem>
<listitem><para>[prop-name=prop-value] - additionally you can supply any number of name value pairs separated by semi-colon
[;]. All supported URL properties are defined in the <link linkend="connection_properties">connection properties section</link>. Property values should be URL encoded if they contain reserved characters, e.g. ('?', '=', ';', etc.)</para></listitem>
@@ -218,7 +218,7 @@
<entry>
<code>boolean</code>
</entry>
- <entry>Only applies to embedded connections. When this option is set to "true", then Teiid looks for
+ <entry>Only applies to "local" connections. When this option is set to "true", then Teiid looks for
already authenticated security context on the calling thread. If one found it uses that users credentials
to create session. Teiid also verifies that the same user is using this connection during the life of the connection.
if it finds a different security context on the calling thread, it switches the identity on the connection,
@@ -276,7 +276,8 @@
<entry>
<code>String</code>
</entry>
- <entry>Server where the Teiid runtime installed</entry>
+ <entry>Server hostname where the Teiid runtime installed. If you are using IPv6 binding address as the host name,
+ place it in square brackets. ex:[::1]</entry>
</row>
<row>
<entry>
@@ -285,7 +286,9 @@
<entry>
<code>String</code>
</entry>
- <entry>Optional delimited list of host:port entries. See the <link linkend="multiple_hosts">multiple hosts</link> section for more information.</entry>
+ <entry>Optional delimited list of host:port entries. See the <link linkend="multiple_hosts">multiple hosts</link>
+ section for more information. If you are using IPv6 binding address as the host name,
+ place them in square brackets. ex:[::1]</entry>
</row>
<row>
<entry>
@@ -339,7 +342,7 @@
<entry>
<code>boolean</code>
</entry>
- <entry>Only applies to embedded connections. When this option is set to "true", then Teiid looks for
+ <entry>Only applies to "local" connections. When this option is set to "true", then Teiid looks for
already authenticated security context on the calling thread. If one found it uses that users credentials
to create session. Teiid also verifies that the same user is using this connection during the life of the connection.
if it finds a different security context on the calling thread, it switches the identity on the connection,
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -253,6 +253,19 @@
</itemizedlist>
<para>The SHOW statement is most commonly used to retrieve the query plan, see the plan <link linkend="plan_debug">debug example</link>.</para>
</section>
+
+ <section id="transaction_statement">
+ <title>Transaction Statements</title>
+ <para>In situations where the direct use of the JDBC connection is not possible, transaction statements can be used to control a local transaction.</para>
+ <itemizedlist>
+ <listitem><para><emphasis>START TRANSACTION</emphasis> - synonym for <code>connection.setAutoCommit(false)</code></para>
+ </listitem>
+ <listitem><para><emphasis>COMMIT</emphasis> - synonym for <code>connection.setAutoCommit(true)</code></para>
+ </listitem>
+ <listitem><para><emphasis>ROLLBACK</emphasis> - synonym for <code>connection.rollback()</code> and returning to auto commit mode.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
<section id="partial_results">
<title>Partial Results Mode</title>
@@ -279,26 +292,53 @@
<para>For each source that is excluded from the query, a warning will be generated
describing the source and the failure. These warnings can be obtained from the
- <code>ResultSet.getWarnings()</code> method. This method returns a <code>SQLWarning</code> object but
+ <code>Statement.getWarnings()</code> method. This method returns a <code>SQLWarning</code> object but
in the case of "partial results" warnings, this will be an object of
type <code>org.teiid.jdbc.PartialResultsWarning</code> class. This class can be
used to obtain a list of all the failed sources by name and to obtain
the specific exception thrown by each resource adaptor. </para>
- <para>Below is an example of printing the list of failed sources:</para>
- <programlisting><![CDATA[statement.setExecutionProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE, “true”);
-ResultSet results = statement.executeQuery(“SELECT Name FROM Accounts”);
-SQLWarning warning = results.getWarnings();
-if(warning instanceof PartialResultsWarning) {
- PartialResultsWarning partialWarning = (PartialResultsWarning) warning;
- Collection failedConnectors = partialWarning.getFailedConnectors();
- Iterator iter = failedConnectors.iterator();
- while(iter.hasNext()) {
- String connectorName = (String) iter.next();
- SQLException connectorException = partialWarning.getConnectorException(connectorName);
- System.out.println(connectorName + “: “ +ConnectorException.getMessage();
- }
-}]]></programlisting>
+ <note>
+ <para> Since Teiid supports cursoring before the entire result is formed, it is
+ possible that a data source failure will not
+ be determined until after the first batch of results have
+ been returned to the client. This can happen in the case of
+ unions, but not joins. To ensure that all warnings have been accumulated, the
+ statement should be checked after the entire result set has been read.</para>
+ </note>
+
+ <para>
+ Partial results mode is off by default but can be turned on for all queries in a Connection with either
+ setPartialResultsMode("true") on a DataSource or
+ partialResultsMode=true on a JDBC URL. In either case, partial
+ results mode may be toggled later with a <link linkend="set_statement">set statement</link>.
+ </para>
+ <example>
+ <title>Setting Partial Results Mode</title>
+ <programlisting>Statement statement = ...obtain statement from Connection...
+statement.execute("set partialResultsMode true");</programlisting>
+ </example>
+
+ <example>
+ <title>Getting Partial Results Warnings
+ </title>
+ <programlisting>statement.execute("set partialResultsMode true");
+ResultSet results = statement.executeQuery("SELECT Name FROM Accounts");
+while (results.next()) {
+ ... //process the result set
+}
+SQLWarning warning = statement.getWarnings();
+if(warning instanceof PartialResultsWarning) {
+ PartialResultsWarning partialWarning = (PartialResultsWarning)warning;
+ Collection failedConnectors = partialWarning.getFailedConnectors();
+ Iterator iter = failedConnectors.iterator();
+ while(iter.hasNext()) {
+ String connectorName = (String) iter.next();
+ SQLException connectorException = partialWarning.getConnectorException(connectorName);
+ System.out.println(connectorName + ": " + ConnectorException.getMessage();
+ }
+}</programlisting>
+ </example>
</section>
<section>
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/ssl.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -149,9 +149,6 @@
# authentication that requires trust not provided
# by the system defaults.
#
-# Set to NONE for anonymous authentication using
-# the TLS_DH_anon_WITH_AES_128_CBC_SHA cipher suite
-#
#org.teiid.ssl.trustStore=
@@ -165,7 +162,15 @@
# The cipher protocol, defaults to SSLv3
#
-org.teiid.ssl.protocol=SSLv3]]></programlisting>
+org.teiid.ssl.protocol=SSLv3
+
+#
+# Whether to allow anonymous SSL
+# (the TLS_DH_anon_WITH_AES_128_CBC_SHA cipher suite)
+# defaults to true
+#
+
+org.teiid.ssl.allowAnon=true]]></programlisting>
<example>
<title>1-way SSL</title>
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -680,10 +680,10 @@
<title>Translator Capabilities</title>
<para>The <code>ExecutionFactory</code> class defines all the methods that describe the capabilities of a Translator.
These are used by the Connector Manager to determine what kinds of commands the translator is
- capable of executing. A base <code>ExecutionFactory</code> class implements all the basic capabilities, which says
- your translator does not support any cpabilities. Your extended
+ capable of executing. A base <code>ExecutionFactory</code> class implements all the basic capabilities methods, which says
+ your translator does not support any capabilities. Your extended
<code>ExecutionFactory</code> class must override the the necessary methods to specify which
- capabilities your translator supports. </para>
+ capabilities your translator supports. You should consult the debug log of query planning (set showplan debug) to see if desired pushdown requires additional capabilities.</para>
<section>
<title>Capability Scope</title>
<para>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/dataroles.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/dataroles.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -43,6 +43,9 @@
<warning><para>Unlike previous versions of Teiid, non-visible models are accessible by user queries.
To restrict user access at a model level, at least one data role should be created to enable data role checking.
In turn that role can be mapped to any authenticated user and should not grant permissions to models that should be inaccessable.</para></warning>
+
+ <para>Permissions are not applicable to the SYS and pg_catalog schemas. These metadata reporting schemas are always accessible regardless of the user.
+ The SYSADMIN schema however may need permissions as applicable.</para>
<orderedlist>
<para>To process a <emphasis>SELECT</emphasis> statement or a stored procedure execution, the user account requires the following access rights:</para>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -284,80 +284,17 @@
<section>
<title>Partial Results</title>
<para>Teiid provides the capability to obtain "partial
- results" in the event of data source unavailability. This is
+ results" in the event of data source unavailability or failure. This is
especially useful when unioning information from multiple
sources, or when doing a left outer join, where you are
'appending' columns to a master record but still want the record
- if the extra info is not available.</para>
- <para> If one or more data sources are unavailable to return
- results, then the result set obtained from the remaining
- available sources will be returned. In the case of joins, an
- unavailable data source essentially contributes zero tuples to
- the result set.</para>
- <section>
- <title>Setting Partial Results Mode</title>
- <para>
- Partial results mode is off by default but can be turned on by
- default for all queries in a Connection with either
- setPartialResultsMode("true") on a DataSource or
- partialResultsMode=true on a JDBC URL. In either case, partial
- results mode may be overridden with a set statement.
- </para>
- <example>
- <title>Example - Setting Partial Results Mode</title>
- <programlisting>Statement statement = ...obtain statement from Connection...
-statement.execute("set partialResultsMode true");</programlisting>
- </example>
- </section>
- <section>
- <title>Source Unavailability</title>
+ if the extra information is not available.</para>
+
<para>A source is considered to be 'unavailable' if the
connection factory associated with the source issues an
exception in response to a query. The exception will be
propagated to the query processor, where it will become a
- warning in the result set.</para>
- <warning>
- <para> Since Teiid supports multi-source cursoring, it is
- possible that the unavailability of a data source will not
- be determined until after the first batch of results have
- been returned to the client. This can happen in the case of
- unions, but not joins. In this situation, there will be no
- warnings in the result set when the client is processing the
- first batch of results. The client will be responsible for
- periodically checking the status of warnings in the results
- object as results are being processed, to see if a new
- warning has been added due to the detection of an
- unavailable source. [Note that client applications have no
- notion of ‘batches’, which are purely a server-side entity.
- Client apps deal only with records.]</para>
- </warning>
- <para> For each source that is excluded from a query, a warning
- will be generated describing the source and the failure. These
- warnings can be obtained from the Statement.getWarnings()
- method. This method returns a SQLWarning object but in the
- case of "partial results" warnings, this will be an object of
- type org.teiid.jdbc.PartialResultsWarning. This class
- can be used to obtain a list of all the failed connectors by
- name and to obtain the specific exception thrown by each
- connector.</para>
- <example>
- <title>Example - Printing List of Failed Sources
- </title>
- <programlisting>statement.execute("set partialResultsMode true");
-ResultSet results = statement.executeQuery("SELECT Name FROM Accounts");
-SQLWarning warning = statement.getWarnings();
-if(warning instanceof PartialResultsWarning) {
- PartialResultsWarning partialWarning = (PartialResultsWarning)warning;
- Collection failedConnectors = partialWarning.getFailedConnectors();
- Iterator iter = failedConnectors.iterator();
- while(iter.hasNext()) {
- String connectorName = (String) iter.next();
- SQLException connectorException = partialWarning.getConnectorException(connectorName);
- System.out.println(connectorName + ": " + ConnectorException.getMessage();
- }
-}</programlisting>
- </example>
- </section>
+ warning on the statement. See the Client Guide for more on Partial Results Mode and SQLWarnings.</para>
</section>
</section>
<section id="query_plan">
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1968,7 +1968,8 @@
<para>xquery in string. Return value is xml.</para>
<para>XMLQUERY is part of the SQL/XML 2006 specification.</para>
<para>See also <link linkend="xmltable">XMLTABLE</link></para>
- <note><para>A technique known as document projection is used to reduce the memory footprint of the context item document. Only the parts of the document needed by the xquery will be loaded into memory.</para></note>
+ <note><para>A technique known as document projection is used to reduce the memory footprint of the context item document.
+ Only the parts of the document needed by the XQuery path expressions will be loaded into memory. Since document projection analysis uses all relevant path expressions, even 1 expression that could potentially use many nodes, e.g. //x rather than /a/b/x will cause a larger memory footprint.</para></note>
</section>
<section id="xmlserialize">
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -2,11 +2,57 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="system_schema">
<title>System Schema</title>
+ <para>The built-in SYS and SYSADMIN schemas provide metadata tables and procedures against the current VDB.</para>
<section id="system_tables">
<title>System Tables</title>
<section>
<title>VDB, Schema, and Properties</title>
<section>
+ <title>SYSADMIN.VDBResources</title>
+ <para>This table provides the current VDB contents.</para>
+ <informaltable frame="all">
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>
+ <para>Column Name</para>
+ </entry>
+ <entry>
+ <para>Type</para>
+ </entry>
+ <entry>
+ <para>Description</para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>resourcePath</para>
+ </entry>
+ <entry>
+ <para>string</para>
+ </entry>
+ <entry>
+ <para>The path to the contents.</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>contents</para>
+ </entry>
+ <entry>
+ <para>blob</para>
+ </entry>
+ <entry>
+ <para>The contents as a blob.</para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </section>
+ <section>
<title>SYS.VirtualDatabases</title>
<para>This table supplies information about the currently
connected
@@ -393,7 +439,7 @@
</informaltable>
</section>
<section>
- <title>SYS.MatViews</title>
+ <title>SYSADMIN.MatViews</title>
<para>This table supplies information about all the materailized views in the virtual database.</para>
<informaltable frame="all">
<tgroup cols="3">
@@ -1726,42 +1772,9 @@
<tbody>
<row>
<entry>
- <para>getCharacterVDBResource</para>
+ <para>SYS.getXMLSchemas</para>
</entry>
<entry>
- <para>(string resourcePath)</para>
- </entry>
- <entry>
- <para>A single column containing the resource as a clob.</para>
- </entry>
- </row>
- <row>
- <entry>
- <para>getBinaryVDBResource</para>
- </entry>
- <entry>
- <para>(sting resourcePath)</para>
- </entry>
- <entry>
- <para>A single column containing the resource as a blob.</para>
- </entry>
- </row>
- <row>
- <entry>
- <para>getVDBResourcePaths</para>
- </entry>
- <entry>
- <para>()</para>
- </entry>
- <entry>
- <para>A single column containing the resource paths as strings.</para>
- </entry>
- </row>
- <row>
- <entry>
- <para>getXMLSchemas</para>
- </entry>
- <entry>
<para>(string document)</para>
</entry>
<entry>
@@ -1770,7 +1783,7 @@
</row>
<row>
<entry>
- <para>refreshMatView</para>
+ <para>SYSADMIN.refreshMatView</para>
</entry>
<entry>
<para>(string ViewName, boolean Invalidate)</para>
@@ -1781,7 +1794,7 @@
</row>
<row>
<entry>
- <para>refreshMatViewRow</para>
+ <para>SYSADMIN.refreshMatViewRow</para>
</entry>
<entry>
<para>(string ViewName, object Key)</para>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -175,9 +175,7 @@
Global - the XAResource interface provided by an XAConnection is
used to control the transaction. Note that XAConnections are
available only if Teiid is consumed through its XADataSource,
- <classname>org.teiid.jdbc.TeiidDataSource
- </classname>
- . JEE containers or data access APIs typically control XA
+ <classname>org.teiid.jdbc.TeiidDataSource</classname>. JEE containers or data access APIs typically control XA
transactions on behalf of application code.
</para>
</listitem>
@@ -211,6 +209,129 @@
portable fashion requires some kind of transaction support.</para>
</section>
</section>
+ <section>
+ <title>Transactional Behavior with JBoss Data Source Types</title>
+ <para>JBoss AS allows creation of different types of data sources, based on their transactional capabilities. The type
+ of data source you create for your VDB's sources also dictates if that data source will be participating the
+ distributed transaction or not, irrespective of the transaction scope you selected from above. Here are different types of data sources</para>
+ <itemizedlist>
+ <listitem>
+ <para>xa-datasource: Capable of participating in the distributed transaction using XA. This is recommended
+ type be used with any Teiid sources.</para>
+ </listitem>
+ <listitem>
+ <para>local-datasource: Does not participate in XA, unless this is the <emphasis>only</emphasis> source that is
+ local-datasource that is participating among other xa-datasources in the current distributed transaction. This technique is
+ called last commit optimization. However, if you have more then one local-datasources participating in a transaction, then
+ the transaction manager will end up with <emphasis>"Could not enlist in transaction on entering meta-aware object!;"</emphasis>
+ exception.</para>
+ </listitem>
+ <listitem>
+ <para>no-tx-datasource: Does not participate in distributed transaction at all. In the scope of Teiid command over multiple sources,
+ you can include this type of datasource in the same distributed transaction context, however this source will be it
+ will not be subject to any transactional participation. Any changes done on this source as part of the transaction scope,
+ can not be rolled back.</para>
+ </listitem>
+ </itemizedlist>
+ <para>If you have three different sources A, B, C and they are being used in Teiid. Here are some variations
+ on how they behave with different types of data sources. The suffixes "xa", "local", "no-tx" define different type of sources used.</para>
+ <itemizedlist>
+ <listitem>
+ <para>A-xa B-xa, C-xa : Can participate in all transactional scopes. No restrictions.</para>
+ </listitem>
+ <listitem>
+ <para>A-xa, B-xa, c-local: Can participate in all transactional scopes. Note that there is only one single source
+ is "local". It is assumed that in the Global scope, the third party datasource, other than Teiid Datasource is also XA.</para>
+ </listitem>
+ <listitem>
+ <para>A-xa, B-xa, C-no-tx : Can participate in all transactional scopes. Note "C" is not a
+ really bound by any transactional contract. A and B are the only participents in XA transaction.</para>
+ </listitem>
+ <listitem>
+ <para>A-xa, B-local, C-no-tx : Can participate in all transactional scopes. Note "C" is not a
+ really bound by any transactional contract, and there is only single "local" source.</para>
+ </listitem>
+ <listitem>
+ <para>If any two or more sources are "local" : They can only participate in Command mode with "autoCommitTxn=OFF".
+ Otherwise will end with exception as "Could not enlist in transaction on entering meta-aware object!;" exception, as it is
+ not possible to do a XA transaction with "local" datasources.</para>
+ </listitem>
+ <listitem>
+ <para>A-no-tx, B-no-tx, C-no-tx : Can participate in all transaction scopes, but none of the sources will be
+ bound by transactional terms. This is equivalent to not using transactions or setting Command mode with "autoCommitTxn=OFF".</para>
+ </listitem>
+ </itemizedlist>
+ <note><para>Teiid Designer creates "local" data source by default which is not optimal for the XA transactions.
+ Teiid would like this to be creating a XA data sources, however with current limitations with DTP that feature is
+ currently not available. To create XA data source, look in JBoss AS "doc" directory for example templates,
+ or use the "admin-console" to create the XA data sources.</para></note>
+
+ <para>If your datasource is not XA, and not the only local source and can not use "no-tx", then you can look into
+ extending the source to implement the compensating XA implementation. i.e. define your own resource manager for
+ your source and manage the transaction the way you want it to behave. Note that this could be complicated if not
+ impossible if your source natively does not support distributed XA protocol. In summay</para>
+ <itemizedlist>
+ <listitem>
+ <para>Use XA datasource if possible</para>
+ </listitem>
+ <listitem>
+ <para>Use no-tx datasource if applicable</para>
+ </listitem>
+ <listitem>
+ <para>Use autoCommitTxn = OFF, and let go distributed transactions, though not recommended</para>
+ </listitem>
+ <listitem>
+ <para>Write a compensating XA based implementation.</para>
+ </listitem>
+ </itemizedlist>
+
+ <table>
+ <title>Teiid Transaction Participation</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Teiid-Tx-Scope</entry>
+ <entry>XA source</entry>
+ <entry>Local Source</entry>
+ <entry>No-Tx SOurce</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Local</entry>
+ <entry>always</entry>
+ <entry>Only If Single Source</entry>
+ <entry>never</entry>
+ </row>
+ <row>
+ <entry>Global</entry>
+ <entry>always</entry>
+ <entry>Only If Single Source</entry>
+ <entry>never</entry>
+ </row>
+ <row>
+ <entry>Auto-commit=true, AutoCommitTxn=ON</entry>
+ <entry>always</entry>
+ <entry>Only If Single Source</entry>
+ <entry>never</entry>
+ </row>
+ <row>
+ <entry>Auto-commit=true, AutoCommitTxn=OFF</entry>
+ <entry>never</entry>
+ <entry>never</entry>
+ <entry>never</entry>
+ </row>
+ <row>
+ <entry>Auto-commit=true, AutoCommitTxn=DETECT</entry>
+ <entry>always</entry>
+ <entry>Only If Single Source</entry>
+ <entry>never</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </section>
<section>
<title>Limitations and Workarounds</title>
<itemizedlist>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,568 +1,779 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="translators">
-<title>Translators</title>
-<section>
-<title>Introduction to the Teiid Connector Architecture</title>
-<para>The TCA (Teiid Connector Architecture) provides Teiid with a robust mechanism for integrating with external systems. The TCA defines a common client interface between Teiid and an external system that includes metadata as to what SQL constructs are supported for pushdown and the ability to import metadata from the external system.</para>
-<para>>A Translator is the heart of the TCA and acts as the bridge logic between Teiid and an external system, which is most commonly accessed through a JCA resource adapter. See the Teiid Developers Guide for details on developing custom Translators and JCA resource adapters for use with Teiid.</para>
-<note>
-<para>The TCA is not the same as the JCA, the JavaEE Connector Architecture, although the TCA is designed for use with JCA resource adapters.</para>
-</note>
-<note>
-<para>The import capabilities of Teiid Translators is currently only used in <link linkend="dynamic_vdbs">dynamic VDBs</link> and not by the Teiid Designer.</para>
-</note>
-</section>
-<section>
-<title>Translators</title>
-<para>A Translator is typically paired with a particular JCA resource adapter. In instances where pooling, environment dependent configuration management, advanced security handling, etc. are not needed, then a JCA resource adapter is not needed. The configuration of JCA ConnectionFactories for needed resource adapters is not part of this guide, please see the Teiid Admin Guide and the kit examples for configuring resource adapters for use in JBossAS.</para>
-<para>Translators can have a number of configurable properties. These are broken down into execution properties, which determine aspects of how data is retrieved, and import settings, which determine what metadata is read for import.</para>
-<para>The execution properties for a translator typically have reasonable defaults. For specific translator types, e.g. the Derby translator, base execution properties are already tuned to match the source. In most cases the user will not need to adjust their values.</para>
-<table>
-<title>Base Execution Properties - shared by all translators</title>
-<tgroup cols="3">
-<colspec colwidth=".75*" />
-<colspec colwidth="1.5*" />
-<colspec colwidth=".5*" />
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>Immutable</entry>
-<entry>Set to true to indicate that the source never changes.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>RequiresCriteria</entry>
-<entry>Set to true to indicate that source SELECT/UPDATE/DELETE queries require a where clause.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>SupportsOrderBy</entry>
-<entry>Set to true to indicate that the ORDER BY clause is supported.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>SupportsOuterJoins</entry>
-<entry>Set to true to indicate that OUTER JOINs are supported.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>SupportsFullOuterJoins</entry>
-<entry>If outer joins are supported, true indicates that FULL OUTER JOINs are supported.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>SupportsInnerJoins</entry>
-<entry>Set to true to indicate that INNER JOINs are supported.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>SupportedJoinCriteria</entry>
-<entry>If joins are supported, defines what criteria may be used as the join criteria. May be one of (ANY, THETA, EQUI, or KEY).</entry>
-<entry>ANY</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<note>
-<para>Only a subset of the metadata as to what SQL constructs the source supports can be set through execution properties. If more control is needed, please consult the Teiid Developers Guide.</para>
-</note>
-<para>There are no base importer settings.</para>
-<section>
-<title>File Translator</title>
-<para>The file translator, known by the type name <emphasis>file</emphasis>, exposes stored procedures to leverage file system resources exposed by the file resource adapter.
-It will commonly be used with the <link linkend="texttable">TEXTTABLE</link> or <link linkend="xmltable">XMLTABLE</link> table functions to use CSV or XML formated data.</para>
-<table>
-<title>Execution Properties</title>
-<tgroup cols="3">
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>Encoding</entry>
-<entry>The encoding that should be used for CLOBs returned by the getTextFiles procedure</entry>
-<entry>The system default encoding</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<para>There are file importer settings, but it does provide metadata for dynamic vdbs.</para>
-<section><title>Usage</title>
-<para>Retrieve all files as BLOBs with the given extension at the given path. <programlisting>call getFiles('path/*.ext')</programlisting>
-If the extension pattern is not specified and the path is a directory, then all files in the directory will be returned. If the path or filename doesn't exist, then no results will be returned.
-</para>
-<para>Retrieve all files as CLOBs with the given extension at the given path. <programlisting>call getTextFiles('path/*.ext')</programlisting></para>
-<para>Save the CLOB, BLOB, or XML file to given path <programlisting>call saveFile('path', value)</programlisting></para>
-<para>See the database metadata for full descriptions of the getFiles, getTextFiles, and saveFile procedures.</para>
-</section>
-</section>
-<section>
-<title>JDBC Translator</title>
-<para>The JDBC translator bridges between SQL semantic and data type difference between Teiid and a target RDBMS. Teiid has a range of specific translators that target the most popular open source and proprietary databases.</para>
-<itemizedlist>
-<para>Type names</para>
-<listitem>
-<para><emphasis>jdbc-ansi</emphasis> - declares support for most SQL constructs supported by Teiid, except for row limit/offset and EXCEPT/INTERCECT. Translates source SQL into ANSI compliant syntax. This translator should be used when another more specific type is not available.</para>
-</listitem>
-<listitem>
-<para><emphasis>jdbc-simple</emphasis> - same as jdbc-ansi, except disables support for function, UNION, and aggregate pushdown.</para>
-</listitem>
-<listitem>
-<para><emphasis>db2</emphasis> - for use with DB2 8 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>derby</emphasis> - for use with Derby 10.1 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>h2</emphasis> - for use with H2 version 1.1 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>hsql</emphasis> - for use with HSQLDB 1.7 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>informix</emphasis> - for use with any version.</para>
-</listitem>
-<listitem>
-<para><emphasis>metamatrix</emphasis> - for use with MetaMatrix 5.5.0 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>mysql</emphasis>/<emphasis>mysql5</emphasis> - for use with MySQL version 4.x and 5 or later respectively. <note><para>The MySQL Translators expect the database or session to be using ANSI mode. If the database is not using ANSI mode, an initialization query should be used on the pool to set ANSI mode: <programlisting>set SESSION sql_mode = 'ANSI'</programlisting></para></note></para>
-</listitem>
-<listitem>
-<para><emphasis>oracle</emphasis> - for use with Oracle 9i or later. Sequences may be used with the Oracle translator.
-A sequence may be modeled as a table with a name in source of DUAL and columns with the name in source set to <sequencesequence name>.[nextval|currentval].
-You can use a sequence as the default value for insert columns by setting the column to autoincrement and the name in source to <element name>:SEQUENCE=<sequence name>.<sequence value>.</para>
-</listitem>
-<listitem>
-<para><emphasis>postgresql</emphasis> - for use with 8.0 or later clients and 7.1 or later server.</para>
-</listitem>
-<listitem>
-<para><emphasis>sybase</emphasis> - for use with Sybase version 12.5 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>teiid</emphasis> - for use with Teiid 6.0 or later.</para>
-</listitem>
-<listitem>
-<para><emphasis>teradata</emphasis> - for use with Teradata V2R5.1 or later.</para>
-</listitem>
-</itemizedlist>
-<table>
-<title>Execution Properties - shared by all JDBC Translators</title>
-<tgroup cols="3">
-<colspec colwidth=".75*" />
-<colspec colwidth="1.5*" />
-<colspec colwidth=".5*" />
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>DatabaseTimeZone</entry>
-<entry>The time zone of the database. Used when fetchings date, time, or timestamp values.</entry>
-<entry>The system default time zone</entry>
-</row>
-<row>
-<entry>DatabaseVersion</entry>
-<entry>The specific database version. Used to further tune pushdown support.</entry>
-<entry>The base supported version</entry>
-</row>
-<row>
-<entry>TrimStrings</entry>
-<entry>true to trim trailing whitespace from fixed length character strings. Note that Teiid only has a string, or varchar, type that treats trailing whitespace as meaningful.</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>UseBindVariables</entry>
-<entry>true to indicate that PreparedStatements should be used and that literal values in the source query should be replace with bind variables. If false only LOB values will trigger the use of PreparedStatements.</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>UseCommentsInSourceQuery</entry>
-<entry>This will embed a /*comment*/ leading comment with session/request id in source SQL query for informational purposes</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>MaxPreparedInsertBatchSize</entry>
-<entry>The max size of a prepared insert batch.</entry>
-<entry>2048</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<table>
-<title>Importer Properties - shared by all JDBC Translators</title>
-<tgroup cols="3">
-<colspec colwidth=".75*" />
-<colspec colwidth="1.5*" />
-<colspec colwidth=".3*" />
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>catalog</entry>
-<entry>See DatabaseMetaData.getTables<footnote label="1" id="dbmd"><para>Full JavaDoc for <ulink url="http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html">DatabaseMetaData</ulink></para></footnote></entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>schemaPattern</entry>
-<entry>See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>tableNamePattern</entry>
-<entry>See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>procedurePatternName</entry>
-<entry>See DatabaseMetaData.getProcedures<footnoteref linkend="dbmd"/></entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>tableTypes</entry>
-<entry>Comma separated list - without spaces - of imported table types. See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>useFullSchemaName</entry>
-<entry>When false, directs the importer to drop the source catalog/schema from the Teiid object name, so that the Teiid fully qualified name will be in the form of <model name>.<table name> - Note: that this may lead to objects with duplicate names when importing from multiple schemas, which results in an exception</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>importKeys</entry>
-<entry>true to import primary and foriegn keys</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>importIndexes</entry>
-<entry>true to import index/unique key/cardinality information</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>importApproximateIndexes</entry>
-<entry>true to import approximate index information. See DatabaseMetaData.getIndexInfo<footnoteref linkend="dbmd"/></entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>importProcedures</entry>
-<entry>true to import procedures and procedure columns - Note that it is not always possible to import procedure result set columns due to database limitations. It is also not currently possible to import overloaded procedures.</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>widenUnsignedTypes</entry>
-<entry>true to convert unsigned types to the next widest type. For example SQL Server reports tinyint as an unsigned type. With this option enabled, tinyint would be imported as a short instead of a byte.</entry>
-<entry>true</entry>
-</row>
-<row>
-<entry>quoteNameInSource</entry>
-<entry>false will override the default and direct Teiid to create source queries using unquoted identifiers.</entry>
-<entry>true</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<warning>
-<para>The default import settings will crawl all available metadata. This import process is time consuming and full metadata import is not needed in most situations. Most commonly you'll want to limit import by schemaPattern and tableTypes.</para></warning>
-<para>Example importer settings to only import tables and views from my-schema.<programlisting><![CDATA[...
-<property name="importer.tableTypes" value="TABLE,VIEW"/>
-<property name="importer.schemaPattern" value="my-schema"/>
-...]]></programlisting></para>
-<section><title>Usage</title>
-<para>Usage of a JDBC source is straight-forward. Using Teiid SQL, the source ma be queried as if the tables and procedures were local to the Teiid system.
-</para>
-</section>
-</section>
-<section>
-<title>LDAP Translator</title>
-<para>The LDAP translator, known by the type name <emphasis>ldap</emphasis>, exposes an LDAP directory tree relationally with pusdown support for filtering via criteria. This is typically coupled with the LDAP resource adapter.</para>
-<table>
-<title>Execution Properties</title>
-<tgroup cols="3">
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>SearchDerfaultBaseDN</entry>
-<entry>Default Base DN for LDAP Searches</entry>
-<entry>null</entry>
-</row>
-<row>
-<entry>SearchDefaultScope</entry>
-<entry>Default Scope for LDAP Searches. Can be one of SUBTREE_SCOPE, OBJECT_SCOPE, ONELEVEL_SCOPE.</entry>
-<entry>ONELEVEL_SCOPE</entry>
-</row>
-<row>
-<entry>RestrictToObjectClass</entry>
-<entry>Restrict Searches to objectClass named in the Name field for a table</entry>
-<entry>false</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-</section>
-<section>
-<title>Loopback Translator</title>
-<para>The Loopback translator, known by the type name <emphasis>loopback</emphasis>, provides a quick testing solution. It supports all SQL constructs and returns default results, with configurable behavior.</para>
-<table>
-<title>Execution Properties</title>
-<tgroup cols="3">
-<colspec colwidth=".75*" />
-<colspec colwidth="1.5*" />
-<colspec colwidth=".5*" />
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>ThrowError</entry>
-<entry>true to always throw an error</entry>
-<entry>false</entry>
-</row>
-<row>
-<entry>RowCount</entry>
-<entry>Rows returned for non-update queries.</entry>
-<entry>1</entry>
-</row>
-<row>
-<entry>WaitTime</entry>
-<entry>Wait randomly up to this number of milliseconds with each sourc query.</entry>
-<entry>0</entry>
-</row>
-<row>
-<entry>PollIntervalInMilli</entry>
-<entry>if positive results will be "asynchronusly" returned - that is a DataNotAvailableException will be thrown initially and the engine will wait the poll interval before polling for the results.</entry>
-<entry>-1</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<para>There are no import settings for the Loopback translator; it also does not provide metadata - it should be used as a testing stub.</para>
-</section>
-<section>
-<title>Salesforce Translator</title>
-<para>The Salesforce translator, known by the type name <emphasis>salesforce</emphasis> supports the SELECT, DELETE, INSERT and UPDATE operations against a Salesforce.com account. It is designed for use with the Teiid Salesforce resource adapter.</para>
-<table>
-<title>Execution Properties</title>
-<tgroup cols="3">
-<colspec colwidth=".75*" />
-<colspec colwidth="1.5*" />
-<colspec colwidth=".5*" />
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>ModelAuditFeilds</entry>
-<entry>Audit Model Fields</entry>
-<entry>false</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<para>The Salesforce translator can import metadata, but does not currently have import settings.</para>
-<section>
-<title>Usage</title>
-<section>
-<title>SQL Processing</title>
-<para>Salesforce does not provide the same set of
- functionality as a relational database. For example, Salesforce does
- not support arbitrary joins between tables. However, working in
- combination with the Teiid Query Planner, the Salesforce
- connector
- supports nearly all of the SQL syntax supported by the
- Teiid.
+ <title>Translators</title>
+
+ <section>
+ <title>Introduction to the Teiid Connector Architecture</title>
+ <para>
+ The Teiid Connector Architecture (TCA) provides Teiid with a robust mechanism
+ for integrating with external systems. The TCA defines a common client interface
+ between Teiid and an external system that includes metadata as to what SQL
+ constructs are supported for pushdown and the ability to import metadata from
+ the external system.
</para>
- <para>The Salesforce Connector executes SQL commands by “pushing
- down” the command to Salesforce whenever possible, based on the
- supported capabilities. Teiid will automatically provide
- additional database functionality when the Salesforce Connector does
- not explicitly provide support for a given SQL construct. In these
- cases, the SQL construct cannot be “pushed down” to the data source,
- so it will be evaluated in Teiid, in order to ensure that the
- operation is performed.
+
+ <para>
+ A Translator is the heart of the TCA and acts as the bridge logic between Teiid
+ and an external system, which is most commonly accessed through a JCA resource
+ adapter. Refer to the Teiid Developers Guide for details on developing custom
+ Translators and JCA resource adapters for use with Teiid.
</para>
- <para>In cases where certain SQL capabilities cannot be pushed down
- to Salesforce, Teiid will push down the capabilities that are
- supported, and fetch a set of data from Salesforce. Then, Teiid
- will evaluate the additional capabilities, creating a subset of the
- original data set. Finally, Teiid will pass the result to the
- client.
- </para>
+
+ <note>
+ <para>
+ The TCA is not the same as the JCA, the JavaEE Connector Architecture, although
+ the TCA is designed for use with JCA resource adapters.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ The import capabilities of Teiid Translators is currently only used in
+ <link linkend="dynamic_vdbs">dynamic VDBs</link> and not by the Teiid Designer.
+ </para>
+ </note>
+
+ </section>
- <programlisting><![CDATA[SELECT sum(Reports) FROM Supervisor where Division = 'customer support';]]></programlisting>
- <para>Neither Salesforce nor the Salesforce Connector support
- the sum() scalar function, but they do support CompareCriteriaEquals,
- so the query that is passed to Salesforce by the connector will be
- transformed to this query.
+ <section>
+ <title>Translators</title>
+ <para>
+ A Translator is typically paired with a particular JCA resource adapter. In
+ instances where pooling, environment dependent configuration management, advanced
+ security handling, etc. are not needed, then a JCA resource adapter is not needed.
+ The configuration of JCA ConnectionFactories for needed resource adapters is not
+ part of this guide, please see the Teiid Administrator Guide and the kit examples
+ for configuring resource adapters for use in JBossAS.
</para>
- <programlisting><![CDATA[SELECT Reports FROM Supervisor where Division = 'customer support';]]></programlisting>
- <para>The sum() scalar function will be applied by the Teiid
- Query Engine to the result set returned by the connector.
+
+ <para>
+ Translators can have a number of configurable properties. These are broken down
+ into execution properties, which determine aspects of how data is retrieved, and
+ import settings, which determine what metadata is read for import.
</para>
- <para>In some cases multiple calls to the Salesforce application
- will be made to support the SQL passed to the connector.
- </para>
- <programlisting><![CDATA[DELETE From Case WHERE Status = 'Closed';]]></programlisting>
- <para>The API in Salesforce to delete objects only supports
- deleting by ID. In order to accomplish this the Salesforce connector
- will first execute a query to get the IDs of the correct objects, and
- then delete those objects. So the above DELETE command will result in
- the following two commands.
- </para>
- <programlisting><![CDATA[SELECT ID From Case WHERE Status = 'Closed';
-DELETE From Case where ID IN (<result of query>);*]]></programlisting>
- <para>*The Salesforce API DELETE call is not expressed in SQL, but
- the above is an SQL equivalent expression.
- </para>
- <para>It's useful to be aware of unsupported capabilities, in
- order
- to avoid fetching large data sets from Salesforce and making you
- queries as performant as possible. See all <link linkend="sf_supported">Supported Capabilities</link>.
- </para>
- </section>
- <section>
- <title>Selecting from Multi-Select Picklists</title>
+
<para>
- A multi-select picklist is a field type in Salesforce that can
- contain multiple values in a single field. Query criteria operators
- for fields of this type in SOQL are limited to EQ, NE, includes and
- excludes. The full Salesforce documentation for selecting from
- mullti-select picklists can be found at the following link.
- <ulink
- url="http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic...">Querying Mulit-select Picklists
- </ulink>
+ The execution properties for a translator typically have reasonable defaults. For
+ specific translator types, e.g. the Derby translator, base execution properties are
+ already tuned to match the source. In most cases the user will not need to adjust
+ their values.
</para>
- <para>Teiid SQL does not support the includes or
- excludes operators, but the Salesforce connector provides user
- defined function definitions for these operators that provided
- equivalent functionality for fields of type multi-select. The
- definition for the functions is:
- </para>
- <programlisting><![CDATA[boolean includes(Column column, String param)
-boolean excludes(Column column, String param)]]></programlisting>
- <para>For example, take a single multi-select picklist column
- called Status that contains all of these values.
- </para>
- <itemizedlist mark='opencircle'>
- <listitem>
+
+ <table>
+ <title>Base Execution Properties - shared by all translators</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Immutable</entry>
+ <entry>Set to true to indicate that the source never changes.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>RequiresCriteria</entry>
+ <entry>Set to true to indicate that source SELECT/UPDATE/DELETE queries require a where clause.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>SupportsOrderBy</entry>
+ <entry>Set to true to indicate that the ORDER BY clause is supported.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>SupportsOuterJoins</entry>
+ <entry>Set to true to indicate that OUTER JOINs are supported.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>SupportsFullOuterJoins</entry>
+ <entry>If outer joins are supported, true indicates that FULL OUTER JOINs are supported.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>SupportsInnerJoins</entry>
+ <entry>Set to true to indicate that INNER JOINs are supported.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>SupportedJoinCriteria</entry>
+ <entry>If joins are supported, defines what criteria may be used as the join criteria. May be one of (ANY, THETA, EQUI, or KEY).</entry>
+ <entry>ANY</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>
+ Only a subset of the metadata as to what SQL constructs the source supports
+ can be set through execution properties. If more control is needed, please
+ consult the Teiid Developers Guide.
+ </para>
+ </note>
+
+ <para>There are no base importer settings.</para>
+
+ <section>
+ <title>File Translator</title>
+ <para>
+ The file translator, known by the type name <emphasis>file</emphasis>, exposes
+ stored procedures to leverage file system resources exposed by the file resource
+ adapter. It will commonly be used with the <link linkend="texttable">TEXTTABLE</link>
+ or <link linkend="xmltable">XMLTABLE</link> table functions to use CSV or XML
+ formated data.
+ </para>
+
+ <table>
+ <title>Execution Properties</title>
+ <tgroup cols="3">
+ <colspec colwidth="1*" />
+ <colspec colwidth="4*" />
+ <colspec colwidth="1*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Encoding</entry>
+ <entry>The encoding that should be used for CLOBs returned by the getTextFiles procedure</entry>
+ <entry>The system default encoding</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>There are file importer settings, but it does provide metadata for dynamic vdbs.</para>
+
+ <section>
+ <title>Usage</title>
<para>
- current
+ Retrieve all files as BLOBs with the given extension at the given path.
</para>
- </listitem>
- <listitem>
+
+ <programlisting>call getFiles('path/*.ext')</programlisting>
+
<para>
- working
+ If the extension pattern is not specified and the path is a directory,
+ then all files in the directory will be returned. If the path or filename
+ doesn't exist, then no results will be returned.
</para>
- </listitem>
- <listitem>
+
<para>
- critical
+ Retrieve all files as CLOBs with the given extension at the given path.
</para>
- </listitem>
- </itemizedlist>
- <para>For that column, all of the below are valid queries:</para>
- <programlisting><![CDATA[SELECT * FROM Issue WHERE true = includes (Status, 'current, working' );
-SELECT * FROM Issue WHERE true = excludes (Status, 'current, working' );
-SELECT * FROM Issue WHERE true = includes (Status, 'current;working, critical' );]]></programlisting>
- <para>EQ and NE criteria will pass to Salesforce as supplied. For
- example, these queries will not be modified by the connector.
+ <programlisting>call getTextFiles('path/*.ext')</programlisting>
+
+ <para>
+ Save the CLOB, BLOB, or XML file to given path
+ </para>
+ <programlisting>call saveFile('path', value)</programlisting>
+
+ <para>
+ See the database metadata for full descriptions of the getFiles,
+ getTextFiles, and saveFile procedures.
+ </para>
+ </section>
+
+ </section>
+
+ <section>
+ <title>JDBC Translator</title>
+ <para>
+ The JDBC translator bridges between SQL semantic and data type difference
+ between Teiid and a target RDBMS. Teiid has a range of specific translators
+ that target the most popular open source and proprietary databases.
+ </para>
+
+ <itemizedlist>
+ <title>Type names:</title>
+ <listitem>
+ <para>
+ <emphasis>jdbc-ansi</emphasis> - declares support for most SQL
+ constructs supported by Teiid, except for row limit/offset and
+ EXCEPT/INTERCECT. Translates source SQL into ANSI compliant syntax.
+ This translator should be used when another more specific type is
+ not available.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>jdbc-simple</emphasis> - same as jdbc-ansi, except disables
+ support for function, UNION, and aggregate pushdown.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>db2</emphasis> - for use with DB2 8 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>derby</emphasis> - for use with Derby 10.1 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>h2</emphasis> - for use with H2 version 1.1 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>hsql</emphasis> - for use with HSQLDB 1.7 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>informix</emphasis> - for use with any version.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>metamatrix</emphasis> - for use with MetaMatrix 5.5.0 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>mysql</emphasis>/<emphasis>mysql5</emphasis> - for use with
+ MySQL version 4.x and 5 or later respectively.
+ </para>
+ <para>
+ The MySQL Translators expect the database or session to be using ANSI
+ mode. If the database is not using ANSI mode, an initialization query
+ should be used on the pool to set ANSI mode:
+ </para>
+ <programlisting>set SESSION sql_mode = 'ANSI'</programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>oracle</emphasis> - for use with Oracle 9i or later.
+ Sequences may be used with the Oracle translator. A sequence may be
+ modeled as a table with a name in source of DUAL and columns with the
+ name in source set to <code><sequencesequence name>.[nextval|currentval].</code>
+ You can use a sequence as the default value for insert columns by
+ setting the column to autoincrement and the name in source to
+ <code><element name>:SEQUENCE=<sequence name>.<sequence value></code>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>postgresql</emphasis> - for use with 8.0 or later clients
+ and 7.1 or later server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>sybase</emphasis> - for use with Sybase version 12.5 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>teiid</emphasis> - for use with Teiid 6.0 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>teradata</emphasis> - for use with Teradata V2R5.1 or later.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <table>
+ <title>Execution Properties - shared by all JDBC Translators</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>DatabaseTimeZone</entry>
+ <entry>The time zone of the database. Used when fetchings date, time, or timestamp values.</entry>
+ <entry>The system default time zone</entry>
+ </row>
+ <row>
+ <entry>DatabaseVersion</entry>
+ <entry>The specific database version. Used to further tune pushdown support.</entry>
+ <entry>The base supported version</entry>
+ </row>
+ <row>
+ <entry>TrimStrings</entry>
+ <entry>true to trim trailing whitespace from fixed length character strings. Note that Teiid only has a string, or varchar, type that treats trailing whitespace as meaningful.</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>UseBindVariables</entry>
+ <entry>true to indicate that PreparedStatements should be used and that literal values in the source query should be replace with bind variables. If false only LOB values will trigger the use of PreparedStatements.</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>UseCommentsInSourceQuery</entry>
+ <entry>This will embed a /*comment*/ leading comment with session/request id in source SQL query for informational purposes</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>MaxPreparedInsertBatchSize</entry>
+ <entry>The max size of a prepared insert batch.</entry>
+ <entry>2048</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Importer Properties - shared by all JDBC Translators</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>catalog</entry>
+ <entry>See DatabaseMetaData.getTables<footnote label="1" id="dbmd"><para>Full JavaDoc for <ulink url="http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html">DatabaseMetaData</ulink></para></footnote></entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>schemaPattern</entry>
+ <entry>See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>tableNamePattern</entry>
+ <entry>See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>procedurePatternName</entry>
+ <entry>See DatabaseMetaData.getProcedures<footnoteref linkend="dbmd"/></entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>tableTypes</entry>
+ <entry>Comma separated list - without spaces - of imported table types. See DatabaseMetaData.getTables<footnoteref linkend="dbmd"/></entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>useFullSchemaName</entry>
+ <entry>When false, directs the importer to drop the source catalog/schema from the Teiid object name, so that the Teiid fully qualified name will be in the form of <model name>.<table name> - Note: that this may lead to objects with duplicate names when importing from multiple schemas, which results in an exception</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>importKeys</entry>
+ <entry>true to import primary and foriegn keys</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>importIndexes</entry>
+ <entry>true to import index/unique key/cardinality information</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>importApproximateIndexes</entry>
+ <entry>true to import approximate index information. See DatabaseMetaData.getIndexInfo<footnoteref linkend="dbmd"/></entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>importProcedures</entry>
+ <entry>true to import procedures and procedure columns - Note that it is not always possible to import procedure result set columns due to database limitations. It is also not currently possible to import overloaded procedures.</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>widenUnsignedTypes</entry>
+ <entry>true to convert unsigned types to the next widest type. For example SQL Server reports tinyint as an unsigned type. With this option enabled, tinyint would be imported as a short instead of a byte.</entry>
+ <entry>true</entry>
+ </row>
+ <row>
+ <entry>quoteNameInSource</entry>
+ <entry>false will override the default and direct Teiid to create source queries using unquoted identifiers.</entry>
+ <entry>true</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <warning>
+ <para>
+ The default import settings will crawl all available metadata. This import
+ process is time consuming and full metadata import is not needed in most
+ situations. Most commonly you'll want to limit import by schemaPattern
+ and tableTypes.
+ </para>
+ </warning>
+
+ <para>
+ Example importer settings to only import tables and views from my-schema.
</para>
- <programlisting><![CDATA[SELECT * FROM Issue WHERE Status = 'current';
-SELECT * FROM Issue WHERE Status = 'current;critical';
-SELECT * FROM Issue WHERE Status != 'current;working';]]></programlisting>
- </section>
+ <programlisting language="XML" role="XML"><![CDATA[...
+<property name="importer.tableTypes" value="TABLE,VIEW"/>
+<property name="importer.schemaPattern" value="my-schema"/>
+...]]></programlisting>
+
+ <section>
+ <title>Usage</title>
+ <para>
+ Usage of a JDBC source is straight-forward. Using Teiid SQL, the source may be
+ queried as if the tables and procedures were local to the Teiid system.
+ </para>
+ </section>
+
+ </section>
+
<section>
- <title>Selecting All Objects</title>
+ <title>LDAP Translator</title>
<para>
- The Salesforce connector supports the calling the queryAll operation
- from the Salesforce API. The queryAll operation is equivalent
- to the query operation with the exception that it returns data about
- <emphasis role="strong">all current and deleted</emphasis>
- objects in the system.
+ The LDAP translator, known by the type name <emphasis>ldap</emphasis>, exposes an
+ LDAP directory tree relationally with pushdown support for filtering via criteria.
+ This is typically coupled with the LDAP resource adapter.
</para>
- <para>The connector determines if it will call the
- query or queryAll operation via reference to the
- isDeleted property present on each Salesforce object,
- and modeled as a column on each table generated by
- the importer. By default this value is set to
- False when the model is generated and thus the connector calls
- query. Users are free to change the value in the model to True,
- changing the default behavior of the connector to be queryAll.
+
+ <table>
+ <title>Execution Properties</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>SearchDerfaultBaseDN</entry>
+ <entry>Default Base DN for LDAP Searches</entry>
+ <entry>null</entry>
+ </row>
+ <row>
+ <entry>SearchDefaultScope</entry>
+ <entry>Default Scope for LDAP Searches. Can be one of SUBTREE_SCOPE, OBJECT_SCOPE, ONELEVEL_SCOPE.</entry>
+ <entry>ONELEVEL_SCOPE</entry>
+ </row>
+ <row>
+ <entry>RestrictToObjectClass</entry>
+ <entry>Restrict Searches to objectClass named in the Name field for a table</entry>
+ <entry>false</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Loopback Translator</title>
+ <para>
+ The Loopback translator, known by the type name <emphasis>loopback</emphasis>,
+ provides a quick testing solution. It supports all SQL constructs and returns
+ default results, with configurable behavior.
</para>
- <para>The behavior is different if isDeleted is used as a parameter
- in the query. If the isDeleted column is used as a parameter
- in the query, and the value is 'true' the connector will call queryAll.
+
+ <table>
+ <title>Execution Properties</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>ThrowError</entry>
+ <entry>true to always throw an error</entry>
+ <entry>false</entry>
+ </row>
+ <row>
+ <entry>RowCount</entry>
+ <entry>Rows returned for non-update queries.</entry>
+ <entry>1</entry>
+ </row>
+ <row>
+ <entry>WaitTime</entry>
+ <entry>Wait randomly up to this number of milliseconds with each sourc query.</entry>
+ <entry>0</entry>
+ </row>
+ <row>
+ <entry>PollIntervalInMilli</entry>
+ <entry>if positive results will be "asynchronously" returned - that is a DataNotAvailableException will be thrown initially and the engine will wait the poll interval before polling for the results.</entry>
+ <entry>-1</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ There are no import settings for the Loopback translator; it also does not
+ provide metadata - it should be used as a testing stub.
</para>
- <programlisting><![CDATA[select * from Contact where isDeleted = true;]]></programlisting>
- <para>If the isDeleted column is used as a parameter in the query,
- and the value is 'false' the connector perform the default behavior
- will call query.
- </para>
- <programlisting><![CDATA[
- select * from Contact where isDeleted = false;
- ]]>
- </programlisting>
+
</section>
+
<section>
- <title>Selecting Updated Objects</title>
- <para>If the option is selected when importing metadata from
- Salesforce, a GetUpdated procedure is generated in the model with
- the following sturcture:
+ <title>Salesforce Translator</title>
+ <para>
+ The Salesforce translator, known by the type name <emphasis>salesforce</emphasis>
+ supports the SELECT, DELETE, INSERT and UPDATE operations against a Salesforce.com
+ account. It is designed for use with the Teiid Salesforce resource adapter.
</para>
- <programlisting><![CDATA[GetUpdated (ObjectName IN string,
+
+ <table>
+ <title>Execution Properties</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>ModelAuditFeilds</entry>
+ <entry>Audit Model Fields</entry>
+ <entry>false</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The Salesforce translator can import metadata, but does not currently
+ have import settings.
+ </para>
+
+ <section>
+ <title>Usage</title>
+ <section>
+ <title>SQL Processing</title>
+ <para>
+ Salesforce does not provide the same set of
+ functionality as a relational database. For example, Salesforce does
+ not support arbitrary joins between tables. However, working in
+ combination with the Teiid Query Planner, the Salesforce
+ connector supports nearly all of the SQL syntax supported by the
+ Teiid.
+ </para>
+ <para>
+ The Salesforce Connector executes SQL commands by “pushing
+ down” the command to Salesforce whenever possible, based on the
+ supported capabilities. Teiid will automatically provide
+ additional database functionality when the Salesforce Connector does
+ not explicitly provide support for a given SQL construct. In these
+ cases, the SQL construct cannot be “pushed down” to the data source,
+ so it will be evaluated in Teiid, in order to ensure that the
+ operation is performed.
+ </para>
+ <para>
+ In cases where certain SQL capabilities cannot be pushed down
+ to Salesforce, Teiid will push down the capabilities that are
+ supported, and fetch a set of data from Salesforce. Then, Teiid
+ will evaluate the additional capabilities, creating a subset of the
+ original data set. Finally, Teiid will pass the result to the
+ client.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT sum(Reports) FROM Supervisor where Division = 'customer support';]]></programlisting>
+
+ <para>
+ Neither Salesforce nor the Salesforce Connector support
+ the sum() scalar function, but they do support CompareCriteriaEquals,
+ so the query that is passed to Salesforce by the connector will be
+ transformed to this query.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT Reports FROM Supervisor where Division = 'customer support';]]></programlisting>
+
+ <para>
+ The sum() scalar function will be applied by the Teiid Query Engine to
+ the result set returned by the connector.
+ </para>
+
+ <para>
+ In some cases multiple calls to the Salesforce application
+ will be made to support the SQL passed to the connector.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[DELETE From Case WHERE Status = 'Closed';]]></programlisting>
+
+ <para>
+ The API in Salesforce to delete objects only supports
+ deleting by ID. In order to accomplish this the Salesforce connector
+ will first execute a query to get the IDs of the correct objects, and
+ then delete those objects. So the above DELETE command will result in
+ the following two commands.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT ID From Case WHERE Status = 'Closed';
+DELETE From Case where ID IN (<result of query>);]]></programlisting>
+
+ <para>
+ *The Salesforce API DELETE call is not expressed in SQL, but
+ the above is an SQL equivalent expression.
+ </para>
+
+ <para>
+ It's useful to be aware of unsupported capabilities, in order
+ to avoid fetching large data sets from Salesforce and making you
+ queries as performant as possible.
+ See all <link linkend="sf_supported">Supported Capabilities</link>.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Selecting from Multi-Select Picklists</title>
+ <para>
+ A multi-select picklist is a field type in Salesforce that can
+ contain multiple values in a single field. Query criteria operators
+ for fields of this type in SOQL are limited to EQ, NE, includes and
+ excludes. The full Salesforce documentation for selecting from
+ mullti-select picklists can be found at the following link.
+ <ulink url="http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic...">Querying Mulit-select Picklists</ulink>
+ </para>
+
+ <para>
+ Teiid SQL does not support the includes or
+ excludes operators, but the Salesforce connector provides user
+ defined function definitions for these operators that provided
+ equivalent functionality for fields of type multi-select. The
+ definition for the functions is:
+ </para>
+
+ <programlisting>boolean includes(Column column, String param)
+boolean excludes(Column column, String param)</programlisting>
+
+ <para>
+ For example, take a single multi-select picklist column
+ called Status that contains all of these values.
+ </para>
+
+ <itemizedlist mark='opencircle'>
+ <listitem>
+ <para>current</para>
+ </listitem>
+ <listitem>
+ <para>working</para>
+ </listitem>
+ <listitem>
+ <para>critical</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ For that column, all of the below are valid queries:
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT * FROM Issue WHERE true = includes (Status, 'current, working' );
+SELECT * FROM Issue WHERE true = excludes (Status, 'current, working' );
+SELECT * FROM Issue WHERE true = includes (Status, 'current;working, critical' );]]></programlisting>
+
+ <para>
+ EQ and NE criteria will pass to Salesforce as supplied. For
+ example, these queries will not be modified by the connector.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT * FROM Issue WHERE Status = 'current';
+SELECT * FROM Issue WHERE Status = 'current;critical';
+SELECT * FROM Issue WHERE Status != 'current;working';]]></programlisting>
+
+ </section>
+ <section>
+ <title>Selecting All Objects</title>
+ <para>
+ The Salesforce connector supports the calling the queryAll operation
+ from the Salesforce API. The queryAll operation is equivalent
+ to the query operation with the exception that it returns data about
+ <emphasis role="strong">all current and deleted</emphasis>
+ objects in the system.
+ </para>
+ <para>
+ The connector determines if it will call the
+ query or queryAll operation via reference to the
+ isDeleted property present on each Salesforce object,
+ and modeled as a column on each table generated by
+ the importer. By default this value is set to
+ False when the model is generated and thus the connector calls
+ query. Users are free to change the value in the model to True,
+ changing the default behavior of the connector to be queryAll.
+ </para>
+ <para>
+ The behavior is different if isDeleted is used as a parameter
+ in the query. If the isDeleted column is used as a parameter
+ in the query, and the value is 'true' the connector will call queryAll.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[select * from Contact where isDeleted = true;</programlisting>
+
+ <para>
+ If the isDeleted column is used as a parameter in the query,
+ and the value is 'false' the connector perform the default behavior
+ will call query.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[select * from Contact where isDeleted = false;]]></programlisting>
+ </section>
+ <section>
+ <title>Selecting Updated Objects</title>
+ <para>
+ If the option is selected when importing metadata from
+ Salesforce, a GetUpdated procedure is generated in the model with
+ the following structure:
+ </para>
+
+ <programlisting language="SQL"><![CDATA[GetUpdated (ObjectName IN string,
StartDate IN datetime,
EndDate IN datetime,
LatestDateCovered OUT datetime)
returns
ID string]]></programlisting>
- <para>
- See the description of the
- <ulink
- url="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_...">GetUpdated
- </ulink>
- operation in the Salesforce documentation for usage details.
- </para>
- </section>
- <section>
- <title>Selecting Deleted Objects</title>
- <para>If the option is selected when importing metadata from
- Salesforce, a GetDeleted procedure is generated in the model with
- the following sturcture:
- </para>
- <programlisting><![CDATA[GetDeleted (ObjectName IN string,
+
+ <para>
+ See the description of the
+ <ulink url="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_...">GetUpdated</ulink>
+ operation in the Salesforce documentation for usage details.
+ </para>
+
+ </section>
+ <section>
+ <title>Selecting Deleted Objects</title>
+ <para>
+ If the option is selected when importing metadata from
+ Salesforce, a GetDeleted procedure is generated in the model with
+ the following structure:
+ </para>
+
+ <programlisting language="SQL"><![CDATA[GetDeleted (ObjectName IN string,
StartDate IN datetime,
EndDate IN datetime,
EarliestDateAvailable OUT datetime,
@@ -570,174 +781,257 @@
returns
ID string,
DeletedDate datetime]]></programlisting>
- <para>
- See the description of the
- <ulink
- url="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_...">GetDeleted
- </ulink>
- operation in the Salesforce documentation for usage details.
- </para>
- </section>
- <section>
- <title>Relationship Queries</title>
- <para>Salesforce does not support joins like a relational database,
- but it does have support for queries that include parent-to-child
- or child-to-parent relationships between objects. These are termed
- Relationship Queries. The SalesForce connector supports Relationship
- Queries through Outer Join syntax.
- </para>
- <programlisting><![CDATA[SELECT Account.name, Contact.Name from Contact LEFT OUTER JOIN Account
+
+ <para>
+ See the description of the
+ <ulink url="http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_...">GetDeleted</ulink>
+ operation in the Salesforce documentation for usage details.
+ </para>
+
+ </section>
+ <section>
+ <title>Relationship Queries</title>
+ <para>
+ Salesforce does not support joins like a relational database,
+ but it does have support for queries that include parent-to-child
+ or child-to-parent relationships between objects. These are termed
+ Relationship Queries. The SalesForce connector supports Relationship
+ Queries through Outer Join syntax.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT Account.name, Contact.Name from Contact LEFT OUTER JOIN Account
on Contact.Accountid = Account.id]]></programlisting>
- <para>This query shows the correct syntax to query a SalesForce model with
- to produce a relationship query from child to parent. It resolves to the
- following query to SalesForce.
- </para>
- <programlisting><![CDATA[SELECT Contact.Account.Name, Contact.Name FROM Contact]]>
- </programlisting>
- <programlisting><![CDATA[select Contact.Name, Account.Name from Account Left outer Join Contact
+
+ <para>
+ This query shows the correct syntax to query a SalesForce model with
+ to produce a relationship query from child to parent. It resolves to the
+ following query to SalesForce.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT Contact.Account.Name, Contact.Name FROM Contact]]></programlisting>
+
+ <programlisting language="SQL"><![CDATA[select Contact.Name, Account.Name from Account Left outer Join Contact
on Contact.Accountid = Account.id]]></programlisting>
- <para>This query shows the correct syntax to query a SalesForce model with
- to produce a relationship query from parent to child. It resolves to the
- following query to SalesForce.
- </para>
- <programlisting><![CDATA[SELECT Account.Name, (SELECT Contact.Name FROM
+
+ <para>
+ This query shows the correct syntax to query a SalesForce model with
+ to produce a relationship query from parent to child. It resolves to the
+ following query to SalesForce.
+ </para>
+
+ <programlisting language="SQL"><![CDATA[SELECT Account.Name, (SELECT Contact.Name FROM
Account.Contacts) FROM Account]]></programlisting>
+
+ <para>
+ See the description of the
+ <ulink url="http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic...">Relationship Queries</ulink>
+ operation in the SalesForce documentation for limitations.
+ </para>
+ </section>
+
+ <section id="sf_supported">
+ <title>Supported Capabilities</title>
+ <para>
+ The following are the the connector capabilities supported by
+ the Salesforce Connector. These SQL constructs will be pushed down to
+ Salesforce.
+ </para>
+
+ <itemizedlist mark='opencircle'>
+ <listitem>
+ <para>SELECT command</para>
+ </listitem>
+ <listitem>
+ <para>INSERT Command</para>
+ </listitem>
+ <listitem>
+ <para>UPDATE Command</para>
+ </listitem>
+ <listitem>
+ <para>DELETE Command</para>
+ </listitem>
+ <listitem>
+ <para>CompareCriteriaEquals</para>
+ </listitem>
+ <listitem>
+ <para>InCriteria</para>
+ </listitem>
+ <listitem>
+ <para>LikeCriteria - Supported for String fields only.</para>
+ </listitem>
+ <listitem>
+ <para>RowLimit</para>
+ </listitem>
+ <listitem>
+ <para>AggregatesCountStar</para>
+ </listitem>
+ <listitem>
+ <para>NotCriteria</para>
+ </listitem>
+ <listitem>
+ <para>OrCriteria</para>
+ </listitem>
+ <listitem>
+ <para>CompareCriteriaOrdered</para>
+ </listitem>
+ <listitem>
+ <para>OuterJoins with join criteria KEY</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ </section>
+ </section>
+
+ <section>
+ <title>Web Services Translator</title>
+ <para>
+ The Web Services translator, known by the type name <emphasis>ws</emphasis>,
+ exposes stored procedures for calling web services backed by a Teiid WS
+ resource adapter. It will commonly be used with the
+ <link linkend="texttable">TEXTTABLE</link> or
+ <link linkend="xmltable">XMLTABLE</link> table functions to use CSV or XML
+ formated data.
+ </para>
+
+ <table>
+ <title>Execution Properties</title>
+ <tgroup cols="3">
+ <colspec colwidth="3*" />
+ <colspec colwidth="6*" />
+ <colspec colwidth="2*" />
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>DefaultBinding</entry>
+ <entry>The binding that should be used if one is not specified. Can be one of HTTP, SOAP11, or SOAP12</entry>
+ <entry>SOAP12</entry>
+ </row>
+ <row>
+ <entry>DefaultServiceMode</entry>
+ <entry>The default service mode. For SOAP, MESSAGE mode indicates that the request will contain the entire SOAP envelope and not just the contents of the SOAP body. Can be one of MESSAGE or PAYLOAD</entry>
+ <entry>PAYLOAD</entry>
+ </row>
+ <row>
+ <entry>XMLParamName</entry>
+ <entry>Used with the HTTP binding (typically with the GET method) to indicate that the request document should be part of the query string.</entry>
+ <entry>null - unused</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ There are ws importer settings, but it does provide metadata for dynamic VDBs.
+ </para>
+
+ <section>
+ <title>Usage</title>
+ <para>
+ The WS translator exposes low level procedures for accessing web services.
+ See also the ws-weather example in the kit.
+ </para>
+
+ <section>
+ <title>Invoke Procedure</title>
+ <para>
+ Invoke allows for multiple binding, or protocol modes, including
+ HTTP, SOAP11, and SOAP12.
+ </para>
+ <programlisting>Procedure invoke(binding in STRING, action in STRING, request in XML, endpoint in STRING) returns XML</programlisting>
+
+ <para>
+ The binding may be one of null (to use the default) HTTP, SOAP11, or
+ SOAP12. Action with a SOAP binding indicates the SOAPAction value.
+ Action with a HTTP binding indicates the HTTP method (GET, POST, etc.),
+ which defaults to POST.
+ </para>
+
+ <para>
+ A null value for the binding or endpoint will use the default value.
+ The default endpoint is specified in the WS resource adapter
+ configuration. The endpoint URL may be absolute or relative. If it's
+ relative then it will be combined with the default endpoint.
+ </para>
+
+ <para>
+ Since multiple parameters are not required to have values, it is often
+ more clear to call the invoke procedure with named parameter syntax.
+ </para>
+ <programlisting>call invoke(binding=>'HTTP', action=>'GET')</programlisting>
+ <para>The request XML should be a valid XML document or root element.</para>
+ </section>
+
+ <section>
+ <title>InvokeHTTP Procedure</title>
+ <para>
+ <methodname>invokeHttp</methodname> can return the byte contents of an HTTP(S) call.
+ </para>
+ <programlisting>Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, contentType out STRING) returns BLOB</programlisting>
+
+ <para>
+ Action indicates the HTTP method (GET, POST, etc.), which defaults to POST.
+ </para>
+ <para>
+ A null value for endpoint will use the default value. The default endpoint
+ is specified in the WS resource adapter configuration. The endpoint URL may
+ be absolute or relative. If it's relative then it will be combined with the
+ default endpoint.
+ </para>
+ <para>
+ Since multiple parameters are not required to have values, it is often more
+ clear to call the invoke procedure with named parameter syntax.
+ </para>
+ <programlisting>call invokeHttp(action=>'GET')</programlisting>
+
+ <para>
+ The request can be one of SQLXML, STRING, BLOB, or CLOB. The request will be
+ sent as the POST payload in byte form. For STRING/CLOB values this will
+ default to the UTF-8 encoding. To control the byte encoding, see the
+ <link linkend="to_bytes">to_bytes</link> function.
+ </para>
+ </section>
+ </section>
+ </section>
+ </section>
+
+ <section id="dynamic_vdbs">
+ <title>Dynamic VDBs</title>
<para>
- See the description of the
- <ulink
- url="http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic...">Relationship Queries
- </ulink>
- operation in the SalesForce documentation for limitations.
+ Teiid integration is available via a "Dynamic VDB" without the need for Teiid Designer
+ tooling. While this mode of operation does not yet allow for the creation of view
+ layers, the underlying sources can still be queried as if they are a single source. See
+ the kit's "teiid-example/dynamicvdb-*" for working examples.
</para>
- </section>
- <section id="sf_supported">
- <title>Supported Capabilities</title>
- <para>The following are the the connector capabilities supported by
- the Salesforce Connector. These SQL constructs will be pushed down to
- Salesforce.</para>
- <itemizedlist mark='opencircle'>
- <listitem><para>
- SELECT command
- </para></listitem>
- <listitem><para>
- INSERT Command
- </para></listitem>
- <listitem><para>
- UPDATE Command
- </para></listitem>
- <listitem><para>
- DELETE Command
- </para></listitem>
- <listitem><para>
- CompareCriteriaEquals
- </para></listitem>
- <listitem><para>
- InCriteria
- </para></listitem>
- <listitem><para>
- LikeCriteria - Supported for String fields only.
- </para></listitem>
- <listitem><para>
- RowLimit
- </para></listitem>
- <listitem><para>
- AggregatesCountStar
- </para></listitem>
- <listitem><para>
- NotCriteria
- </para></listitem>
- <listitem><para>
- OrCriteria
- </para></listitem>
- <listitem><para>
- CompareCriteriaOrdered
- </para></listitem>
- <listitem><para>
- OuterJoins with join criteria KEY
- </para></listitem>
- </itemizedlist>
- </section>
-</section>
-</section>
-<section>
-<title>Web Services Translator</title>
-<para>The Web Services translator, known by the type name <emphasis>ws</emphasis>, exposes stored procedures for calling web services backed by a Teiid WS resource adapter.
-It will commonly be used with the <link linkend="texttable">TEXTTABLE</link> or <link linkend="xmltable">XMLTABLE</link> table functions to use CSV or XML formated data.</para>
-<table>
-<title>Execution Properties</title>
-<tgroup cols="3">
-<thead>
-<row>
-<entry>Name</entry>
-<entry>Description</entry>
-<entry>Default</entry>
-</row>
-</thead>
-<tbody>
-<row>
-<entry>DefaultBinding</entry>
-<entry>The binding that should be used if one is not specified. Can be one of HTTP, SOAP11, or SOAP12</entry>
-<entry>SOAP12</entry>
-</row>
-<row>
-<entry>DefaultServiceMode</entry>
-<entry>The default service mode. For SOAP, MESSAGE mode indicates that the request will contain the entire SOAP envelope and not just the contents of the SOAP body. Can be one of MESSAGE or PAYLOAD</entry>
-<entry>PAYLOAD</entry>
-</row>
-<row>
-<entry>XMLParamName</entry>
-<entry>Used with the HTTP binding (typically with the GET method) to indicate that the request document should be part of the query string.</entry>
-<entry>null - unused</entry>
-</row>
-</tbody>
-</tgroup>
-</table>
-<para>There are ws importer settings, but it does provide metadata for dynamic vdbs.</para>
-<section><title>Usage</title>
-<para>The WS translator exposes low level procedures for accessing web services. See also the ws-weather example in the kit.</para>
-<section>
-<title>Invoke Procedure</title>
-<para>invoke allows for multiple binding, or protocol modes, including HTTP, SOAP11, and SOAP12.
-<programlisting>Procedure invoke(binding in STRING, action in STRING, request in XML, endpoint in STRING) returns XML</programlisting>
-</para>
-<para>The binding may be one of null (to use the default) HTTP, SOAP11, or SOAP12. Action with a SOAP binding indicates the SOAPAction value. Action with a HTTP binding indicates the HTTP method (GET, POST, etc.), which defaults to POST.</para>
-<para>A null value for the binding or endpoint will use the default value. The default endpoint is specified in the WS resource adapter configuration. The endpoint URL may be absolute or relative. If it's relative then it will be combined with the default endpoint.</para>
-<para>Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax. e.g. <programlisting>call invoke(binding=>'HTTP', action=>'GET')</programlisting></para>
-<para>The request XML should be a valid XML document or root element.</para>
-</section>
-<section>
-<title>InvokeHTTP Procedure</title>
-<para>invokeHttp can return the byte contents of an HTTP(S) call.
-<programlisting>Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, contentType out STRING) returns BLOB</programlisting>
-</para>
-<para>Action indicates the HTTP method (GET, POST, etc.), which defaults to POST.</para>
-<para>A null value for endpoint will use the default value. The default endpoint is specified in the WS resource adapter configuration. The endpoint URL may be absolute or relative. If it's relative then it will be combined with the default endpoint.</para>
-<para>Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax. e.g. <programlisting>call invokeHttp(action=>'GET')</programlisting></para>
-<para>The request can be one of SQLXML, STRING, BLOB, or CLOB. The request will be sent as the POST payload in byte form. For STRING/CLOB values this will default to the UTF-8 encoding. To control the byte encoding, see the <link linkend="to_bytes">to_bytes</link> function.</para>
-</section>
-</section>
-</section>
-</section>
-<section id="dynamic_vdbs">
-<title>Dynamic VDBs</title>
-<para>
-Teiid integration is available via a "Dynamic VDB" without the need for Teiid Designer tooling. While this mode of operation does not yet allow for the creation of view layers, the underlying sources can still be queried as if they are a single source. See the kit's "teiid-example/dynamicvdb-*" for working examples.
-</para>
-<para>
-To build a dynamic vdb, you'll need to create a "<some-name>-vdb.xml" file. The XML file captures information about the VDB, the sources it integrate, and preferences for importing metadata.
-</para>
-<note>
-<para>
-VDB name pattern must adhere to "-vdb.xml" for the Teiid VDB deployer to recognize this file as a dynamic VDB.
-</para>
-</note>
-<para>
-my-vdb.xml: (The vdb-deployer.xml schema for this file is available in the schema folder under the docs with the Teiid distribution.)
-</para>
-<programlisting><![CDATA[<vdb name="${vdb-name}" version=${vdb-version}>
- <property name="UseConnectorMetadata" value="..."/>
+ <para>
+ To build a dynamic VDB, you'll need to create a
+ <filename><replaceable>SOME-NAME</replaceable>-vdb.xml</filename> file. The XML file captures
+ information about the VDB, the sources it integrate, and preferences for importing metadata.
+ </para>
+
+ <note>
+ <para>
+ VDB name pattern must adhere to "-vdb.xml" for the Teiid VDB deployer to
+ recognize this file as a dynamic VDB.
+ </para>
+ </note>
+
+ <para>
+ my-vdb.xml: (The vdb-deployer.xml schema for this file is available in the schema
+ folder under the docs with the Teiid distribution.)
+ </para>
+
+ <programlisting role="XML" language="XML"><![CDATA[<vdb name="${vdb-name}" version="${vdb-version}">
+ <property name="UseConnectorMetadata" value="..." />
+
<!-- define a model fragment for each data source -->
<model name="${model-name}">
@@ -751,68 +1045,238 @@
<!-- create translator instances that override default properties -->
- <translator name="${translator-name}" type="${translator-type}"/>
+ <translator name="${translator-name}" type="${translator-type}" />
- <property name="..." value="..."/>
+ <property name="..." value="..." />
...
</translator>
-</vdb>
-]]></programlisting>
-<section>
-<title>VDB Element</title>
-<itemizedlist>
- <title>Attributes</title>
- <listitem><para><emphasis>name</emphasis> - The name of the VDB. The VDB name referenced through the driver or datasource during the connection time.</para>
- </listitem>
- <listitem><para><emphasis>version</emphasis> - The version of the VDB (should be an positive integer). This determines the deployed directory location (see Name), and provides an explicit versioning mechanism to the VDB name.</para>
- </listitem>
-</itemizedlist>
-<itemizedlist>
- <title>Property Elements</title>
- <listitem><para><emphasis>UseConnectorMetadata</emphasis> - Setting to use connector supplied metadata. Can be "true" or "cached". "true" will obtain metadata once for every launch of Teiid. "cached" will save a file containing the metadata into the <jboss-install>/server/<profile>/data/teiid directory</para>
- </listitem>
-</itemizedlist>
-</section>
-<section>
-<title>Model Element</title>
-<itemizedlist>
- <title>Attributes</title>
- <listitem><para><emphasis>name</emphasis> - The name of the model is used as a top level schema name for all of the metadata imported from the connector. The name should be unique among all Models in the VDB and should not contain the '.' character.</para>
- </listitem>
- <listitem><para><emphasis>version</emphasis> - The version of the VDB (should be an positive integer). This determines the deployed directory location (see Name), and provides an explicit versioning mechanism to the VDB name.</para>
- </listitem>
-</itemizedlist>
-<itemizedlist>
- <title>Source Element</title>
- <listitem><para><emphasis>name</emphasis> - The name of the source to use for this model. This can be any name you like, but will typically be the same as the model name. Having a name different than the model name is only useful in multi-source scenarios.
- </para></listitem>
- <listitem><para><emphasis>translator-name</emphasis> - The name or type of the Teiid Translator to use. Possible values include the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.) and translators defined in the translators section.
- </para></listitem>
- <listitem><para><emphasis>connection-jndi-name</emphasis> - The JNDI name of this source's connection factory. There should be a corresponding "-ds.xml" file that defines the connection factory in the JBoss AS. Check out the deploying vdb dependencies section for info. You also need to deploy these connection factories before you can deploy the vdb.
- </para></listitem>
-</itemizedlist>
-<itemizedlist>
- <title>Property Elements</title>
- <listitem><para><emphasis>importer.<propertyname></emphasis> - Property to be used by the connector importer for the model for purposes importing metadata. See possible property name/values in the Translator specific section. Note that using these properties you can narrow or widen the data elements available for integration.
- </para></listitem>
-</itemizedlist>
-</section>
-<section>
-<title>Translator Element</title>
-<itemizedlist>
- <title>Attributes</title>
- <listitem><para><emphasis>name</emphasis> - The name of the the Translator. Referenced by the source element.</para>
- </listitem>
- <listitem><para><emphasis>type</emphasis> - The base type of the Translator. Can be one of the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.).
- </para>
- </listitem>
-</itemizedlist>
-<itemizedlist>
- <title>Property Elements</title>
- <listitem><para>Set a value that overrides a translator default property. See possible property name/values in the Translator specific section.
- </para></listitem>
-</itemizedlist>
-</section>
-</section>
+</vdb>]]></programlisting>
+
+ <section>
+ <title>VDB Element</title>
+ <itemizedlist>
+ <title>Attributes</title>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>
+ </para>
+ <para>
+ The name of the VDB. The VDB name
+ referenced through the driver or datasource during the connection time.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>version</emphasis>
+ </para>
+ <para>
+ The version of the VDB (should be an
+ positive integer). This determines the deployed directory location
+ (see Name), and provides an explicit versioning mechanism to the VDB
+ name.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <title>Property Elements</title>
+ <listitem>
+ <para>
+ <emphasis>UseConnectorMetadata</emphasis>
+ </para>
+ <para>
+ Setting to use connector
+ supplied metadata. Can be "true" or "cached". "true" will obtain
+ metadata once for every launch of Teiid. "cached" will save a file
+ containing the metadata into the
+ <filename><replaceable>PROFILE</replaceable>/data/teiid</filename> directory
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+
+ <section>
+ <title>Model Element</title>
+ <itemizedlist>
+ <title>Attributes</title>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>
+ </para>
+ <para>
+ The name of the model is used as a
+ top level schema name for all of the metadata imported from the
+ connector. The name should be unique among all Models in the VDB and
+ should not contain the '.' character.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>version</emphasis>
+ </para>
+ <para>
+ The version of the VDB (should be an
+ positive integer). This determines the deployed directory location
+ (see Name), and provides an explicit versioning mechanism to the VDB
+ name.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <title>Source Element</title>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>
+ </para>
+ <para>
+ The name of the source to use for this
+ model. This can be any name you like, but will typically be the same
+ as the model name. Having a name different than the model name is
+ only useful in multi-source scenarios.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>translator-name</emphasis>
+ </para>
+ <para>
+ The name or type of the Teiid Translator to use. Possible values include
+ the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.)
+ and translators defined in the translators section.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>connection-jndi-name</emphasis>
+ </para>
+ <para>
+ The JNDI name of this source's connection factory. There should be a
+ corresponding "-ds.xml" file that defines the connection factory in
+ the JBoss AS. Check out the deploying VDB dependencies section for
+ info. You also need to deploy these connection factories before you
+ can deploy the VDB.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <title>Property Elements</title>
+ <listitem>
+ <para>
+ <emphasis>importer.<propertyname></emphasis>
+ </para>
+ <para>
+ Property to be used by the connector importer for the model for purposes
+ importing metadata. See possible property name/values in the
+ Translator specific section. Note that using these properties you
+ can narrow or widen the data elements available for integration.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title>Translator Element</title>
+ <itemizedlist>
+ <title>Attributes</title>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>
+ </para>
+ <para>
+ The name of the the Translator. Referenced by the source element.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>type</emphasis>
+ </para>
+ <para>
+ The base type of the Translator. Can be one of the built-in types (ws,
+ file, ldap, oracle, sqlserver, db2, derby, etc.).
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <title>Property Elements</title>
+ <listitem>
+ <para>
+ Set a value that overrides a translator default property. See
+ possible property name/values in the Translator specific section.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ </section>
+ <section>
+ <title>Multi-Source Models and VDB</title>
+ <para>
+ When you have multiple instances of data that are using identical schema
+ (horizontal sharding), Teiid can help you aggregate data across all the
+ instances, using "multi-source" models. In this scenario, instead of
+ creating/importing a model for every data source, user needs to define one
+ source model that represents the schema and configure multiple data "sources"
+ underneath it. During runtime, when a query issued against this model, the query
+ engine analyzes the information and gathers the required data from all the
+ sources configured and aggregates the results and provides in a single result set.
+ </para>
+
+ <para>
+ To mark a model as multi-source, the user needs to supply property called
+ <property>supports-multi-source-bindings</property>, in the "vdb.xml" file.
+ Also, the user needs to define multiple sources. Here is code example showing single model with
+ multiple sources defined.
+ </para>
+
+ <programlisting role="XML" language="XML"><![CDATA[<vdb name="vdbname" version="1">
+ <model visible="true" type="PHYSICAL" name="Customers" path="/Test/Customers.xmi">
+ <property name="supports-multi-source-bindings" value="true"/>
+ <source name="chicago"
+ translator-name="oracle" connection-jndi-name="chicago-customers"/>
+ <source name="newyork"
+ translator-name="oracle" connection-jndi-name="newyork-customers"/>
+ <source name="la"
+ translator-name="oracle" connection-jndi-name="la-customers"/>
+ </model>
+</vdb>]]></programlisting>
+
+ <para>
+ In the above example, the VDB defined has single model called <literal>Customers</literal>,
+ that has multiple sources (<literal>chicago</literal>, <literal>newyork</literal>,
+ and <literal>la</literal>) that define different instances of data. Every
+ time a model is marked as "multi-source", the
+ runtime engine adds a additional column called "SOURCE_NAME" to every table in
+ that model. This column maps to the source's name from the XML. In
+ the above XML code that would be <literal>chicago</literal>, <literal>la</literal>,
+ <literal>newyork</literal>. This allows queries like the following:
+ </para>
+
+ <programlisting language="SQL"><![CDATA[select * from table where SOURCE_NAME = 'newyork'
+update table column=value where SOURCE_NAME='chicago'
+delete from table where column = x and SOURCE_NAME='la']]></programlisting>
+
+ <para>
+ Note that when user do not supply the "SOURCE_NAME" in the criteria, it applies
+ to all the sources. Unfortunately Teiid currently does not support INSERT, this
+ planned for future releases. Another useful feature along with this feature is
+ "partial results" to skip unavailable sources if they are down.
+ </para>
+
+ <note>
+ <para>
+ Currently the tooling support for managing the multi-source feature is
+ limited, so if you need to use this feature build the VDB as usual in
+ the Teiid Designer and then edit the "vdb.xml" file in the VDB archive
+ using a Text editor to add the additional sources as defined above.
+ You must deploy a data source for each source defined.
+ </para>
+ </note>
+
+ </section>
+
</chapter>
\ No newline at end of file
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/pom.xml 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>teiid</artifactId>
+ <artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
<version>7.2.0.Alpha2-SNAPSHOT</version>
</parent>
Modified: trunk/engine/src/main/java/org/teiid/cache/Cache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/Cache.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/cache/Cache.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,15 +22,19 @@
package org.teiid.cache;
+import java.util.Set;
+
/**
* Abstraction over cache providers
*/
public interface Cache<K, V> {
- public enum Type {SESSION("Session"), //$NON-NLS-1$
- RESULTSET("ResultSet"), //$NON-NLS-1$
- RESULTSET_BATCHES(RESULTSET, "batches"), //$NON-NLS-1$
- PREPAREDPLAN("PreparaedPlan"); //$NON-NLS-1$
+ public enum Type {
+ MATTABLES("MatTables"), //$NON-NLS-1$
+ MATTABLEUPDATES("MatTableUpdates"), //$NON-NLS-1$
+ RESULTSET("ResultSet"), //$NON-NLS-1$
+ RESULTSET_BATCHES(RESULTSET, "batches"), //$NON-NLS-1$
+ PREPAREDPLAN("PreparaedPlan"); //$NON-NLS-1$
private String location;
@@ -94,4 +98,10 @@
* @return
*/
String getName();
+
+ /**
+ * Return all the keys
+ * @return
+ */
+ Set<K> keys();
}
Modified: trunk/engine/src/main/java/org/teiid/cache/CacheFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/CacheFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/cache/CacheFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -36,4 +36,10 @@
* Destroy the cache factory and any caches underneath.
*/
void destroy();
+
+ /**
+ * Return true if replicated caches are created by this factory
+ * @return
+ */
+ boolean isReplicated();
}
Modified: trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -217,5 +217,10 @@
public String getName() {
return name;
}
+
+ @Override
+ public Set<K> keys() {
+ return map.keySet();
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -49,9 +49,13 @@
@Override
public <K, V> Cache<K, V> get(Type type, CacheConfiguration config) {
if (!destroyed) {
- Cache node = cacheRoot.addChild(type.location());
- return node;
+ return cacheRoot.addChild(type.location());
}
throw new TeiidRuntimeException("Cache system has been shutdown"); //$NON-NLS-1$
}
+
+ @Override
+ public boolean isReplicated() {
+ return false;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,7 +30,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.Streamable;
-import org.teiid.dqp.DQPPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.Expression;
/**
@@ -64,7 +64,7 @@
lob = this.lobReferences.get(id);
}
if (lob == null) {
- throw new TeiidComponentException(DQPPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
}
return lob;
}
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,10 +32,10 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.Streamable;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.Expression;
@@ -259,7 +259,7 @@
public Streamable<?> getLobReference(String id) throws TeiidComponentException {
if (lobManager == null) {
- throw new TeiidComponentException(DQPPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
}
return lobManager.getLobReference(id);
}
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -63,7 +63,7 @@
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.relational.ListNestedSortComparator;
@@ -291,9 +291,9 @@
}
return batch;
} catch(IOException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
} catch (ClassNotFoundException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
} finally {
this.batchManager.compactionLock.readLock().unlock();
}
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -38,7 +38,7 @@
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
/**
@@ -116,7 +116,7 @@
fileAccess.seek(fileOffset - entry.getKey());
return fileAccess.read(b, offSet, length);
} catch (IOException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
} finally {
fileInfo.close();
}
@@ -130,7 +130,7 @@
long used = usedBufferSpace.addAndGet(length);
if (used > maxBufferSpace) {
usedBufferSpace.addAndGet(-length);
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("FileStoreageManager.space_exhausted", maxBufferSpace)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("FileStoreageManager.space_exhausted", maxBufferSpace)); //$NON-NLS-1$
}
Map.Entry<Long, FileInfo> entry = this.storageFiles.lastEntry();
boolean createNew = false;
@@ -159,7 +159,7 @@
fileAccess.seek(pointer);
fileAccess.write(bytes, offset, length);
} catch(IOException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
} finally {
fileInfo.close();
}
@@ -202,17 +202,17 @@
*/
public void initialize() throws TeiidComponentException {
if(this.directory == null) {
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("FileStoreageManager.no_directory")); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("FileStoreageManager.no_directory")); //$NON-NLS-1$
}
dirFile = new File(this.directory);
if(dirFile.exists()) {
if(! dirFile.isDirectory()) {
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("FileStoreageManager.not_a_directory", dirFile.getAbsoluteFile())); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("FileStoreageManager.not_a_directory", dirFile.getAbsoluteFile())); //$NON-NLS-1$
}
} else if(! dirFile.mkdirs()) {
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("FileStoreageManager.error_creating", dirFile.getAbsoluteFile())); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("FileStoreageManager.error_creating", dirFile.getAbsoluteFile())); //$NON-NLS-1$
}
}
@@ -240,7 +240,7 @@
}
return storageFile;
} catch(IOException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("FileStoreageManager.error_creating", name + "_" + fileNumber)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_creating", name + "_" + fileNumber)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Deleted: trunk/engine/src/main/java/org/teiid/dqp/DQPPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/DQPPlugin.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/DQPPlugin.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,39 +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.dqp;
-
-import java.util.ResourceBundle;
-
-import org.teiid.core.BundleUtil;
-
-
-/**
- * DQPPlugin
- */
-public class DQPPlugin {
-
- public static final String PLUGIN_ID = DQPPlugin.class.getPackage().getName();
- public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
- PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-
-}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,10 +33,10 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.resource.ResourceException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.message.AtomicRequestID;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.logging.CommandLogMessage;
@@ -47,10 +47,12 @@
import org.teiid.metadata.Datatype;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.MetadataStore;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
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.resource.spi.WrappedConnection;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorException;
@@ -86,14 +88,21 @@
if(ef != null) {
if (ef.isSourceRequired()) {
- Object conn = getConnectionFactory();
+
+ Object conn = null;
+ try {
+ conn = getConnectionFactory();
+ } catch (TranslatorException e) {
+ // treat this as connection not found.
+ }
+
if (conn == null) {
- sb.append(DQPPlugin.Util.getString("datasource_not_found", this.connectionName)); //$NON-NLS-1$
+ sb.append(QueryPlugin.Util.getString("datasource_not_found", this.connectionName)); //$NON-NLS-1$
}
}
}
else {
- sb.append(DQPPlugin.Util.getString("translator_not_found", this.translatorName)); //$NON-NLS-1$
+ sb.append(QueryPlugin.Util.getString("translator_not_found", this.translatorName)); //$NON-NLS-1$
}
return sb.toString();
}
@@ -102,8 +111,18 @@
MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
Object connectionFactory = getConnectionFactory();
Object connection = executionFactory.getConnection(connectionFactory);
+ Object unwrapped = null;
+
+ if (connection instanceof WrappedConnection) {
+ try {
+ unwrapped = ((WrappedConnection)connection).unwrap();
+ } catch (ResourceException e) {
+ throw new TranslatorException(QueryPlugin.Util.getString("failed_to_unwrap_connection")); //$NON-NLS-1$
+ }
+ }
+
try {
- executionFactory.getMetadata(factory, connection);
+ executionFactory.getMetadata(factory, (unwrapped == null) ? connection:unwrapped);
} finally {
executionFactory.closeConnection(connection, connectionFactory);
}
@@ -124,7 +143,6 @@
}
public ConnectorWork registerRequest(AtomicRequestMessage message) throws TeiidComponentException {
- // Set the connector ID to be used; if not already set.
checkStatus();
AtomicRequestID atomicRequestId = message.getAtomicRequestID();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {atomicRequestId, "Create State"}); //$NON-NLS-1$
@@ -144,7 +162,7 @@
*/
void removeState(AtomicRequestID id) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {id, "Remove State"}); //$NON-NLS-1$
- ConnectorWorkItem cwi = requestStates.remove(id);
+ requestStates.remove(id);
}
int size() {
@@ -156,7 +174,7 @@
* @throws TranslatorException
*/
public void start() {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorManagerImpl.Initializing_connector", translatorName)); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.getString("ConnectorManagerImpl.Initializing_connector", translatorName)); //$NON-NLS-1$
}
/**
@@ -221,7 +239,7 @@
* Get the ConnectionFactory object required by this manager
* @return
*/
- protected Object getConnectionFactory() {
+ protected Object getConnectionFactory() throws TranslatorException {
if (this.connectionName != null) {
String jndiName = this.connectionName;
if (!this.connectionName.startsWith(JAVA_CONTEXT)) {
@@ -238,14 +256,15 @@
}
}
} catch (NamingException e) {
- }
+ throw new TranslatorException(e, QueryPlugin.Util.getString("connection_factory_not_found", this.connectionName)); //$NON-NLS-1$
+ }
}
return null;
}
private void checkStatus() throws TeiidComponentException {
if (stopped) {
- throw new TeiidComponentException(DQPPlugin.Util.getString("ConnectorManager.not_in_valid_state", this.translatorName)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("ConnectorManager.not_in_valid_state", this.translatorName)); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,12 +27,13 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
+import javax.resource.ResourceException;
+
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.message.AtomicRequestID;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
@@ -42,11 +43,13 @@
import org.teiid.logging.LogManager;
import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.StoredProcedure;
+import org.teiid.resource.spi.WrappedConnection;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionFactory;
@@ -117,10 +120,10 @@
if(execution != null) {
execution.cancel();
}
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("DQPCore.The_atomic_request_has_been_cancelled", this.id)); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.getString("DQPCore.The_atomic_request_has_been_cancelled", this.id)); //$NON-NLS-1$
}
} catch (TranslatorException e) {
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, e, DQPPlugin.Util.getString("Cancel_request_failed", this.id)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, e, QueryPlugin.Util.getString("Cancel_request_failed", this.id)); //$NON-NLS-1$
}
}
@@ -167,7 +170,7 @@
}
manager.logSRCCommand(this.requestMsg, this.securityContext, Event.ERROR, null);
- String msg = DQPPlugin.Util.getString("ConnectorWorker.process_failed", this.id); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("ConnectorWorker.process_failed", this.id); //$NON-NLS-1$
if (isCancelled.get()) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, msg);
} else if (t instanceof TranslatorException || t instanceof TeiidProcessingException) {
@@ -193,6 +196,16 @@
try {
this.connectionFactory = this.manager.getConnectionFactory();
this.connection = this.connector.getConnection(this.connectionFactory);
+
+ Object unwrapped = null;
+ if (connection instanceof WrappedConnection) {
+ try {
+ unwrapped = ((WrappedConnection)connection).unwrap();
+ } catch (ResourceException e) {
+ throw new TranslatorException(QueryPlugin.Util.getString("failed_to_unwrap_connection")); //$NON-NLS-1$
+ }
+ }
+
// Translate the command
Command command = this.requestMsg.getCommand();
this.expectedColumns = command.getProjectedSymbols().size();
@@ -202,7 +215,7 @@
RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
// Create the execution based on mode
- final Execution exec = connector.createExecution(this.translatedCommand, this.securityContext, rmd, this.connection);
+ final Execution exec = connector.createExecution(this.translatedCommand, this.securityContext, rmd, (unwrapped == null) ? this.connection:unwrapped);
if (this.translatedCommand instanceof Call) {
this.execution = Assertion.isInstanceOf(exec, ProcedureExecution.class, "Call Executions are expected to be ProcedureExecutions"); //$NON-NLS-1$
StoredProcedure proc = (StoredProcedure)command;
@@ -287,7 +300,7 @@
this.lastBatch = true;
break;
} else if (this.rowCount > this.requestMsg.getMaxResultRows() && this.requestMsg.isExceptionOnMaxRows()) {
- String msg = DQPPlugin.Util.getString("ConnectorWorker.MaxResultRowsExceed", this.requestMsg.getMaxResultRows()); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("ConnectorWorker.MaxResultRowsExceed", this.requestMsg.getMaxResultRows()); //$NON-NLS-1$
throw new TranslatorException(msg);
}
}
@@ -313,7 +326,7 @@
if ( !lastBatch && currentRowCount == 0 ) {
// Defect 13366 - Should send all batches, even if they're zero size.
// Log warning if received a zero-size non-last batch from the connector.
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorWorker.zero_size_non_last_batch", requestMsg.getConnectorName())); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.getString("ConnectorWorker.zero_size_non_last_batch", requestMsg.getConnectorName())); //$NON-NLS-1$
}
AtomicResultsMessage response = createResultsMessage(rows.toArray(new List[currentRowCount]), requestMsg.getCommand().getProjectedSymbols());
@@ -322,6 +335,7 @@
response.setSupportsImplicitClose(!this.securityContext.keepExecutionAlive());
response.setTransactional(this.securityContext.isTransactional());
response.setWarnings(this.securityContext.getWarnings());
+ response.setSupportsCloseWithLobs(this.connector.areLobsUsableAfterClose());
if ( lastBatch ) {
response.setFinalRow(rowCount);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,12 +30,12 @@
import java.util.Collections;
import java.util.List;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.language.Argument;
import org.teiid.language.Call;
import org.teiid.language.Argument.Direction;
+import org.teiid.query.QueryPlugin;
+import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.ProcedureExecution;
class ProcedureBatchHandler {
@@ -67,7 +67,7 @@
List padRow(List row) throws TranslatorException {
if (row.size() != resultSetCols) {
- 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$
+ throw new TranslatorException(QueryPlugin.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;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -37,14 +36,15 @@
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.impl.DataPolicyMetadata;
import org.teiid.api.exception.query.QueryMetadataException;
+import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.process.multisource.MultiSourceElement;
import org.teiid.logging.AuditMessage;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.resolver.util.ResolverUtil;
@@ -242,6 +242,11 @@
}
}
fullName = getMetadata().getFullName(metadataID);
+ Object modelId = getMetadata().getModelID(metadataID);
+ String modelName = getMetadata().getFullName(modelId);
+ if (CoreConstants.SYSTEM_MODEL.equals(modelName) || CoreConstants.ODBC_MODEL.equals(modelName)) {
+ continue;
+ }
nameToSymbolMap.put(fullName, symbol);
} catch(QueryMetadataException e) {
handleException(e);
@@ -262,7 +267,7 @@
// is not authorized in the exception message
handleValidationError(
- DQPPlugin.Util.getString("ERR.018.005.0095", new Object[]{DQPWorkContext.getWorkContext().getSessionId(), getActionLabel(actionCode)}), //$NON-NLS-1$
+ QueryPlugin.Util.getString("ERR.018.005.0095", userName, getActionLabel(actionCode)), //$NON-NLS-1$
inaccessibleSymbols);
}
}
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,9 +30,9 @@
import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
@@ -59,6 +59,7 @@
this.vdb = vdb;
userCache.put(CoreConstants.SYSTEM_MODEL, SYSTEM_CAPS);
userCache.put(CoreConstants.ODBC_MODEL, SYSTEM_CAPS);
+ userCache.put(CoreConstants.SYSTEM_ADMIN_MODEL, SYSTEM_CAPS);
}
/**
@@ -75,7 +76,7 @@
try {
ConnectorManager mgr = this.connectorRepo.getConnectorManager(sourceName);
if (mgr == null) {
- throw new TranslatorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
+ throw new TranslatorException(QueryPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
}
caps = mgr.getCapabilities();
break;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,9 +37,9 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.parser.ParseInfo;
@@ -143,7 +143,7 @@
}
return true;
} catch (TeiidComponentException e) {
- LogManager.logDetail(LogConstants.CTX_DQP, DQPPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
}
return false;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -61,7 +61,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.Streamable;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
@@ -74,6 +73,7 @@
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.logging.CommandLogMessage.Event;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
@@ -211,6 +211,8 @@
private int currentlyActivePlans;
private LinkedList<RequestWorkItem> waitingPlans = new LinkedList<RequestWorkItem>();
private CacheFactory cacheFactory;
+
+ private SessionAwareCache<CachedResults> matTables;
/**
* perform a full shutdown and wait for 10 seconds for all threads to finish
@@ -461,7 +463,7 @@
RequestWorkItem getRequestWorkItem(RequestID reqID) throws TeiidProcessingException {
RequestWorkItem result = this.requests.get(reqID);
if (result == null) {
- throw new TeiidProcessingException(DQPPlugin.Util.getString("DQPCore.The_request_has_been_closed.", reqID));//$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("DQPCore.The_request_has_been_closed.", reqID));//$NON-NLS-1$
}
return result;
}
@@ -514,7 +516,7 @@
if (markCancelled) {
logMMCommand(workItem, Event.CANCEL, null);
} else {
- LogManager.logDetail(LogConstants.CTX_DQP, DQPPlugin.Util.getString("DQPCore.failed_to_cancel")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.failed_to_cancel")); //$NON-NLS-1$
}
return markCancelled;
}
@@ -544,7 +546,7 @@
}
private void clearPlanCache(){
- LogManager.logInfo(LogConstants.CTX_DQP, DQPPlugin.Util.getString("DQPCore.Clearing_prepared_plan_cache")); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.Clearing_prepared_plan_cache")); //$NON-NLS-1$
this.prepPlanCache.clearAll();
}
@@ -555,6 +557,18 @@
}
}
+ private void clearPlanCache(String vdbName, int version){
+ LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.Clearing_prepared_plan_cache")); //$NON-NLS-1$
+ this.prepPlanCache.clearForVDB(vdbName, version);
+ }
+
+ private void clearResultSetCache(String vdbName, int version) {
+ //clear cache in server
+ if(rsCache != null){
+ rsCache.clearForVDB(vdbName, version);
+ }
+ }
+
public CacheStatisticsMetadata getCacheStatistics(String cacheType) {
if (cacheType.equalsIgnoreCase(Admin.Cache.PREPARED_PLAN_CACHE.toString())) {
return buildCacheStats(Admin.Cache.PREPARED_PLAN_CACHE.toString(), this.prepPlanCache);
@@ -592,6 +606,21 @@
break;
}
}
+
+ public void clearCache(String cacheType, String vdbName, int version) {
+ Admin.Cache cache = Admin.Cache.valueOf(cacheType);
+ switch (cache) {
+ case PREPARED_PLAN_CACHE:
+ clearPlanCache(vdbName, version);
+ break;
+ case QUERY_SERVICE_RESULT_SET_CACHE:
+ clearResultSetCache(vdbName, version);
+ break;
+ }
+ if (this.matTables != null) {
+ this.matTables.clearForVDB(vdbName, version);
+ }
+ }
public Collection<org.teiid.adminapi.Transaction> getTransactions() {
return this.transactionService.getTransactions();
@@ -676,8 +705,12 @@
this.processWorkerPool = new ThreadReuseExecutor(DQPConfiguration.PROCESS_PLAN_QUEUE_NAME, config.getMaxThreads());
+ if (cacheFactory.isReplicated()) {
+ matTables = new SessionAwareCache<CachedResults>();
+ }
+
dataTierMgr = new TempTableDataManager(new DataTierManagerImpl(this,
- this.bufferService), this.bufferManager, this.processWorkerPool, this.rsCache);
+ this.bufferService), this.bufferManager, this.processWorkerPool, this.rsCache, matTables, this.cacheFactory);
}
public void setBufferService(BufferService service) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -82,6 +82,7 @@
public void setSession(SessionMetadata session) {
this.session = session;
+ this.policies = null;
}
public void setSecurityHelper(SecurityHelper securityHelper) {
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -43,14 +43,11 @@
import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.types.BlobImpl;
import org.teiid.core.types.BlobType;
-import org.teiid.core.types.ClobImpl;
-import org.teiid.core.types.ClobType;
import org.teiid.core.types.SQLXMLImpl;
import org.teiid.core.types.XMLType;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
+import org.teiid.core.util.StringUtil;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.datamgr.ConnectorWork;
@@ -66,6 +63,7 @@
import org.teiid.metadata.ProcedureParameter;
import org.teiid.metadata.Schema;
import org.teiid.metadata.Table;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.metadata.CompositeMetadataStore;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TransformationMetadata;
@@ -99,14 +97,15 @@
KEYCOLUMNS,
PROCEDUREPARAMS,
REFERENCEKEYCOLUMNS,
- PROPERTIES,
- MATVIEWS
+ PROPERTIES
}
+ private enum SystemAdminTables {
+ MATVIEWS,
+ VDBRESOURCES
+ }
+
private enum SystemProcs {
- GETCHARACTERVDBRESOURCE,
- GETBINARYVDBRESOURCE,
- GETVDBRESOURCEPATHS,
GETXMLSCHEMAS
}
@@ -122,7 +121,7 @@
public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID) throws TeiidComponentException, TeiidProcessingException {
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)context.getProcessorID());
- if(CoreConstants.SYSTEM_MODEL.equals(modelName)) {
+ if(CoreConstants.SYSTEM_MODEL.equals(modelName) || CoreConstants.SYSTEM_ADMIN_MODEL.equals(modelName)) {
return processSystemQuery(context, command, workItem.getDqpWorkContext());
}
@@ -147,12 +146,58 @@
int vdbVersion = workContext.getVdbVersion();
VDBMetaData vdb = workContext.getVDB();
CompositeMetadataStore metadata = vdb.getAttachment(TransformationMetadata.class).getMetadataStore();
+ TransformationMetadata indexMetadata = vdb.getAttachment(TransformationMetadata.class);
Collection rows = new ArrayList();
int oid = 0;
if (command instanceof Query) {
Query query = (Query)command;
UnaryFromClause ufc = (UnaryFromClause)query.getFrom().getClauses().get(0);
GroupSymbol group = ufc.getGroup();
+ if (StringUtil.startsWithIgnoreCase(group.getNonCorrelationName(), (CoreConstants.SYSTEM_ADMIN_MODEL))) {
+ final SystemAdminTables sysTable = SystemAdminTables.valueOf(group.getNonCorrelationName().substring(CoreConstants.SYSTEM_ADMIN_MODEL.length() + 1).toUpperCase());
+ switch (sysTable) {
+ case MATVIEWS:
+ for (Schema schema : getVisibleSchemas(vdb, metadata)) {
+ for (Table table : schema.getTables().values()) {
+ if (!table.isMaterialized()) {
+ continue;
+ }
+ String targetSchema = null;
+ String matTableName = null;
+ String state = null;
+ Timestamp updated = null;
+ Integer cardinaltity = null;
+ Boolean valid = null;
+ if (table.getMaterializedTable() == null) {
+ TempTableStore globalStore = context.getGlobalTableStore();
+ matTableName = RelationalPlanner.MAT_PREFIX+table.getFullName().toUpperCase();
+ MatTableInfo info = globalStore.getMatTableInfo(matTableName);
+ valid = info.isValid();
+ state = info.getState().name();
+ updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime());
+ TempMetadataID id = globalStore.getMetadataStore().getTempGroupID(matTableName);
+ if (id != null) {
+ cardinaltity = id.getCardinality();
+ }
+ //ttl, pref_mem - not part of proper metadata
+ } else {
+ Table t = table.getMaterializedTable();
+ matTableName = t.getName();
+ targetSchema = t.getParent().getName();
+ }
+ rows.add(Arrays.asList(vdbName, schema.getName(), table.getName(), targetSchema, matTableName, valid, state, updated, cardinaltity));
+ }
+ }
+ break;
+ case VDBRESOURCES:
+ String[] filePaths = indexMetadata.getVDBResourcePaths();
+ for (String filePath : filePaths) {
+ rows.add(Arrays.asList(filePath, new BlobType(indexMetadata.getVDBResourceAsBlob(filePath))));
+ }
+ break;
+ }
+ return new CollectionTupleSource(rows.iterator());
+ }
final SystemTables sysTable = SystemTables.valueOf(group.getNonCorrelationName().substring(CoreConstants.SYSTEM_MODEL.length() + 1).toUpperCase());
switch (sysTable) {
case DATATYPES:
@@ -263,65 +308,15 @@
}
}
break;
- case MATVIEWS:
- if (!table.isMaterialized()) {
- continue;
- }
- String targetSchema = null;
- String matTableName = null;
- String state = null;
- Timestamp updated = null;
- Integer cardinaltity = null;
- Boolean valid = null;
- if (table.getMaterializedTable() == null) {
- TempTableStore globalStore = context.getGlobalTableStore();
- matTableName = RelationalPlanner.MAT_PREFIX+table.getFullName().toUpperCase();
- MatTableInfo info = globalStore.getMatTableInfo(matTableName);
- valid = info.isValid();
- state = info.getState().name();
- updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime());
- TempMetadataID id = globalStore.getMetadataStore().getTempGroupID(matTableName);
- if (id != null) {
- cardinaltity = id.getCardinality();
- }
- //ttl, pref_mem - not part of proper metadata
- } else {
- Table t = table.getMaterializedTable();
- matTableName = t.getName();
- targetSchema = t.getParent().getName();
- }
- rows.add(Arrays.asList(vdbName, schema.getName(), table.getName(), targetSchema, matTableName, valid, state, updated, cardinaltity));
- break;
}
}
}
break;
}
} else {
- TransformationMetadata indexMetadata = vdb.getAttachment(TransformationMetadata.class);
StoredProcedure proc = (StoredProcedure)command;
final SystemProcs sysTable = SystemProcs.valueOf(proc.getProcedureCallableName().substring(CoreConstants.SYSTEM_MODEL.length() + 1).toUpperCase());
switch (sysTable) {
- case GETVDBRESOURCEPATHS:
- String[] filePaths = indexMetadata.getVDBResourcePaths();
- for (String filePath : filePaths) {
- rows.add(Arrays.asList(filePath, filePath.endsWith(".INDEX"))); //$NON-NLS-1$
- }
- break;
- case GETBINARYVDBRESOURCE:
- String filePath = (String)((Constant)proc.getParameter(1).getExpression()).getValue();
- BlobImpl contents = indexMetadata.getVDBResourceAsBlob(filePath);
- if (contents != null) {
- rows.add(Arrays.asList(new BlobType(contents)));
- }
- break;
- case GETCHARACTERVDBRESOURCE:
- filePath = (String)((Constant)proc.getParameter(1).getExpression()).getValue();
- ClobImpl filecontents = indexMetadata.getVDBResourceAsClob(filePath);
- if (filecontents != null) {
- rows.add(Arrays.asList(new ClobType(filecontents)));
- }
- break;
case GETXMLSCHEMAS:
try {
Object groupID = indexMetadata.getGroupID((String)((Constant)proc.getParameter(1).getExpression()).getValue());
@@ -341,8 +336,7 @@
private List<Schema> getVisibleSchemas(VDBMetaData vdb, CompositeMetadataStore metadata) {
ArrayList<Schema> result = new ArrayList<Schema>();
for (Schema schema : metadata.getSchemas().values()) {
- ModelMetaData model = vdb.getModel(schema.getName());
- if(model.isVisible()) {
+ if(vdb.isVisible(schema.getName())) {
result.add(schema);
}
}
@@ -372,7 +366,7 @@
List<String> bindings = model.getSourceNames();
if (bindings == null || bindings.size() != 1) {
// this should not happen, but it did occur when setting up the SystemAdmin models
- throw new TeiidComponentException(DQPPlugin.Util.getString("DataTierManager.could_not_obtain_connector_binding", new Object[]{modelName, workItem.getDqpWorkContext().getVdbName(), workItem.getDqpWorkContext().getVdbVersion() })); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("DataTierManager.could_not_obtain_connector_binding", new Object[]{modelName, workItem.getDqpWorkContext().getVdbName(), workItem.getDqpWorkContext().getVdbVersion() })); //$NON-NLS-1$
}
connectorBindingId = bindings.get(0);
Assertion.isNotNull(connectorBindingId, "could not obtain connector id"); //$NON-NLS-1$
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -23,7 +23,6 @@
package org.teiid.dqp.internal.process;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
@@ -70,21 +69,21 @@
* notify the parent plan and just schedule the next poll.
*/
public class DataTierTupleSource implements TupleSource {
-
+
// Construction state
private final AtomicRequestMessage aqr;
private final RequestWorkItem workItem;
private final ConnectorWork cwi;
private final DataTierManagerImpl dtm;
- private List<Integer> convertToRuntimeType;
+ private boolean[] convertToRuntimeType;
private boolean[] convertToDesiredRuntimeType;
private Class<?>[] schema;
// Data state
private int index;
private int rowsProcessed;
- private volatile AtomicResultsMessage arm;
+ private AtomicResultsMessage arm;
private boolean closed;
private volatile boolean canceled;
private boolean executed;
@@ -102,12 +101,12 @@
List<SingleElementSymbol> symbols = this.aqr.getCommand().getProjectedSymbols();
this.schema = new Class[symbols.size()];
this.convertToDesiredRuntimeType = new boolean[symbols.size()];
- this.convertToRuntimeType = new ArrayList<Integer>(symbols.size());
+ this.convertToRuntimeType = new boolean[symbols.size()];
for (int i = 0; i < symbols.size(); i++) {
SingleElementSymbol symbol = symbols.get(i);
this.schema[i] = symbol.getType();
this.convertToDesiredRuntimeType[i] = true;
- this.convertToRuntimeType.add(i);
+ this.convertToRuntimeType[i] = true;
}
Assertion.isNull(workItem.getConnectorRequest(aqr.getAtomicRequestID()));
@@ -132,25 +131,26 @@
}
private List correctTypes(List row) throws TransformationException {
- for (int i = convertToRuntimeType.size() - 1; i >= 0; i--) {
- int idx = convertToRuntimeType.get(i);
- Object value = row.get(idx);
- if (value != null) {
- Object result = convertToRuntimeType(value, this.schema[idx]);
- if (DataTypeManager.isLOB(result.getClass())) {
- explicitClose = true;
+ //TODO: add a proper intermediate schema
+ for (int i = 0; i < row.size(); i++) {
+ Object value = row.get(i);
+ if (value == null) {
+ continue;
+ }
+ if (convertToRuntimeType[i]) {
+ boolean lob = !arm.supportsCloseWithLobs() && DataTypeManager.isLOB(value.getClass());
+ Object result = convertToRuntimeType(value, this.schema[i]);
+ if (value == result && !DataTypeManager.DefaultDataClasses.OBJECT.equals(this.schema[i])) {
+ convertToRuntimeType[i] = false;
+ } else {
+ if (lob && DataTypeManager.isLOB(result.getClass()) && DataTypeManager.isLOB(this.schema[i])) {
+ explicitClose = true;
+ }
+ row.set(i, result);
+ value = result;
}
- if (value == result && !DataTypeManager.DefaultDataClasses.OBJECT.equals(this.schema[idx])) {
- convertToRuntimeType.remove(i);
- continue;
- }
- row.set(idx, result);
}
- }
- //TODO: add a proper intermediate schema
- for (int i = 0; i < row.size(); i++) {
if (convertToDesiredRuntimeType[i]) {
- Object value = row.get(i);
if (value != null) {
Object result = DataTypeManager.transformValue(value, value.getClass(), this.schema[i]);
if (value == result) {
@@ -160,7 +160,7 @@
row.set(i, result);
}
} else {
- row.set(i, DataTypeManager.getCanonicalValue(row.get(i)));
+ row.set(i, DataTypeManager.getCanonicalValue(value));
}
}
return row;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,8 +37,8 @@
import org.teiid.core.types.XMLType;
import org.teiid.core.util.Assertion;
import org.teiid.core.util.ReaderInputStream;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
public class LobWorkItem implements Work {
@@ -75,7 +75,7 @@
chunk = stream.getNextChunk();
shouldClose = chunk.isLast();
} catch (TeiidComponentException e) {
- LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e, DQPPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
+ LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
ex = e;
} catch (IOException e) {
ex = e;
@@ -102,7 +102,7 @@
stream.close();
}
} catch (IOException e) {
- LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e, DQPPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
+ LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
}
parent.removeLobStream(streamRequestId);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -135,13 +135,8 @@
//if prepared plan does not exist, create one
prepPlan = new PreparedPlan();
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Query does not exist in cache: ", sqlQuery}); //$NON-NLS-1$
- }
-
- ProcessorPlan cachedPlan = prepPlan.getPlan();
-
- if (cachedPlan == null) {
- super.generatePlan();
- if (!this.addedLimit) { //TODO: this is a little problematic
+ super.generatePlan();
+ if (!this.addedLimit) { //TODO: this is a little problematic
prepPlan.setCommand(this.userCommand);
// Defect 13751: Clone the plan in its current state (i.e. before processing) so that it can be used for later queries
prepPlan.setPlan(processPlan.clone());
@@ -149,15 +144,17 @@
this.prepPlanCache.put(id, this.context.getDeterminismLevel(), prepPlan, userCommand.getCacheHint() != null?userCommand.getCacheHint().getTtl():null);
}
} else {
+ ProcessorPlan cachedPlan = prepPlan.getPlan();
+ this.userCommand = prepPlan.getCommand();
+ validateAccess(userCommand);
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Query exist in cache: ", sqlQuery }); //$NON-NLS-1$
processPlan = cachedPlan.clone();
//already in cache. obtain the values from cache
analysisRecord = prepPlan.getAnalysisRecord();
- this.userCommand = prepPlan.getCommand();
createCommandContext();
}
-
+
if (requestMsg.isBatchedUpdate()) {
handlePreparedBatchUpdate();
} else {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -24,6 +24,7 @@
import java.sql.Connection;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.Set;
@@ -45,7 +46,6 @@
import org.teiid.core.id.IntegerIDFactory;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.process.multisource.MultiSourceCapabilitiesFinder;
import org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper;
@@ -57,8 +57,10 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.eval.SecurityFunctionEvaluator;
+import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempCapabilitiesFinder;
import org.teiid.query.metadata.TempMetadataAdapter;
@@ -81,7 +83,9 @@
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.sql.visitor.GroupCollectorVisitor;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
@@ -185,7 +189,7 @@
globalTables = vdbMetadata.getAttachment(TempTableStore.class);
if (metadata == null) {
- throw new TeiidComponentException(DQPPlugin.Util.getString("DQPCore.Unable_to_load_metadata_for_VDB_name__{0},_version__{1}", this.vdbName, this.vdbVersion)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("DQPCore.Unable_to_load_metadata_for_VDB_name__{0},_version__{1}", this.vdbName, this.vdbVersion)); //$NON-NLS-1$
}
this.metadata = new TempMetadataAdapter(metadata, new TempMetadataStore());
@@ -215,7 +219,7 @@
}
if ((this.requestMsg.getResultsMode() == ResultsMode.UPDATECOUNT && !returnsUpdateCount)
|| (this.requestMsg.getResultsMode() == ResultsMode.RESULTSET && !returnsResultSet)) {
- throw new QueryValidatorException(DQPPlugin.Util.getString(this.requestMsg.getResultsMode()==ResultsMode.RESULTSET?"Request.no_result_set":"Request.result_set")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new QueryValidatorException(QueryPlugin.Util.getString(this.requestMsg.getResultsMode()==ResultsMode.RESULTSET?"Request.no_result_set":"Request.result_set")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Create command context, used in rewriting, planning, and processing
@@ -274,7 +278,7 @@
static void referenceCheck(List<Reference> references) throws QueryValidatorException {
if (references != null && !references.isEmpty()) {
- throw new QueryValidatorException(DQPPlugin.Util.getString("Request.Invalid_character_in_query")); //$NON-NLS-1$
+ throw new QueryValidatorException(QueryPlugin.Util.getString("Request.Invalid_character_in_query")); //$NON-NLS-1$
}
}
@@ -380,15 +384,24 @@
List<Reference> references = ReferenceCollectorVisitor.getReferences(command);
- //there should be no reference (?) for query/update executed as statement
checkReferences(references);
this.analysisRecord = new AnalysisRecord(requestMsg.getShowPlan() != ShowPlan.OFF, requestMsg.getShowPlan() == ShowPlan.DEBUG);
resolveCommand(command);
+ validateAccess(userCommand);
+
createCommandContext();
-
+
+ Collection<GroupSymbol> groups = GroupCollectorVisitor.getGroups(command, true);
+ for (GroupSymbol groupSymbol : groups) {
+ if (groupSymbol.isTempTable()) {
+ this.context.setDeterminismLevel(FunctionMethod.SESSION_DETERMINISTIC);
+ break;
+ }
+ }
+
validateQuery(command);
command = QueryRewriter.rewrite(command, metadata, context);
@@ -431,9 +444,9 @@
LogManager.logDetail(LogConstants.CTX_QUERY_PLANNER, analysisRecord.getAnnotations());
}
}
- LogManager.logDetail(LogConstants.CTX_DQP, new Object[] { DQPPlugin.Util.getString("BasicInterceptor.ProcessTree_for__4"), requestId, processPlan }); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_DQP, new Object[] { QueryPlugin.Util.getString("BasicInterceptor.ProcessTree_for__4"), requestId, processPlan }); //$NON-NLS-1$
} catch (QueryMetadataException e) {
- throw new QueryPlannerException(e, DQPPlugin.Util.getString("DQPCore.Unknown_query_metadata_exception_while_registering_query__{0}.", requestId)); //$NON-NLS-1$
+ throw new QueryPlannerException(e, QueryPlugin.Util.getString("DQPCore.Unknown_query_metadata_exception_while_registering_query__{0}.", requestId)); //$NON-NLS-1$
}
}
@@ -448,8 +461,6 @@
postProcessXML();
- validateAccess(userCommand);
-
createProcessor();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -45,7 +45,6 @@
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestID;
@@ -57,8 +56,8 @@
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.logging.CommandLogMessage.Event;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.parser.ParseInfo;
import org.teiid.query.processor.BatchCollector;
@@ -173,7 +172,7 @@
state = ProcessingState.PROCESSING;
processNew();
if (isCanceled) {
- this.processingException = new TeiidProcessingException(QueryExecPlugin.Util.getString("QueryProcessor.request_cancelled", this.requestID)); //$NON-NLS-1$
+ this.processingException = new TeiidProcessingException(QueryPlugin.Util.getString("QueryProcessor.request_cancelled", this.requestID)); //$NON-NLS-1$
state = ProcessingState.CLOSE;
}
}
@@ -205,9 +204,9 @@
cause = cause.getCause();
}
StackTraceElement elem = cause.getStackTrace()[0];
- LogManager.logWarning(LogConstants.CTX_DQP, DQPPlugin.Util.getString("ProcessWorker.processing_error", e.getMessage(), requestID, e.getClass().getName(), elem)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.getString("ProcessWorker.processing_error", e.getMessage(), requestID, e.getClass().getName(), elem)); //$NON-NLS-1$
}else {
- LogManager.logError(LogConstants.CTX_DQP, e, DQPPlugin.Util.getString("ProcessWorker.error", requestID)); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("ProcessWorker.error", requestID)); //$NON-NLS-1$
}
}
@@ -314,7 +313,7 @@
try {
this.transactionService.rollback(transactionContext);
} catch (XATransactionException e1) {
- LogManager.logWarning(LogConstants.CTX_DQP, e1, DQPPlugin.Util.getString("ProcessWorker.failed_rollback")); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e1, QueryPlugin.Util.getString("ProcessWorker.failed_rollback")); //$NON-NLS-1$
}
} else {
suspend();
@@ -376,7 +375,7 @@
cr.setAnalysisRecord(analysisRecord);
cr.setResults(resultsBuffer);
if (determinismLevel > FunctionMethod.SESSION_DETERMINISTIC) {
- LogManager.logInfo(LogConstants.CTX_DQP, DQPPlugin.Util.getString("RequestWorkItem.cache_nondeterministic", originalCommand)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("RequestWorkItem.cache_nondeterministic", originalCommand)); //$NON-NLS-1$
}
dqpCore.getRsCache().put(cid, determinismLevel, cr, originalCommand.getCacheHint() != null?originalCommand.getCacheHint().getTtl():null);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,6 +25,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import org.teiid.cache.Cachable;
@@ -174,6 +175,21 @@
this.distributedCache.clear();
}
+ public void clearForVDB(String vdbName, int version) {
+ clearCache(this.localCache, vdbName, version);
+ clearCache(this.distributedCache, vdbName, version);
+ }
+
+ private void clearCache(Cache<CacheID, T> cache, String vdbName, int version) {
+ Set<CacheID> keys = cache.keys();
+ VDBKey vdbKey = new VDBKey(vdbName, version);
+ for (CacheID key:keys) {
+ if (key.vdbInfo.equals(vdbKey)) {
+ cache.remove(key);
+ }
+ }
+ }
+
public static class CacheID implements Serializable {
private static final long serialVersionUID = 8261905111156764744L;
private String sql;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/TransactionServerImpl.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -53,11 +53,11 @@
import org.teiid.client.xa.XATransactionException;
import org.teiid.client.xa.XidImpl;
import org.teiid.core.util.Assertion;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.dqp.internal.process.DQPCore.FutureWork;
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionService;
import org.teiid.dqp.service.TransactionContext.Scope;
+import org.teiid.query.QueryPlugin;
public class TransactionServerImpl implements TransactionService {
@@ -136,7 +136,7 @@
public int prepare(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException {
TransactionContext tc = checkXAState(threadId, xid, true, false);
if (!tc.getSuspendedBy().isEmpty()) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.suspended_exist", xid)); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.suspended_exist", xid)); //$NON-NLS-1$
}
// In the container this pass though
@@ -232,7 +232,7 @@
checkXAState(threadId, xid, false, false);
tc = transactions.getOrCreateTransactionContext(threadId);
if (tc.getTransactionType() != TransactionContext.Scope.NONE) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
}
tc.setTransactionTimeout(timeout);
tc.setXid(xid);
@@ -268,16 +268,16 @@
tc = checkXAState(threadId, xid, true, false);
TransactionContext threadContext = transactions.getOrCreateTransactionContext(threadId);
if (threadContext.getTransactionType() != TransactionContext.Scope.NONE) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
}
if (flags == XAResource.TMRESUME && !tc.getSuspendedBy().remove(threadId)) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.resume_failed", new Object[] {xid, threadId})); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.resume_failed", new Object[] {xid, threadId})); //$NON-NLS-1$
}
break;
}
default:
- throw new XATransactionException(XAException.XAER_INVAL, DQPPlugin.Util.getString("TransactionServer.unknown_flags")); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_INVAL, QueryPlugin.Util.getString("TransactionServer.unknown_flags")); //$NON-NLS-1$
}
tc.setThreadId(threadId);
@@ -304,7 +304,7 @@
break;
}
default:
- throw new XATransactionException(XAException.XAER_INVAL, DQPPlugin.Util.getString("TransactionServer.unknown_flags")); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_INVAL, QueryPlugin.Util.getString("TransactionServer.unknown_flags")); //$NON-NLS-1$
}
} finally {
tc.setThreadId(null);
@@ -316,15 +316,15 @@
TransactionContext tc = transactions.getTransactionContext(xid);
if (transactionExpected && tc == null) {
- throw new XATransactionException(XAException.XAER_NOTA, DQPPlugin.Util.getString("TransactionServer.no_global_transaction", xid)); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_NOTA, QueryPlugin.Util.getString("TransactionServer.no_global_transaction", xid)); //$NON-NLS-1$
} else if (!transactionExpected) {
if (tc != null) {
- throw new XATransactionException(XAException.XAER_DUPID, DQPPlugin.Util.getString("TransactionServer.existing_global_transaction", new Object[] {xid})); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_DUPID, QueryPlugin.Util.getString("TransactionServer.existing_global_transaction", new Object[] {xid})); //$NON-NLS-1$
}
if (!threadBound) {
tc = transactions.getOrCreateTransactionContext(threadId);
if (tc.getTransactionType() != TransactionContext.Scope.NONE) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.existing_transaction", new Object[] {xid, threadId})); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.existing_transaction", new Object[] {xid, threadId})); //$NON-NLS-1$
}
}
return null;
@@ -332,10 +332,10 @@
if (threadBound) {
if (!threadId.equals(tc.getThreadId())) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.wrong_transaction", xid)); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.wrong_transaction", xid)); //$NON-NLS-1$
}
} else if (tc.getThreadId() != null) {
- throw new XATransactionException(XAException.XAER_PROTO, DQPPlugin.Util.getString("TransactionServer.concurrent_transaction", xid)); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_PROTO, QueryPlugin.Util.getString("TransactionServer.concurrent_transaction", xid)); //$NON-NLS-1$
}
return tc;
@@ -349,14 +349,14 @@
try {
if (tc.getTransactionType() != TransactionContext.Scope.NONE) {
if (tc.getTransactionType() != TransactionContext.Scope.LOCAL) {
- throw new InvalidTransactionException(DQPPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
+ throw new InvalidTransactionException(QueryPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
}
if (!transactionExpected) {
- throw new InvalidTransactionException(DQPPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
+ throw new InvalidTransactionException(QueryPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
}
transactionManager.resume(tc.getTransaction());
} else if (transactionExpected) {
- throw new InvalidTransactionException(DQPPlugin.Util.getString("TransactionServer.no_transaction", threadId)); //$NON-NLS-1$
+ throw new InvalidTransactionException(QueryPlugin.Util.getString("TransactionServer.no_transaction", threadId)); //$NON-NLS-1$
}
} catch (InvalidTransactionException e) {
throw new XATransactionException(e);
@@ -464,7 +464,7 @@
*/
public TransactionContext begin(TransactionContext context) throws XATransactionException{
if (context.getTransactionType() != TransactionContext.Scope.NONE) {
- throw new XATransactionException(DQPPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
+ throw new XATransactionException(QueryPlugin.Util.getString("TransactionServer.existing_transaction")); //$NON-NLS-1$
}
beginDirect(context);
context.setTransactionType(TransactionContext.Scope.REQUEST);
Modified: trunk/engine/src/main/java/org/teiid/dqp/message/AtomicResultsMessage.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/message/AtomicResultsMessage.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/dqp/message/AtomicResultsMessage.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -42,6 +42,8 @@
// by default we support implicit close.
private boolean supportsImplicitClose = true;
+
+ private boolean supportsCloseWithLobs;
private boolean isTransactional;
@@ -60,6 +62,14 @@
return this.supportsImplicitClose;
}
+ public boolean supportsCloseWithLobs() {
+ return supportsCloseWithLobs;
+ }
+
+ public void setSupportsCloseWithLobs(boolean supportsCloseWithLobs) {
+ this.supportsCloseWithLobs = supportsCloseWithLobs;
+ }
+
public void setSupportsImplicitClose(boolean supportsImplicitClose) {
this.supportsImplicitClose = supportsImplicitClose;
}
@@ -83,6 +93,7 @@
supportsImplicitClose = in.readBoolean();
warnings = (List<Exception>)in.readObject();
isTransactional = in.readBoolean();
+ supportsCloseWithLobs = in.readBoolean();
}
public void writeExternal(ObjectOutput out) throws IOException {
@@ -92,6 +103,7 @@
out.writeBoolean(supportsImplicitClose);
out.writeObject(warnings);
out.writeBoolean(isTransactional);
+ out.writeBoolean(supportsCloseWithLobs);
}
public boolean isTransactional() {
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -109,7 +109,6 @@
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.sql.util.ValueIteratorSource;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
import org.teiid.translator.WSConnection.Util;
@@ -224,7 +223,7 @@
} else if (criteria instanceof ExpressionCriteria) {
return (Boolean)evaluate(((ExpressionCriteria)criteria).getExpression(), tuple);
} else {
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0010, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0010, criteria));
+ throw new ExpressionEvaluationException("ERR.015.006.0010", QueryPlugin.Util.getString("ERR.015.006.0010", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -274,7 +273,7 @@
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[] {"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[] {"left", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -287,7 +286,7 @@
try {
rightValue = evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"right", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -310,7 +309,7 @@
case CompareCriteria.GE:
return Boolean.valueOf((compareValues(leftValue, rightValue) >= 0));
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException("ERR.015.006.0012", QueryPlugin.Util.getString("ERR.015.006.0012", criteria.getOperator())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -332,7 +331,7 @@
try {
value = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"left", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -357,7 +356,7 @@
try {
rightValue = (String) evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"right", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -384,7 +383,7 @@
Matcher matcher = patternRegex.matcher(search);
return matcher.matches();
} catch(PatternSyntaxException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0014, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0014, new Object[]{pattern, e.getMessage()}));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0014", QueryPlugin.Util.getString("ERR.015.006.0014", new Object[]{pattern, e.getMessage()})); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -396,7 +395,7 @@
try {
leftValue = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Shortcut if null
@@ -450,7 +449,7 @@
try {
value = evaluate((Expression) possibleValue, tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, possibleValue));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", possibleValue)); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
value = possibleValue;
@@ -480,7 +479,7 @@
try {
value = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
return (value == null ^ criteria.isNegated());
@@ -494,7 +493,7 @@
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Shortcut if null
@@ -544,7 +543,7 @@
result = Boolean.valueOf(compare >= 0);
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException("ERR.015.006.0012", QueryPlugin.Util.getString("ERR.015.006.0012", criteria.getOperator())); //$NON-NLS-1$ //$NON-NLS-2$
}
switch(criteria.getPredicateQuantifier()) {
@@ -559,7 +558,7 @@
}
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException("ERR.015.006.0057", QueryPlugin.Util.getString("ERR.015.006.0057", criteria.getPredicateQuantifier())); //$NON-NLS-1$ //$NON-NLS-2$
}
} else { // value is null
@@ -572,7 +571,7 @@
result = null;
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException("ERR.015.006.0057", QueryPlugin.Util.getString("ERR.015.006.0057", criteria.getPredicateQuantifier())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -661,7 +660,7 @@
} else if (expression instanceof XMLParse){
return evaluateXMLParse(tuple, (XMLParse)expression);
} else {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0016, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0016, expression.getClass().getName()));
+ throw new TeiidComponentException("ERR.015.006.0016", QueryPlugin.Util.getString("ERR.015.006.0016", expression.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -906,7 +905,7 @@
return internalEvaluate(expr.getThenExpression(i), tuple);
}
} catch (ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, "CASE", expr.getWhenCriteria(i))); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", "CASE", expr.getWhenCriteria(i))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
if (expr.getElseExpression() != null) {
@@ -947,7 +946,7 @@
// Check for special lookup function
if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
if(dataMgr == null) {
- throw new ComponentNotFoundException(ErrorMessageKeys.PROCESSOR_0055, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0055));
+ throw new ComponentNotFoundException("ERR.015.006.0055", QueryPlugin.Util.getString("ERR.015.006.0055")); //$NON-NLS-1$ //$NON-NLS-2$
}
String codeTableName = (String) values[0];
@@ -981,7 +980,7 @@
if(valueIter.hasNext()) {
// The subquery should be scalar, but has produced
// more than one result value - this is an exception case
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0058, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0058, scalarSubquery.getCommand()));
+ throw new ExpressionEvaluationException("ERR.015.006.0058", QueryPlugin.Util.getString("ERR.015.006.0058", scalarSubquery.getCommand())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return result;
@@ -994,7 +993,7 @@
private CommandContext getContext(LanguageObject expression) throws TeiidComponentException {
if (context == null) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return context;
}
Deleted: trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/execution/QueryExecPlugin.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,46 +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.query.execution;
-
-import java.util.ResourceBundle;
-
-import org.teiid.core.BundleUtil;
-
-/**
- * QueryPlugin
- * <p>Used here in <code>query</code> to have access to the new
- * logging framework for <code>LogManager</code>.</p>
- */
-public class QueryExecPlugin { // extends Plugin {
-
- /**
- * The plug-in identifier of this plugin
- */
- public static final String PLUGIN_ID = QueryExecPlugin.class.getPackage().getName();
-
- /**
- * Provides access to the plugin's log and to it's resources.
- */
- public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
- PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-}
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,7 +37,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -236,7 +235,7 @@
// give name and types from fd
Method method = getInvocationMethod();
if(method == null) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0002, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0002, getName()));
+ throw new FunctionExecutionException("ERR.015.001.0002", QueryPlugin.Util.getString("ERR.015.001.0002", getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
if (getDeterministic() >= FunctionMethod.USER_DETERMINISTIC && values.length > 0 && values[0] instanceof CommandContext) {
@@ -255,11 +254,11 @@
Object result = method.invoke(null, values);
return importValue(result, getReturnType());
} catch(ArithmeticException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0003, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0003, getName()));
+ throw new FunctionExecutionException(e, "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
} catch(InvocationTargetException e) {
- throw new FunctionExecutionException(e.getTargetException(), ErrorMessageKeys.FUNCTION_0003, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0003, getName()));
+ throw new FunctionExecutionException(e.getTargetException(), "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
} catch(IllegalAccessException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0004, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0004, method.toString()));
+ throw new FunctionExecutionException(e, "ERR.015.001.0004", QueryPlugin.Util.getString("ERR.015.001.0004", method.toString())); //$NON-NLS-1$ //$NON-NLS-2$
} catch (TransformationException e) {
throw new FunctionExecutionException(e, e.getMessage());
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -56,7 +56,6 @@
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* Static method hooks for most of the function library.
@@ -236,14 +235,14 @@
return new Double(context.getNextRand(((Integer)seed).longValue()));
}
}
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0069, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0069, "rand", seed)); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0069", QueryPlugin.Util.getString("ERR.015.001.0069", "rand", seed)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static Object rand(CommandContext context) throws FunctionExecutionException {
if(context != null) {
return new Double(context.getNextRand());
}
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0069, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0069, "rand")); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0069", QueryPlugin.Util.getString("ERR.015.001.0069", "rand")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// ================== Function = mod =====================
@@ -450,7 +449,7 @@
int month = getField(date, Calendar.MONTH);
if (month > 11) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0066, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0066,
+ throw new FunctionExecutionException("ERR.015.001.0066", QueryPlugin.Util.getString("ERR.015.001.0066", //$NON-NLS-1$ //$NON-NLS-2$
new Object[] {"quarter", date.getClass().getName()})); //$NON-NLS-1$
}
return Integer.valueOf(month/3 + 1);
@@ -637,7 +636,7 @@
throws FunctionExecutionException {
int countValue = count.intValue();
if(countValue < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0017, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0017, countValue));
+ throw new FunctionExecutionException("ERR.015.001.0017", QueryPlugin.Util.getString("ERR.015.001.0017", countValue)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(string.length() < countValue) {
return string;
@@ -651,7 +650,7 @@
throws FunctionExecutionException {
int countValue = count.intValue();
if(countValue < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0017, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0017, countValue));
+ throw new FunctionExecutionException("ERR.015.001.0017", QueryPlugin.Util.getString("ERR.015.001.0017", countValue)); //$NON-NLS-1$ //$NON-NLS-2$
} else if(string.length() < countValue) {
return string;
} else {
@@ -767,11 +766,11 @@
// Check some invalid cases
if(startValue < 1 || (startValue-1) > string1.length()) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0061, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0061, start, string1));
+ throw new FunctionExecutionException("ERR.015.001.0061", QueryPlugin.Util.getString("ERR.015.001.0061", start, string1)); //$NON-NLS-1$ //$NON-NLS-2$
} else if (len < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0062, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0062, len));
+ throw new FunctionExecutionException("ERR.015.001.0062", QueryPlugin.Util.getString("ERR.015.001.0062", len)); //$NON-NLS-1$ //$NON-NLS-2$
} else if (string1.length() == 0 && (startValue > 1 || len >0) ) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0063, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0063));
+ throw new FunctionExecutionException("ERR.015.001.0063", QueryPlugin.Util.getString("ERR.015.001.0063")); //$NON-NLS-1$ //$NON-NLS-2$
}
StringBuffer result = new StringBuffer();
@@ -853,7 +852,7 @@
throws FunctionExecutionException {
int length = padLength.intValue();
if(length < 1) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0025, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0025));
+ throw new FunctionExecutionException("ERR.015.001.0025", QueryPlugin.Util.getString("ERR.015.001.0025")); //$NON-NLS-1$ //$NON-NLS-2$
}
if(length < str.length()) {
return str.substring(0, length);
@@ -863,7 +862,7 @@
}
// Get pad character
if(padStr.length() == 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0027, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0027));
+ throw new FunctionExecutionException("ERR.015.001.0027", QueryPlugin.Util.getString("ERR.015.001.0027")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Pad string
StringBuffer outStr = new StringBuffer(str);
@@ -908,7 +907,7 @@
public static Object translate(String str, String in, String out)
throws FunctionExecutionException {
if(in.length() != out.length()) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0031, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0031));
+ throw new FunctionExecutionException("ERR.015.001.0031", QueryPlugin.Util.getString("ERR.015.001.0031")); //$NON-NLS-1$ //$NON-NLS-2$
}
if(in.length() == 0 || str.length() == 0) {
@@ -942,7 +941,7 @@
try {
return DataTypeManager.transformValue(src, DataTypeManager.getDataTypeClass(type));
} catch(TransformationException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0033, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0033, new Object[]{src, DataTypeManager.getDataTypeName(src.getClass()), type}));
+ throw new FunctionExecutionException(e, "ERR.015.001.0033", QueryPlugin.Util.getString("ERR.015.001.0033", new Object[]{src, DataTypeManager.getDataTypeName(src.getClass()), type})); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -959,7 +958,7 @@
public static Object context(Object context, Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035));
+ throw new FunctionExecutionException("ERR.015.001.0035", QueryPlugin.Util.getString("ERR.015.001.0035")); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -973,7 +972,7 @@
public static Object rowlimit(Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035a, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035a));
+ throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -987,7 +986,7 @@
public static Object rowlimitexception(Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035a, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035a));
+ throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
}
// ================== Function = lookup =====================
@@ -1033,7 +1032,7 @@
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
} catch (IllegalArgumentException iae) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0042, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0042 ,
+ throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
iae.getMessage()));
}
}
@@ -1045,7 +1044,7 @@
try {
return df.parse(date);
} catch (ParseException e) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0043, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0043 ,
+ throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
date, format));
}
}
@@ -1062,7 +1061,7 @@
DecimalFormat df = new DecimalFormat(format);
return df.format(number);
} catch (IllegalArgumentException iae) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0042, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0042 ,
+ throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
iae.getMessage()));
}
}
@@ -1112,7 +1111,7 @@
try {
return df.parse(number);
} catch (ParseException e) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0043, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0043 ,
+ throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
number,format));
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -46,7 +46,6 @@
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.function.metadata.FunctionParameter;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -107,7 +106,7 @@
if(sourceObj instanceof FunctionMetadataSource) {
addSource((FunctionMetadataSource) sourceObj);
} else {
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0044, sourceObj.getClass().getName()));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.001.0044", sourceObj.getClass().getName())); //$NON-NLS-1$
}
}
}
@@ -127,7 +126,7 @@
while(functionIter.hasNext()) {
Object functionObj = functionIter.next();
if(! (functionObj instanceof FunctionMethod)) {
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0045, functionObj.getClass().getName()));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.001.0045", functionObj.getClass().getName())); //$NON-NLS-1$
}
FunctionMethod method = (FunctionMethod) functionObj;
@@ -138,7 +137,7 @@
// Add to tree
addFunction(source, method);
} else {
- LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0046, new Object[]{method}));
+ LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE, QueryPlugin.Util.getString("ERR.015.001.0046", new Object[]{method})); //$NON-NLS-1$
}
}
}
@@ -310,10 +309,10 @@
// not have the function jar files. The modeler never invokes, so this isn't a
// problem.
} catch (Exception e) {
- throw new TeiidRuntimeException(e, ErrorMessageKeys.FUNCTION_0047, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0047, new Object[]{method.getInvocationClass(), invocationMethod, inputTypes}));
+ throw new TeiidRuntimeException(e, "ERR.015.001.0047", QueryPlugin.Util.getString("ERR.015.001.0047", new Object[]{method.getInvocationClass(), invocationMethod, inputTypes})); //$NON-NLS-1$ //$NON-NLS-2$
}
if(invocationMethod != null && !FunctionTree.isValidMethod(invocationMethod)) {
- throw new TeiidRuntimeException(ErrorMessageKeys.FUNCTION_0047, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0047, new Object[]{method.getInvocationClass(), invocationMethod, inputTypes}));
+ throw new TeiidRuntimeException("ERR.015.001.0047", QueryPlugin.Util.getString("ERR.015.001.0047", new Object[]{method.getInvocationClass(), invocationMethod, inputTypes})); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
inputTypes.add(0, CommandContext.class);
Modified: trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.query.function.metadata.FunctionMetadataValidator;
import org.teiid.query.function.source.SystemSource;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
public class SystemFunctionManager {
@@ -44,7 +43,7 @@
validateSource(systemSource, report);
if(report.hasItems()) {
// Should never happen as SystemSource doesn't change
- System.err.println(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0005, report));
+ System.err.println(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
}
systemFunctionTree = new FunctionTree(systemSource);
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,7 +30,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -90,7 +89,7 @@
try {
return ((BigDecimal)sum).divide(new BigDecimal(count), AVG_SCALE, BigDecimal.ROUND_HALF_UP);
} catch(ArithmeticException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0048, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0048, sum, new Integer(count)));
+ throw new FunctionExecutionException(e, "ERR.015.001.0048", QueryPlugin.Util.getString("ERR.015.001.0048", sum, new Integer(count))); //$NON-NLS-1$ //$NON-NLS-2$
}
default:
throw new AssertionError("unknown accumulator type"); //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -57,7 +56,7 @@
maxValue = valueComp;
}
} else {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0050, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0050, "MAX", value.getClass().getName())); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MAX", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -57,7 +56,7 @@
minValue = valueComp;
}
} else {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0050, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0050, "MIN", value.getClass().getName())); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MIN", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -29,7 +29,6 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.QueryPlugin;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -79,7 +78,7 @@
*/
public static final void validateFunctionMethod(FunctionMethod method, ActivityReport report) {
if(method == null) {
- updateReport(report, method, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0052, "FunctionMethod")); //$NON-NLS-1$
+ updateReport(report, method, QueryPlugin.Util.getString("ERR.015.001.0052", "FunctionMethod")); //$NON-NLS-1$ //$NON-NLS-2$
return; // can't validate
}
@@ -127,7 +126,7 @@
*/
public static final void validateFunctionParameter(FunctionParameter param) throws FunctionMetadataException {
if(param == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0053, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0053));
+ throw new FunctionMetadataException("ERR.015.001.0053", QueryPlugin.Util.getString("ERR.015.001.0053")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Validate attributes
@@ -166,7 +165,7 @@
validateIsNotNull(type, "Type"); //$NON-NLS-1$
if(DataTypeManager.getDataTypeClass(type) == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0054, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0054, type));
+ throw new FunctionMetadataException("ERR.015.001.0054", QueryPlugin.Util.getString("ERR.015.001.0054", type)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -227,7 +226,7 @@
*/
private static final void validateIsNotNull(Object object, String objName) throws FunctionMetadataException {
if(object == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0052, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0052, objName));
+ throw new FunctionMetadataException("ERR.015.001.0052", QueryPlugin.Util.getString("ERR.015.001.0052", objName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -241,7 +240,7 @@
*/
private static final void validateLength(String string, int maxLength, String strName) throws FunctionMetadataException {
if(string.length() > maxLength) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0055, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0055,strName, new Integer(maxLength)));
+ throw new FunctionMetadataException("ERR.015.001.0055", QueryPlugin.Util.getString("ERR.015.001.0055",strName, new Integer(maxLength))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -262,14 +261,14 @@
char firstChar = name.charAt(0);
if(! Character.isLetter(firstChar)) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0056, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0056,strName, new Character(firstChar)));
+ throw new FunctionMetadataException("ERR.015.001.0056", QueryPlugin.Util.getString("ERR.015.001.0056",strName, new Character(firstChar))); //$NON-NLS-1$ //$NON-NLS-2$
}
// Then check the rest of the characters
for(int i=1; i<name.length(); i++) {
char ch = name.charAt(i);
if(! (Character.isLetterOrDigit(ch) || ch == '_')) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0057, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0057,strName, new Character(ch)));
+ throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, new Character(ch))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -288,7 +287,7 @@
if(identifier.length() > 0) {
char firstChar = identifier.charAt(0);
if(! Character.isJavaIdentifierStart(firstChar)) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0056, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0056,strName, new Character(firstChar)));
+ throw new FunctionMetadataException("ERR.015.001.0056", QueryPlugin.Util.getString("ERR.015.001.0056",strName, new Character(firstChar))); //$NON-NLS-1$ //$NON-NLS-2$
}
// Then check the rest of the characters
@@ -296,13 +295,13 @@
char ch = identifier.charAt(i);
if(! Character.isJavaIdentifierPart(ch)) {
if(! allowMultiple || ! (ch == '.')) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0057, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0057,strName, new Character(ch)));
+ throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, new Character(ch))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
if(identifier.charAt(identifier.length()-1) == '.') {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0058, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0058,strName));
+ throw new FunctionMetadataException("ERR.015.001.0058", QueryPlugin.Util.getString("ERR.015.001.0058",strName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,7 +33,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -386,7 +385,7 @@
}
return traverseDownForFirstNodeWithPropertyString(propertyKey, value, isStringValue, node, true);
} else {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0009, searchDirection ));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.002.0009", searchDirection )); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,6 @@
import javax.xml.stream.XMLStreamWriter;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -147,7 +146,7 @@
*/
void addElementProperty(String name, Object value ) throws XMLStreamException {
if ( value == null ) {
- throw new IllegalArgumentException( QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0010, name) );
+ throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0010", name) ); //$NON-NLS-1$
}
if (value instanceof Collection){
Iterator i = ((Collection)value).iterator();
@@ -172,7 +171,7 @@
} else if ( obj instanceof Boolean ) {
return getXMLText( (Boolean)obj );
} else {
- throw new IllegalArgumentException( QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0011, obj.getClass().getName() ));
+ throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0011", obj.getClass().getName() )); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -49,7 +49,6 @@
import org.teiid.core.util.LRUCache;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.StringUtil;
-import org.teiid.dqp.DQPPlugin;
import org.teiid.metadata.AbstractMetadataRecord;
import org.teiid.metadata.Column;
import org.teiid.metadata.ColumnSet;
@@ -126,7 +125,7 @@
public static final String DELIMITER_STRING = String.valueOf(DELIMITER_CHAR);
// error message cached to avoid i18n lookup each time
- public static String NOT_EXISTS_MESSAGE = StringUtil.Constants.SPACE+DQPPlugin.Util.getString("TransformationMetadata.does_not_exist._1"); //$NON-NLS-1$
+ public static String NOT_EXISTS_MESSAGE = StringUtil.Constants.SPACE+QueryPlugin.Util.getString("TransformationMetadata.does_not_exist._1"); //$NON-NLS-1$
private static Properties EMPTY_PROPS = new Properties();
@@ -204,7 +203,7 @@
Collection<String> filteredResult = new ArrayList<String>(matches.size());
for (Table table : matches) {
- if (vdbMetaData == null || vdbMetaData.getModel(table.getParent().getName()).isVisible()) {
+ if (vdbMetaData == null || vdbMetaData.isVisible(table.getParent().getName())) {
filteredResult.add(table.getFullName());
}
}
@@ -221,7 +220,7 @@
if (parent == null) {
throw createInvalidRecordTypeException(groupOrElementID);
}
- parent = metadataRecord.getParent();
+ parent = parent.getParent();
if (parent instanceof Schema) {
return parent;
}
@@ -355,7 +354,7 @@
for (StoredProcedureInfo storedProcedureInfo : results) {
Schema schema = (Schema)storedProcedureInfo.getModelID();
- if(vdbMetaData == null || vdbMetaData.getModel(schema.getName()).isVisible()){
+ if(vdbMetaData == null || vdbMetaData.isVisible(schema.getName())){
if (result != null) {
throw new QueryMetadataException(QueryPlugin.Util.getString("ambiguous_procedure", fullyQualifiedProcedureName)); //$NON-NLS-1$
}
@@ -457,7 +456,7 @@
Table tableRecord = (Table) groupID;
if (!tableRecord.isVirtual()) {
- throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.QueryPlan_could_not_be_found_for_physical_group__6")+tableRecord.getFullName()); //$NON-NLS-1$
+ throw new QueryMetadataException(QueryPlugin.Util.getString("TransformationMetadata.QueryPlan_could_not_be_found_for_physical_group__6")+tableRecord.getFullName()); //$NON-NLS-1$
}
String transQuery = tableRecord.getSelectTransformation();
QueryNode queryNode = new QueryNode(tableRecord.getFullName(), transQuery);
@@ -477,7 +476,7 @@
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
if (!tableRecordImpl.isVirtual()) {
- throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__8")+tableRecordImpl.getFullName()); //$NON-NLS-1$
+ throw new QueryMetadataException(QueryPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__8")+tableRecordImpl.getFullName()); //$NON-NLS-1$
}
return ((Table)groupID).getInsertPlan();
}
@@ -486,7 +485,7 @@
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
if (!tableRecordImpl.isVirtual()) {
- throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__10")+tableRecordImpl.getFullName()); //$NON-NLS-1$
+ throw new QueryMetadataException(QueryPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__10")+tableRecordImpl.getFullName()); //$NON-NLS-1$
}
return ((Table)groupID).getUpdatePlan();
}
@@ -495,7 +494,7 @@
ArgCheck.isInstanceOf(Table.class, groupID);
Table tableRecordImpl = (Table)groupID;
if (!tableRecordImpl.isVirtual()) {
- throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.DeletePlan_could_not_be_found_for_physical_group__12")+tableRecordImpl.getFullName()); //$NON-NLS-1$
+ throw new QueryMetadataException(QueryPlugin.Util.getString("TransformationMetadata.DeletePlan_could_not_be_found_for_physical_group__12")+tableRecordImpl.getFullName()); //$NON-NLS-1$
}
return ((Table)groupID).getDeletePlan();
}
@@ -506,7 +505,7 @@
switch(modelConstant) {
default:
- throw new UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + modelConstant); //$NON-NLS-1$
+ throw new UnsupportedOperationException(QueryPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + modelConstant); //$NON-NLS-1$
}
}
@@ -519,7 +518,7 @@
case SupportConstants.Group.UPDATE:
return tableRecord.supportsUpdate();
default:
- throw new UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + groupConstant); //$NON-NLS-1$
+ throw new UnsupportedOperationException(QueryPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + groupConstant); //$NON-NLS-1$
}
}
@@ -554,7 +553,7 @@
case SupportConstants.Element.SIGNED:
return columnRecord.isSigned();
default:
- throw new UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + elementConstant); //$NON-NLS-1$
+ throw new UnsupportedOperationException(QueryPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + elementConstant); //$NON-NLS-1$
}
} else if(elementID instanceof ProcedureParameter) {
ProcedureParameter columnRecord = (ProcedureParameter) elementID;
@@ -583,7 +582,7 @@
case SupportConstants.Element.SIGNED:
return true;
default:
- throw new UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + elementConstant); //$NON-NLS-1$
+ throw new UnsupportedOperationException(QueryPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + elementConstant); //$NON-NLS-1$
}
} else {
@@ -592,7 +591,7 @@
}
private IllegalArgumentException createInvalidRecordTypeException(Object elementID) {
- return new IllegalArgumentException(DQPPlugin.Util.getString("TransformationMetadata.Invalid_type", elementID.getClass().getName())); //$NON-NLS-1$
+ return new IllegalArgumentException(QueryPlugin.Util.getString("TransformationMetadata.Invalid_type", elementID.getClass().getName())); //$NON-NLS-1$
}
public int getMaxSetSize(final Object modelID) throws TeiidComponentException, QueryMetadataException {
@@ -717,7 +716,7 @@
mappingDoc = reader.loadDocument(inputStream);
mappingDoc.setName(groupName);
} catch (Exception e){
- throw new TeiidComponentException(e, DQPPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_virtual_document_{0},_with_body__n{1}_1", groupName, mappingDoc)); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_virtual_document_{0},_with_body__n{1}_1", groupName, mappingDoc)); //$NON-NLS-1$
} finally {
try {
inputStream.close();
@@ -792,7 +791,7 @@
}
if (schema == null) {
- throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_schemas_for_the_document/table____1")+groupName); //$NON-NLS-1$
+ throw new QueryMetadataException(QueryPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_schemas_for_the_document/table____1")+groupName); //$NON-NLS-1$
}
schemas.add(schema);
}
@@ -949,7 +948,7 @@
return null;
}
Resource r = this.vdbEntries.get(resourcePath);
- if (r != null && r.visible) {
+ if (r != null) {
return r.file;
}
return null;
@@ -982,10 +981,8 @@
public String[] getVDBResourcePaths() throws TeiidComponentException, QueryMetadataException {
LinkedList<String> paths = new LinkedList<String>();
for (Map.Entry<String, Resource> entry : this.vdbEntries.entrySet()) {
- if (entry.getValue().visible) {
- paths.add(entry.getKey());
- }
- }
+ paths.add(entry.getKey());
+ }
return paths.toArray(new String[paths.size()]);
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -31,8 +31,8 @@
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.id.IDGenerator;
import org.teiid.core.id.IntegerID;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
@@ -195,7 +195,7 @@
} else if (type == Command.TYPE_DELETE) {
return ((Delete)command).getGroup();
}
- throw new TeiidRuntimeException(QueryExecPlugin.Util.getString("BatchedUpdatePlanner.unrecognized_command", command)); //$NON-NLS-1$
+ throw new TeiidRuntimeException(QueryPlugin.Util.getString("BatchedUpdatePlanner.unrecognized_command", command)); //$NON-NLS-1$
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,8 +27,8 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.id.IDGenerator;
import org.teiid.core.util.Assertion;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.processor.ProcessorPlan;
@@ -288,7 +288,7 @@
break;
}
default:
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("ProcedurePlanner.bad_stmt", stmtType)); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("ProcedurePlanner.bad_stmt", stmtType)); //$NON-NLS-1$
}
return instruction;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -36,8 +36,8 @@
import org.teiid.core.id.IntegerID;
import org.teiid.core.id.IntegerIDFactory;
import org.teiid.core.util.Assertion;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -95,7 +95,6 @@
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.EvaluatableVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class PlanToProcessConverter {
@@ -447,7 +446,7 @@
break;
default:
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0007, NodeConstants.getNodeTypeString(node.getType())));
+ throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0007", NodeConstants.getNodeTypeString(node.getType()))); //$NON-NLS-1$
}
if(processNode != null) {
@@ -472,7 +471,8 @@
return aNode;
}
GroupSymbol group = node.getGroups().iterator().next();
- if (!CoreConstants.SYSTEM_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID())))) {
+ if (!CoreConstants.SYSTEM_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID())))
+ && !CoreConstants.SYSTEM_ADMIN_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID())))) {
return aNode;
}
List projectSymbols = (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS);
@@ -538,7 +538,7 @@
String cbName = metadata.getFullName(modelID);
return cbName;
} catch(QueryMetadataException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0009));
+ throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0009")); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -46,7 +46,6 @@
import org.teiid.language.SQLConstants;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataAdapter;
@@ -105,7 +104,6 @@
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.validator.ValidationVisitor;
@@ -261,7 +259,7 @@
}
if(! appliedHint) {
- String msg = QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
+ String msg = QueryPlugin.Util.getString("ERR.015.004.0010", groupName); //$NON-NLS-1$
if (this.analysisRecord.recordAnnotations()) {
this.analysisRecord.addAnnotation(new Annotation(Annotation.HINTS, msg, "ignoring hint", Priority.MEDIUM)); //$NON-NLS-1$
}
@@ -1036,7 +1034,7 @@
try {
result = QueryParser.getQueryParser().parseCommand(qnode.getQuery());
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0011, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0011, qnode.getGroupName()));
+ throw new QueryResolverException(e, "ERR.015.008.0011", QueryPlugin.Util.getString("ERR.015.008.0011", qnode.getGroupName())); //$NON-NLS-1$ //$NON-NLS-2$
}
//Handle bindings and references
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -378,5 +378,13 @@
}
return ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(toSearch);
}
+
+ public float getCardinality() {
+ Float cardinality = (Float) this.getProperty(NodeConstants.Info.EST_CARDINALITY);
+ if (cardinality == null) {
+ return -1f;
+ }
+ return cardinality;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,7 +27,8 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.SupportConstants;
@@ -83,6 +84,7 @@
private Object modelID;
private QueryMetadataInterface metadata;
private CapabilitiesFinder capFinder;
+ private AnalysisRecord analysisRecord;
// Retrieved during initialization and cached
private SourceCapabilities caps;
@@ -105,48 +107,48 @@
@Override
public void visit(XMLAttributes obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLAttributes not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLNamespaces obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLNamespaces not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLForest obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLForest not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLElement obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLElement not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLSerialize obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLSerialize not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLParse obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLParse not allowed"); //$NON-NLS-1$
}
@Override
public void visit(XMLQuery obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of XMLQuery not allowed"); //$NON-NLS-1$
}
@Override
public void visit(QueryString obj) {
- markInvalid();
+ markInvalid(obj, "Pushdown of QueryString not allowed"); //$NON-NLS-1$
}
public void visit(AggregateSymbol obj) {
try {
if(! CapabilitiesUtil.supportsAggregateFunction(modelID, obj, metadata, capFinder)) {
- markInvalid();
+ markInvalid(obj, "Aggregate function pushdown not supported by source"); //$NON-NLS-1$
}
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e));
@@ -157,7 +159,7 @@
public void visit(CaseExpression obj) {
if(! this.caps.supportsCapability(Capability.QUERY_CASE)) {
- markInvalid();
+ markInvalid(obj, "CaseExpression pushdown not supported by source"); //$NON-NLS-1$
}
}
@@ -186,10 +188,12 @@
// Check if compares are allowed
if(! this.caps.supportsCapability(operatorCap)) {
- markInvalid();
+ markInvalid(obj, "ordered CompareCriteria not supported by source"); //$NON-NLS-1$
+ return;
}
if (negated && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
- markInvalid();
+ markInvalid(obj, "Negation is not supported by source"); //$NON-NLS-1$
+ return;
}
// Check capabilities of the elements
@@ -206,12 +210,8 @@
int operator = crit.getOperator();
// Verify capabilities are supported
- if(operator == CompoundCriteria.OR) {
- // Check if OR is allowed
- if(! this.caps.supportsCapability(Capability.CRITERIA_OR)) {
- markInvalid();
- return;
- }
+ if(operator == CompoundCriteria.OR && !this.caps.supportsCapability(Capability.CRITERIA_OR)) {
+ markInvalid(crit, "OR criteria not supported by source"); //$NON-NLS-1$
}
}
@@ -221,9 +221,13 @@
if (EvaluatableVisitor.willBecomeConstant(obj, true)) {
return;
}
- if(obj.getFunctionDescriptor().getPushdown() == FunctionMethod.CANNOT_PUSHDOWN || ! CapabilitiesUtil.supportsScalarFunction(modelID, obj, metadata, capFinder)) {
- markInvalid();
+ if(obj.getFunctionDescriptor().getPushdown() == FunctionMethod.CANNOT_PUSHDOWN) {
+ markInvalid(obj, "Function metadata indicates it cannot be pusheddown."); //$NON-NLS-1$
+ return;
}
+ if (! CapabilitiesUtil.supportsScalarFunction(modelID, obj, metadata, capFinder)) {
+ markInvalid(obj, obj.isImplicit()?"":"(implicit) convert" + " Function not supported by source"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e));
} catch(TeiidComponentException e) {
@@ -234,12 +238,12 @@
public void visit(IsNullCriteria obj) {
// Check if compares are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_ISNULL)) {
- markInvalid();
+ markInvalid(obj, "IsNull not supported by source"); //$NON-NLS-1$
return;
}
if (obj.isNegated() && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
- markInvalid();
+ markInvalid(obj, "Negation is not supported by source"); //$NON-NLS-1$
return;
}
}
@@ -247,21 +251,21 @@
public void visit(MatchCriteria obj) {
// Check if compares are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_LIKE)) {
- markInvalid();
+ markInvalid(obj, "Like is not supported by source"); //$NON-NLS-1$
return;
}
// Check ESCAPE char if necessary
if(obj.getEscapeChar() != MatchCriteria.NULL_ESCAPE_CHAR) {
if(! this.caps.supportsCapability(Capability.CRITERIA_LIKE_ESCAPE)) {
- markInvalid();
+ markInvalid(obj, "Like escape is not supported by source"); //$NON-NLS-1$
return;
}
}
//check NOT
if(obj.isNegated() && ! this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
- markInvalid();
+ markInvalid(obj, "Negation is not supported by source"); //$NON-NLS-1$
return;
}
@@ -278,18 +282,14 @@
public void visit(NotCriteria obj) {
// Check if compares are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
- markInvalid();
+ markInvalid(obj, "Negation is not supported by source"); //$NON-NLS-1$
return;
}
}
public void visit(SearchedCaseExpression obj) {
- if (this.caps == null) {
- return;
- }
-
if(! this.caps.supportsCapability(Capability.QUERY_SEARCHED_CASE)) {
- markInvalid();
+ markInvalid(obj, "SearchedCase is not supported by source"); //$NON-NLS-1$
}
}
@@ -299,7 +299,7 @@
int maxSize = CapabilitiesUtil.getMaxInCriteriaSize(modelID, metadata, capFinder);
if (maxSize > 0 && crit.getValues().size() > maxSize) {
- markInvalid();
+ markInvalid(crit, "SetCriteria size exceeds maximum for source"); //$NON-NLS-1$
return;
}
} catch(QueryMetadataException e) {
@@ -315,13 +315,13 @@
public void visit(ExistsCriteria crit) {
// Check if exists criteria are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_EXISTS)) {
- markInvalid();
+ markInvalid(crit, "Exists is not supported by source"); //$NON-NLS-1$
return;
}
try {
- if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
- markInvalid();
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder, analysisRecord) == null) {
+ markInvalid(crit.getCommand(), "Subquery cannot be pushed down"); //$NON-NLS-1$
}
} catch (TeiidComponentException e) {
handleException(e);
@@ -346,7 +346,7 @@
break;
}
if(! this.caps.supportsCapability(capability)) {
- markInvalid();
+ markInvalid(crit, "SubqueryCompare not supported by source"); //$NON-NLS-1$
return;
}
@@ -354,8 +354,8 @@
// Check capabilities of the elements
try {
- if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
- markInvalid();
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder, analysisRecord) == null) {
+ markInvalid(crit.getCommand(), "Subquery cannot be pushed down"); //$NON-NLS-1$
}
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e));
@@ -368,11 +368,12 @@
public void visit(ScalarSubquery obj) {
try {
if(!this.caps.supportsCapability(Capability.QUERY_SUBQUERIES_SCALAR)
- || validateSubqueryPushdown(obj, modelID, metadata, capFinder) == null) {
+ || validateSubqueryPushdown(obj, modelID, metadata, capFinder, analysisRecord) == null) {
if (obj.getCommand().getCorrelatedReferences() == null) {
obj.setShouldEvaluate(true);
} else {
- markInvalid();
+ markInvalid(obj.getCommand(), !this.caps.supportsCapability(Capability.QUERY_SUBQUERIES_SCALAR)?
+ "Correlated ScalarSubquery is not supported":"Subquery cannot be pushed down"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} catch(QueryMetadataException e) {
@@ -387,12 +388,12 @@
try {
// Check if compares with subqueries are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_IN_SUBQUERY)) {
- markInvalid();
+ markInvalid(crit, "SubqueryIn is not supported by source"); //$NON-NLS-1$
return;
}
- if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
- markInvalid();
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder, analysisRecord) == null) {
+ markInvalid(crit.getCommand(), "Subquery cannot be pushed down"); //$NON-NLS-1$
}
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e));
@@ -405,12 +406,12 @@
try {
// Check if compares are allowed
if(! this.caps.supportsCapability(Capability.CRITERIA_IN)) {
- markInvalid();
+ markInvalid(crit, "In is not supported by source"); //$NON-NLS-1$
return;
}
if (crit.isNegated() && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
- markInvalid();
+ markInvalid(crit, "Negation is not supported by source"); //$NON-NLS-1$
return;
}
// Check capabilities of the elements
@@ -431,7 +432,7 @@
private void checkElementsAreSearchable(LanguageObject crit, int searchableType)
throws QueryMetadataException, TeiidComponentException {
if (!CapabilitiesUtil.checkElementsAreSearchable(Arrays.asList(crit), metadata, searchableType)) {
- markInvalid();
+ markInvalid(crit, "not all source columns support search type"); //$NON-NLS-1$
}
}
@@ -445,7 +446,7 @@
* @return
* @throws TeiidComponentException
*/
- static Object validateSubqueryPushdown(SubqueryContainer subqueryContainer, Object critNodeModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws TeiidComponentException {
+ static Object validateSubqueryPushdown(SubqueryContainer subqueryContainer, Object critNodeModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord analysisRecord) throws TeiidComponentException {
ProcessorPlan plan = subqueryContainer.getCommand().getProcessorPlan();
if (plan != null) {
if(!(plan instanceof RelationalPlan)) {
@@ -482,7 +483,7 @@
return null;
}
} catch(QueryMetadataException e) {
- throw new TeiidComponentException(e, QueryExecPlugin.Util.getString("RulePushSelectCriteria.Error_getting_modelID")); //$NON-NLS-1$
+ throw new TeiidComponentException(e, QueryPlugin.Util.getString("RulePushSelectCriteria.Error_getting_modelID")); //$NON-NLS-1$
}
}
if (critNodeModelID == null) {
@@ -497,7 +498,7 @@
}
//TODO: this check sees as correlated references as coming from the containing scope
//but this is only an issue with deeply nested subqueries
- if (!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(subqueryContainer.getCommand(), critNodeModelID, metadata, capFinder)) {
+ if (!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(subqueryContainer.getCommand(), critNodeModelID, metadata, capFinder, analysisRecord )) {
return null;
}
}
@@ -519,16 +520,19 @@
return this.exception;
}
- private void markInvalid() {
+ private void markInvalid(LanguageObject object, String reason) {
this.valid = false;
setAbort(true);
+ if (analysisRecord != null && analysisRecord.recordDebug()) {
+ analysisRecord.println(reason + " " + object); //$NON-NLS-1$
+ }
}
public boolean isValid() {
return this.valid;
}
- public static boolean canPushLanguageObject(LanguageObject obj, Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, TeiidComponentException {
+ public static boolean canPushLanguageObject(LanguageObject obj, Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord analysisRecord) throws QueryMetadataException, TeiidComponentException {
if(obj == null) {
return true;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -40,7 +40,7 @@
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.relational.plantree.NodeConstants;
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
@@ -67,7 +67,6 @@
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class FrameUtil {
@@ -300,7 +299,7 @@
try {
return QueryRewriter.rewriteCriteria(criteria, null, null, metadata);
} catch(TeiidProcessingException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0023, criteria));
+ throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0023", criteria)); //$NON-NLS-1$
} catch (TeiidComponentException e) {
throw new TeiidRuntimeException(e);
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/JoinRegion.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/JoinRegion.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/JoinRegion.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -42,6 +42,7 @@
import org.teiid.query.optimizer.relational.plantree.PlanNode;
import org.teiid.query.resolver.util.AccessPattern;
import org.teiid.query.sql.lang.CompareCriteria;
+import org.teiid.query.sql.lang.CompoundCriteria;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
@@ -233,8 +234,10 @@
* @param joinOrder
* @param metadata
* @return
+ * @throws TeiidComponentException
+ * @throws QueryMetadataException
*/
- public double scoreRegion(Object[] joinOrder, QueryMetadataInterface metadata) {
+ public double scoreRegion(Object[] joinOrder, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException {
List<Map.Entry<PlanNode, PlanNode>> joinSourceEntries = new ArrayList<Map.Entry<PlanNode, PlanNode>>(joinSourceNodes.entrySet());
double totalIntermediatCost = 0;
double cost = 1;
@@ -263,17 +266,35 @@
float sourceCost = ((Float)joinSourceRoot.getProperty(NodeConstants.Info.EST_CARDINALITY)).floatValue();
- if (sourceCost == NewCalculateCostUtil.UNKNOWN_VALUE) {
- sourceCost = UNKNOWN_TUPLE_EST;
+ List<PlanNode> applicableCriteria = null;
+
+ if (!criteria.isEmpty() && i > 0) {
+ applicableCriteria = getJoinCriteriaForGroups(groups, criteria);
+ }
+
+ if (sourceCost == NewCalculateCostUtil.UNKNOWN_VALUE) {
+ sourceCost = UNKNOWN_TUPLE_EST;
+ if (applicableCriteria != null && !applicableCriteria.isEmpty()) {
+ CompoundCriteria cc = new CompoundCriteria();
+ for (PlanNode planNode : applicableCriteria) {
+ cc.addCriteria((Criteria) planNode.getProperty(NodeConstants.Info.SELECT_CRITERIA));
+ }
+ sourceCost = (float)cost;
+ criteria.removeAll(applicableCriteria);
+ applicableCriteria = null;
+ if (NewCalculateCostUtil.usesKey(cc, metadata)) {
+ sourceCost = Math.min(UNKNOWN_TUPLE_EST, sourceCost * Math.min(NewCalculateCostUtil.UNKNOWN_JOIN_SCALING, sourceCost));
+ } else {
+ sourceCost = Math.min(UNKNOWN_TUPLE_EST, sourceCost * Math.min(NewCalculateCostUtil.UNKNOWN_JOIN_SCALING * 2, sourceCost));
+ }
+ }
} else if (Double.isInfinite(sourceCost) || Double.isNaN(sourceCost)) {
- sourceCost = UNKNOWN_TUPLE_EST * 10;
+ return Double.MAX_VALUE;
}
-
+
cost *= sourceCost;
- if (!criteria.isEmpty() && i > 0) {
- List<PlanNode> applicableCriteria = getJoinCriteriaForGroups(groups, criteria);
-
+ if (applicableCriteria != null) {
for (PlanNode criteriaNode : applicableCriteria) {
float filter = ((Float)criteriaNode.getProperty(NodeConstants.Info.EST_SELECTIVITY)).floatValue();
@@ -282,7 +303,6 @@
criteria.removeAll(applicableCriteria);
}
-
totalIntermediatCost += cost;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -76,7 +76,8 @@
*/
public class NewCalculateCostUtil {
- public static final float UNKNOWN_VALUE = -1;
+ public static final int UNKNOWN_JOIN_SCALING = 20;
+ public static final float UNKNOWN_VALUE = -1;
// the following variables are used to hold cost estimates (roughly in milliseconds)
private final static float compareTime = .05f; //TODO: a better estimate would be based upon the number of conjuncts
@@ -181,13 +182,13 @@
case NodeConstants.Types.TUPLE_LIMIT:
{
PlanNode child = node.getFirstChild();
- Float childCost = (Float)child.getProperty(NodeConstants.Info.EST_CARDINALITY);
+ float childCost = child.getCardinality();
Expression offset = (Expression)node.getProperty(NodeConstants.Info.OFFSET_TUPLE_COUNT);
Float cost = childCost;
- if (childCost.floatValue() != UNKNOWN_VALUE && offset instanceof Constant) {
- float offsetCost = childCost.floatValue() - ((Number)((Constant)offset).getValue()).floatValue();
+ if (childCost != UNKNOWN_VALUE && offset instanceof Constant) {
+ float offsetCost = childCost - ((Number)((Constant)offset).getValue()).floatValue();
cost = new Float((offsetCost < 0) ? 0 : offsetCost);
}
@@ -277,39 +278,43 @@
private static void estimateJoinNodeCost(PlanNode node, QueryMetadataInterface metadata)
throws QueryMetadataException, TeiidComponentException {
- Iterator children = node.getChildren().iterator();
- PlanNode child1 = (PlanNode)children.next();
- Float childCost1 = (Float)child1.getProperty(NodeConstants.Info.EST_CARDINALITY);
- PlanNode child2 = (PlanNode)children.next();
- Float childCost2 = (Float)child2.getProperty(NodeConstants.Info.EST_CARDINALITY);
- if (childCost1 != null && childCost2 != null && childCost1.floatValue() != UNKNOWN_VALUE && childCost2.floatValue() != UNKNOWN_VALUE){
+ Iterator<PlanNode> children = node.getChildren().iterator();
+ PlanNode child1 = children.next();
+ float childCost1 = child1.getCardinality();
+ PlanNode child2 = children.next();
+ float childCost2 = child2.getCardinality();
+
+ if (childCost1 == UNKNOWN_VALUE || childCost2 == UNKNOWN_VALUE) {
+ setCardinalityEstimate(node, null);
+ return;
+ }
- JoinType joinType = (JoinType)node.getProperty(NodeConstants.Info.JOIN_TYPE);
- List joinCriteria = (List) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
-
- float baseCost = childCost1.floatValue() * childCost2.floatValue();
- if (joinCriteria != null && !joinCriteria.isEmpty()) {
- Criteria crit = Criteria.combineCriteria(joinCriteria);
- baseCost = recursiveEstimateCostOfCriteria(baseCost, node, crit, metadata);
- }
-
- Float cost = null;
- if (JoinType.JOIN_CROSS.equals(joinType)){
- cost = new Float(baseCost);
- } else if (JoinType.JOIN_FULL_OUTER.equals(joinType)) {
- cost = new Float(Math.max((childCost1.floatValue()+childCost2.floatValue()),baseCost));
- } else if (JoinType.JOIN_LEFT_OUTER.equals(joinType)) {
- cost = new Float(Math.max(childCost1.floatValue(),baseCost));
- } else if (JoinType.JOIN_RIGHT_OUTER.equals(joinType)) {
- cost = new Float(Math.max(childCost2.floatValue(),baseCost));
- } else if (JoinType.JOIN_INNER.equals(joinType)) {
- cost = new Float(baseCost);
- }
-
- setCardinalityEstimate(node, cost);
- } else {
- setCardinalityEstimate(node, null);
+ JoinType joinType = (JoinType)node.getProperty(NodeConstants.Info.JOIN_TYPE);
+ List joinCriteria = (List) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
+
+ float baseCost = childCost1 * childCost2;
+
+ if (joinCriteria != null && !joinCriteria.isEmpty()) {
+ Criteria crit = Criteria.combineCriteria(joinCriteria);
+ //TODO: we may be able to get a fairly accurate join estimate if the
+ //unknown side is being joined with a key
+ baseCost = recursiveEstimateCostOfCriteria(baseCost, node, crit, metadata);
}
+
+ Float cost = null;
+ if (JoinType.JOIN_CROSS.equals(joinType)){
+ cost = new Float(baseCost);
+ } else if (JoinType.JOIN_FULL_OUTER.equals(joinType)) {
+ cost = new Float(Math.max((childCost1+childCost2),baseCost));
+ } else if (JoinType.JOIN_LEFT_OUTER.equals(joinType)) {
+ cost = new Float(Math.max(childCost1,baseCost));
+ } else if (JoinType.JOIN_RIGHT_OUTER.equals(joinType)) {
+ cost = new Float(Math.max(childCost2,baseCost));
+ } else if (JoinType.JOIN_INNER.equals(joinType)) {
+ cost = new Float(baseCost);
+ }
+
+ setCardinalityEstimate(node, cost);
}
/**
@@ -321,11 +326,7 @@
throws QueryMetadataException, TeiidComponentException {
PlanNode child = node.getFirstChild();
- Float childCostFloat = (Float)child.getProperty(NodeConstants.Info.EST_CARDINALITY);
- float childCost = UNKNOWN_VALUE;
- if (childCostFloat != null){
- childCost = childCostFloat.floatValue();
- }
+ float childCost = child.getCardinality();
//Get list of conjuncts
Criteria selectCriteria = (Criteria)node.getProperty(NodeConstants.Info.SELECT_CRITERIA);
@@ -350,10 +351,7 @@
//only cost non-correlated TODO: a better estimate for correlated
if (references == null) {
PlanNode child = node.getFirstChild();
- Float childCostFloat = (Float)child.getProperty(NodeConstants.Info.EST_CARDINALITY);
- if (childCostFloat != null) {
- cost = childCostFloat.floatValue();
- }
+ cost = child.getCardinality();
}
}else {
GroupSymbol group = node.getGroups().iterator().next();
@@ -379,7 +377,7 @@
throws QueryMetadataException, TeiidComponentException {
PlanNode child = node.getFirstChild();
- float childCost = ((Float)child.getProperty(NodeConstants.Info.EST_CARDINALITY)).floatValue();
+ float childCost = child.getCardinality();
if(childCost == UNKNOWN_VALUE) {
setCardinalityEstimate(node, null);
@@ -421,12 +419,9 @@
if (compCrit.getOperator() == CompoundCriteria.OR) {
cost = 0;
}
- HashSet<ElementSymbol> elements = new HashSet<ElementSymbol>();
- collectElementsOfValidCriteria(compCrit, elements);
- if (usesKey(elements, metadata)) {
+ if (usesKey(compCrit, metadata)) {
return 1;
}
-
for (Criteria critPart : compCrit.getCriteria()) {
float nextCost = recursiveEstimateCostOfCriteria(childCost, currentNode, critPart, metadata);
@@ -497,7 +492,7 @@
if(criteria instanceof CompoundCriteria) {
CompoundCriteria compCrit = (CompoundCriteria) criteria;
- Iterator iter = compCrit.getCriteria().iterator();
+ Iterator<Criteria> iter = compCrit.getCriteria().iterator();
boolean first = true;
Collection<ElementSymbol> savedElements = elements;
if(compCrit.getOperator() == CompoundCriteria.OR) {
@@ -505,11 +500,11 @@
}
while(iter.hasNext()) {
if(compCrit.getOperator() == CompoundCriteria.AND || first) {
- collectElementsOfValidCriteria((Criteria) iter.next(), elements);
+ collectElementsOfValidCriteria(iter.next(), elements);
first = false;
} else {
HashSet<ElementSymbol> other = new HashSet<ElementSymbol>();
- collectElementsOfValidCriteria((Criteria) iter.next(), other);
+ collectElementsOfValidCriteria(iter.next(), other);
elements.retainAll(other);
}
}
@@ -532,7 +527,6 @@
if (!setCriteria.isNegated()) {
ElementCollectorVisitor.getElements(setCriteria.getExpression(), elements);
}
-
} else if(criteria instanceof IsNullCriteria) {
IsNullCriteria isNullCriteria = (IsNullCriteria)criteria;
if (!isNullCriteria.isNegated()) {
@@ -769,6 +763,12 @@
&& usesKey(allElements, metadata);
}
+ public static boolean usesKey(Criteria crit, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException {
+ HashSet<ElementSymbol> elements = new HashSet<ElementSymbol>();
+ collectElementsOfValidCriteria(crit, elements);
+ return usesKey(elements, metadata);
+ }
+
/**
* TODO: this uses key check is not really accurate, it doesn't take into consideration where
* we are in the plan.
@@ -849,8 +849,8 @@
}
} else if (cardinality != UNKNOWN_VALUE) {
int groupCardinality = metadata.getCardinality(elementSymbol.getGroupSymbol().getMetadataID());
- if (groupCardinality != UNKNOWN_VALUE) {
- ndv *= cardinality / Math.max(1, groupCardinality);
+ if (groupCardinality != UNKNOWN_VALUE && groupCardinality > cardinality) {
+ ndv *= cardinality / Math.max(1, groupCardinality);
}
}
result = Math.max(result, ndv);
@@ -948,7 +948,7 @@
/**
* Computes the cost of a Dependent Join
*
- * The worst possible cost will arise from a high independent ndv (many dependent sets) and a low depenendent ndv (possibly many matches per set)
+ * The worst possible cost will arise from a high independent ndv (many dependent sets) and a low dependent ndv (possibly many matches per set)
*
* This logic uses the same assumption as criteria in that ndv is used as a divisor of cardinality.
*
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,8 +27,8 @@
import java.util.List;
import org.teiid.api.exception.query.QueryPlannerException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -41,7 +41,6 @@
import org.teiid.query.sql.lang.Update;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -116,7 +115,7 @@
}
Object groups = node.getGroups();
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0012, new Object[] {groups, accessPatterns}));
+ throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0012", new Object[] {groups, accessPatterns})); //$NON-NLS-1$
}
public String toString() {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleImplementJoinStrategy.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -150,7 +150,7 @@
if (NewCalculateCostUtil.usesKey(sourceNode, expressions, metadata)) {
joinNode.setProperty(joinNode.getFirstChild() == childNode ? NodeConstants.Info.IS_LEFT_DISTINCT : NodeConstants.Info.IS_RIGHT_DISTINCT, true);
}
- if (attemptPush && RuleRaiseAccess.canRaiseOverSort(sourceNode, metadata, capFinder, sortNode)) {
+ if (attemptPush && RuleRaiseAccess.canRaiseOverSort(sourceNode, metadata, capFinder, sortNode, null)) {
sourceNode.getFirstChild().addAsParent(sortNode);
if (needsCorrection) {
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -36,8 +36,8 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -141,7 +141,7 @@
//quick check for satisfiability
if (!joinRegion.isSatisfiable()) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
}
planForDependencies(joinRegion);
@@ -237,7 +237,7 @@
* Ideally we should be a little smarter in case 2
* - pushing down a same source cross join can be done if we know that a dependent join will be performed
*/
- boolean hasJoinCriteria = false;
+ //boolean hasJoinCriteria = false;
LinkedList<Criteria> joinCriteria = new LinkedList<Criteria>();
Object modelId = RuleRaiseAccess.getModelIDFromAccess(accessNode1, metadata);
SupportedJoinCriteria sjc = CapabilitiesUtil.getSupportedJoinCriteria(modelId, metadata, capFinder);
@@ -250,25 +250,27 @@
if (sources.contains(accessNode1)) {
if (sources.contains(accessNode2) && sources.size() == 2) {
- hasJoinCriteria = true;
+ //hasJoinCriteria = true;
Criteria crit = (Criteria)critNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
- if (RuleRaiseAccess.isSupportedJoinCriteria(sjc, crit, modelId, metadata, capFinder)) {
+ if (RuleRaiseAccess.isSupportedJoinCriteria(sjc, crit, modelId, metadata, capFinder, null)) {
joinCriteriaNodes.add(critNode);
joinCriteria.add(crit);
}
} else if (!accessNodes.containsAll(sources)) {
- hasJoinCriteria = true;
+ //hasJoinCriteria = true;
}
} else if (sources.contains(accessNode2) && !accessNodes.containsAll(sources)) {
- hasJoinCriteria = true;
+ //hasJoinCriteria = true;
}
}
/*
- * If we failed to find direct criteria, but still have non-pushable or criteria to
- * other groups we'll use additional checks
+ * If we failed to find direct criteria, a cross join may still be acceptable
*/
- if ((!hasJoinCriteria || joinCriteriaNodes.isEmpty()) && !canPushCrossJoin(metadata, context, accessNode1, accessNode2)) {
+ if (joinCriteriaNodes.isEmpty() && !canPushCrossJoin(metadata, context, accessNode1, accessNode2)) {
+ //if (hasJoinCriteria) {
+ //a cross join would still be a good idea given that a dependent join can be used
+ //}
continue;
}
@@ -277,7 +279,7 @@
JoinType joinType = joinCriteria.isEmpty()?JoinType.JOIN_CROSS:JoinType.JOIN_INNER;
//try to push to the source
- if (RuleRaiseAccess.canRaiseOverJoin(toTest, metadata, capFinder, joinCriteria, joinType) == null) {
+ if (RuleRaiseAccess.canRaiseOverJoin(toTest, metadata, capFinder, joinCriteria, joinType, null) == null) {
continue;
}
@@ -378,7 +380,7 @@
private void planForDependencies(JoinRegion joinRegion) throws QueryPlannerException {
if (joinRegion.getJoinSourceNodes().isEmpty()) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
}
HashSet<GroupSymbol> currentGroups = new HashSet<GroupSymbol>();
@@ -437,7 +439,7 @@
}
if (!dependentNodes.isEmpty()) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanJoins.cantSatisfy", joinRegion.getUnsatisfiedAccessPatterns())); //$NON-NLS-1$
}
}
@@ -521,7 +523,7 @@
* @param metadata
* @return
*/
- Object[] findBestJoinOrder(JoinRegion region, QueryMetadataInterface metadata) {
+ Object[] findBestJoinOrder(JoinRegion region, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException {
int regionCount = region.getJoinSourceNodes().size();
List<Integer> orderList = new ArrayList<Integer>(regionCount);
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,8 +32,8 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -118,7 +118,7 @@
defaults.add(defaultValue);
if (defaultValue == null && !coveredParams.contains(symbol)) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("RulePlanProcedures.no_values", symbol)); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("RulePlanProcedures.no_values", symbol)); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -386,7 +386,7 @@
projectPlanNode.setProperty(NodeConstants.Info.PROJECT_COLS, projectedViewSymbols);
projectPlanNode.addGroup(group);
if (pushdown) {
- while (RuleRaiseAccess.raiseAccessNode(root, originalNode, metadata, capFinder, true) != null) {
+ while (RuleRaiseAccess.raiseAccessNode(root, originalNode, metadata, capFinder, true, null) != null) {
//continue to raise
}
}
@@ -487,7 +487,7 @@
//check for push down
if (stageGroup.getFirstChild().getType() == NodeConstants.Types.ACCESS
- && RuleRaiseAccess.canRaiseOverGroupBy(stageGroup, stageGroup.getFirstChild(), aggregates, metadata, capFinder)) {
+ && RuleRaiseAccess.canRaiseOverGroupBy(stageGroup, stageGroup.getFirstChild(), aggregates, metadata, capFinder, null)) {
RuleRaiseAccess.performRaise(null, stageGroup.getFirstChild(), stageGroup);
if (stagedGroupingSymbols.isEmpty()) {
RuleRaiseAccess.performRaise(null, stageGroup.getParent(), stageGroup.getParent().getParent());
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -34,8 +34,8 @@
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.Assertion;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -57,7 +57,6 @@
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
public final class RulePushSelectCriteria implements OptimizerRule {
@@ -95,7 +94,7 @@
continue;
}
- PlanNode sourceNode = findOriginatingNode(metadata, capFinder, critNode);
+ PlanNode sourceNode = findOriginatingNode(metadata, capFinder, critNode, analysisRecord);
if(sourceNode == null) {
deadNodes.add(critNode);
@@ -138,7 +137,7 @@
}
private PlanNode findOriginatingNode(QueryMetadataInterface metadata,
- CapabilitiesFinder capFinder, PlanNode critNode)
+ CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record)
throws TeiidComponentException, QueryMetadataException {
if (critNode.getGroups().isEmpty()) {
//check to see if pushing may impact cardinality
@@ -147,7 +146,7 @@
return groupNode;
}
- Object modelId = getSubqueryModelId(metadata, capFinder, critNode);
+ Object modelId = getSubqueryModelId(metadata, capFinder, critNode, record);
if (modelId != null) {
for (PlanNode node : NodeEditor.findAllNodes(critNode, NodeConstants.Types.SOURCE)) {
GroupSymbol group = node.getGroups().iterator().next();
@@ -162,11 +161,11 @@
}
private Object getSubqueryModelId(QueryMetadataInterface metadata,
- CapabilitiesFinder capFinder, PlanNode critNode)
+ CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record)
throws TeiidComponentException, QueryMetadataException {
Object modelId = null;
for (SubqueryContainer subqueryContainer : critNode.getSubqueryContainers()) {
- Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder);
+ Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder, record);
if (validId == null) {
return null;
}
@@ -283,7 +282,7 @@
// Look for situations where we don't allow SELECT to be pushed
if(currentNode.getType() == NodeConstants.Types.ACCESS) {
try {
- if (!RuleRaiseAccess.canRaiseOverSelect(currentNode, metadata, capFinder, critNode)) {
+ if (!RuleRaiseAccess.canRaiseOverSelect(currentNode, metadata, capFinder, critNode, null)) {
return currentNode;
}
@@ -298,7 +297,7 @@
return currentNode.getFirstChild();
}
} catch(QueryMetadataException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0020, currentNode.getGroups()));
+ throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0020", currentNode.getGroups())); //$NON-NLS-1$
}
} else if(currentNode.getType() == NodeConstants.Types.JOIN) {
//pushing below a join is not necessary under an access node
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-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -73,7 +73,7 @@
raisedNode = false;
for (PlanNode accessNode : NodeEditor.findAllNodes(plan, NodeConstants.Types.ACCESS)) {
- PlanNode newRoot = raiseAccessNode(plan, accessNode, metadata, capFinder, afterJoinPlanning);
+ PlanNode newRoot = raiseAccessNode(plan, accessNode, metadata, capFinder, afterJoinPlanning, analysisRecord);
if(newRoot != null) {
raisedNode = true;
plan = newRoot;
@@ -87,7 +87,8 @@
/**
* @return null if nothing changed, and a new plan root if something changed
*/
- static PlanNode raiseAccessNode(PlanNode rootNode, PlanNode accessNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, boolean afterJoinPlanning)
+ static PlanNode raiseAccessNode(PlanNode rootNode, PlanNode accessNode, QueryMetadataInterface metadata,
+ CapabilitiesFinder capFinder, boolean afterJoinPlanning, AnalysisRecord record)
throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
PlanNode parentNode = accessNode.getParent();
@@ -103,7 +104,7 @@
switch(parentNode.getType()) {
case NodeConstants.Types.JOIN:
{
- modelID = canRaiseOverJoin(modelID, parentNode, metadata, capFinder, afterJoinPlanning);
+ modelID = canRaiseOverJoin(modelID, parentNode, metadata, capFinder, afterJoinPlanning, record);
if(modelID != null) {
raiseAccessOverJoin(parentNode, modelID, true);
return rootNode;
@@ -117,7 +118,7 @@
for (int i = 0; i < projectCols.size(); i++) {
SingleElementSymbol symbol = (SingleElementSymbol)projectCols.get(i);
- if(! canPushSymbol(symbol, true, modelID, metadata, capFinder)) {
+ if(! canPushSymbol(symbol, true, modelID, metadata, capFinder, record)) {
return null;
}
}
@@ -138,10 +139,13 @@
{
// If model supports the support constant parameter, then move access node
if(!CapabilitiesUtil.supportsSelectDistinct(modelID, metadata, capFinder)) {
+ recordDebug("cannot push dupremove, since distinct is not supported by source", parentNode, record); //$NON-NLS-1$
return null;
}
+ //TODO: this check is too specific the columns could be used in expressions that are comparable
if (!CapabilitiesUtil.checkElementsAreSearchable((List)NodeEditor.findNodePreOrder(parentNode, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) {
+ recordDebug("cannot push dupremove, since not all columns are comparable at the source", parentNode, record); //$NON-NLS-1$
return null;
}
@@ -149,7 +153,7 @@
}
case NodeConstants.Types.SORT:
{
- if (canRaiseOverSort(accessNode, metadata, capFinder, parentNode)) {
+ if (canRaiseOverSort(accessNode, metadata, capFinder, parentNode, record)) {
return performRaise(rootNode, accessNode, parentNode);
}
return null;
@@ -157,7 +161,7 @@
case NodeConstants.Types.GROUP:
{
Set<AggregateSymbol> aggregates = RulePushAggregates.collectAggregates(parentNode);
- if (canRaiseOverGroupBy(parentNode, accessNode, aggregates, metadata, capFinder)) {
+ if (canRaiseOverGroupBy(parentNode, accessNode, aggregates, metadata, capFinder, record)) {
return performRaise(rootNode, accessNode, parentNode);
}
return null;
@@ -180,7 +184,7 @@
if (parentNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)) {
return null;
}
- if (canRaiseOverSelect(accessNode, metadata, capFinder, parentNode)) {
+ if (canRaiseOverSelect(accessNode, metadata, capFinder, parentNode, record)) {
RulePushSelectCriteria.satisfyAccessPatterns(parentNode, accessNode);
return performRaise(rootNode, accessNode, parentNode);
}
@@ -212,7 +216,7 @@
}
PlanNode newParent = grandParent.getParent();
//TODO: use costing or heuristics instead of always raising
- PlanNode newRoot = raiseAccessNode(rootNode, accessNode, metadata, capFinder, afterJoinPlanning);
+ PlanNode newRoot = raiseAccessNode(rootNode, accessNode, metadata, capFinder, afterJoinPlanning, record);
if (newRoot == null) {
//return the tree to its original state
parentNode.addFirstChild(accessNode);
@@ -291,7 +295,7 @@
PlanNode accessNode,
Collection<? extends SingleElementSymbol> aggregates,
QueryMetadataInterface metadata,
- CapabilitiesFinder capFinder) throws QueryMetadataException,
+ CapabilitiesFinder capFinder, AnalysisRecord record) throws QueryMetadataException,
TeiidComponentException {
Object modelID = getModelIDFromAccess(accessNode, metadata);
if(modelID == null) {
@@ -299,29 +303,36 @@
}
List<SingleElementSymbol> groupCols = (List<SingleElementSymbol>)groupNode.getProperty(NodeConstants.Info.GROUP_COLS);
if(!CapabilitiesUtil.supportsAggregates(groupCols, modelID, metadata, capFinder)) {
+ recordDebug("cannot push group by, since group by is not supported by source", groupNode, record); //$NON-NLS-1$
return false;
}
if (groupCols != null) {
for (SingleElementSymbol singleElementSymbol : groupCols) {
- if (!canPushSymbol(singleElementSymbol, false, modelID, metadata, capFinder)) {
+ if (!canPushSymbol(singleElementSymbol, false, modelID, metadata, capFinder, record)) {
return false;
}
}
}
if (aggregates != null) {
for (SingleElementSymbol aggregateSymbol : aggregates) {
- if(! CriteriaCapabilityValidatorVisitor.canPushLanguageObject(aggregateSymbol, modelID, metadata, capFinder)) {
+ if(! CriteriaCapabilityValidatorVisitor.canPushLanguageObject(aggregateSymbol, modelID, metadata, capFinder, record)) {
return false;
}
}
}
return CapabilitiesUtil.checkElementsAreSearchable(groupCols, metadata, SupportConstants.Element.SEARCHABLE_COMPARE);
}
+
+ private static void recordDebug(String message, PlanNode node, AnalysisRecord record) {
+ if (record != null && record.recordDebug()) {
+ record.println(message + " " + node.nodeToString()); //$NON-NLS-1$
+ }
+ }
static boolean canRaiseOverSort(PlanNode accessNode,
QueryMetadataInterface metadata,
CapabilitiesFinder capFinder,
- PlanNode parentNode) throws QueryMetadataException,
+ PlanNode parentNode, AnalysisRecord record) throws QueryMetadataException,
TeiidComponentException {
// Find the model for this node by getting ACCESS node's model
Object modelID = getModelIDFromAccess(accessNode, metadata);
@@ -333,7 +344,7 @@
List<OrderByItem> sortCols = ((OrderBy)parentNode.getProperty(NodeConstants.Info.SORT_ORDER)).getOrderByItems();
for (OrderByItem symbol : sortCols) {
//TODO: this check shouldn't be necessary, since the order by is not introducing new expressions
- if(! canPushSymbol(symbol.getSymbol(), true, modelID, metadata, capFinder)) {
+ if(! canPushSymbol(symbol.getSymbol(), true, modelID, metadata, capFinder, record)) {
return false;
}
boolean supportsNullOrdering = CapabilitiesUtil.supports(Capability.QUERY_ORDERBY_NULL_ORDERING, modelID, metadata, capFinder);
@@ -407,7 +418,7 @@
static boolean canRaiseOverSelect(PlanNode accessNode,
QueryMetadataInterface metadata,
CapabilitiesFinder capFinder,
- PlanNode parentNode) throws QueryMetadataException,
+ PlanNode parentNode, AnalysisRecord record) throws QueryMetadataException,
TeiidComponentException,
QueryPlannerException {
if (parentNode.hasBooleanProperty(NodeConstants.Info.IS_PHANTOM)) {
@@ -422,6 +433,7 @@
}
if (parentNode.hasBooleanProperty(NodeConstants.Info.IS_HAVING) && !CapabilitiesUtil.supports(Capability.QUERY_HAVING, modelID, metadata, capFinder)) {
+ recordDebug("cannot push having, since having is not supported by source", parentNode, record); //$NON-NLS-1$
return false;
}
@@ -433,7 +445,7 @@
Criteria crit = (Criteria) parentNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
- if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, modelID, metadata, capFinder) ) {
+ if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, modelID, metadata, capFinder, record) ) {
return false;
}
@@ -456,13 +468,14 @@
* @throws QueryMetadataException
* @since 4.1.2
*/
- private static boolean canPushSymbol(SingleElementSymbol symbol, boolean inSelectClause, Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ private static boolean canPushSymbol(SingleElementSymbol symbol, boolean inSelectClause, Object modelID,
+ QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord record)
throws TeiidComponentException, QueryMetadataException {
Expression expr = SymbolMap.getExpression(symbol);
// Do the normal checks
- if(! CriteriaCapabilityValidatorVisitor.canPushLanguageObject(expr, modelID, metadata, capFinder)) {
+ if(! CriteriaCapabilityValidatorVisitor.canPushLanguageObject(expr, modelID, metadata, capFinder, record)) {
return false;
}
@@ -499,7 +512,8 @@
* @return The modelID if the raise can proceed and what common model these combined
* nodes will be sent to
*/
- private static Object canRaiseOverJoin(Object modelId, PlanNode joinNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, boolean afterJoinPlanning)
+ private static Object canRaiseOverJoin(Object modelId, PlanNode joinNode, QueryMetadataInterface metadata,
+ CapabilitiesFinder capFinder, boolean afterJoinPlanning, AnalysisRecord record)
throws QueryMetadataException, TeiidComponentException {
List crits = (List) joinNode.getProperty(NodeConstants.Info.JOIN_CRITERIA);
@@ -536,14 +550,14 @@
}
}
- return canRaiseOverJoin(joinNode.getChildren(), metadata, capFinder, crits, type);
+ return canRaiseOverJoin(joinNode.getChildren(), metadata, capFinder, crits, type, record);
}
static Object canRaiseOverJoin(List<PlanNode> children,
QueryMetadataInterface metadata,
CapabilitiesFinder capFinder,
List<Criteria> crits,
- JoinType type) throws QueryMetadataException,
+ JoinType type, AnalysisRecord record) throws QueryMetadataException,
TeiidComponentException {
//we only want to consider binary joins
if (children.size() != 2) {
@@ -602,7 +616,7 @@
List<Object> rightIds = null;
GroupSymbol leftGroup = null;
for (Criteria crit : crits) {
- if (!isSupportedJoinCriteria(sjc, crit, accessModelID, metadata, capFinder)) {
+ if (!isSupportedJoinCriteria(sjc, crit, accessModelID, metadata, capFinder, record)) {
return null;
}
if (sjc != SupportedJoinCriteria.KEY) {
@@ -663,9 +677,10 @@
/**
* Checks criteria one predicate at a time. Only tests up to the equi restriction.
*/
- static boolean isSupportedJoinCriteria(SupportedJoinCriteria sjc, Criteria crit, Object accessModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ static boolean isSupportedJoinCriteria(SupportedJoinCriteria sjc, Criteria crit, Object accessModelID,
+ QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord record)
throws QueryMetadataException, TeiidComponentException {
- if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, accessModelID, metadata, capFinder) ) {
+ if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, accessModelID, metadata, capFinder, record) ) {
return false;
}
if (sjc == SupportedJoinCriteria.ANY) {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,8 +25,8 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -40,7 +40,6 @@
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.lang.Update;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -72,7 +71,7 @@
if(CapabilitiesUtil.requiresCriteria(modelID, metadata, capFinder)
&& hasNoCriteria((Command) node.getProperty(NodeConstants.Info.ATOMIC_REQUEST))) {
String modelName = metadata.getFullName(modelID);
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0024, modelName));
+ throw new QueryPlannerException(QueryPlugin.Util.getString("ERR.015.004.0024", modelName)); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,7 +30,7 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.mapping.xml.MappingDocument;
import org.teiid.query.mapping.xml.MappingNode;
@@ -44,7 +44,6 @@
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class CriteriaPlanner {
@@ -89,7 +88,7 @@
if (context == null) {
context = otherContext;
} else if (context != otherContext){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0068, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0068, criteria));
+ throw new QueryPlannerException("ERR.015.004.0068", QueryPlugin.Util.getString("ERR.015.004.0068", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -137,7 +136,7 @@
MappingNode elementRsNode = node.getSourceNode();
if (elementRsNode == null) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("CriteriaPlanner.invalid_element", elementSymbol)); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.invalid_element", elementSymbol)); //$NON-NLS-1$
}
String elementRsFullName = elementRsNode.getFullyQualifiedName().toUpperCase();
@@ -154,7 +153,7 @@
continue;
}
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("CriteriaPlanner.invalid_context", elementSymbol, context.getFullyQualifiedName())); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.invalid_context", elementSymbol, context.getFullyQualifiedName())); //$NON-NLS-1$
}
return resultSets;
}
@@ -186,7 +185,7 @@
if (criteriaResultSets.size() != 1) {
//TODO: this assumption could be relaxed if we allow context to be from a document perspective, rather than from a result set
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("CriteriaPlanner.no_context", criteria)); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.no_context", criteria)); //$NON-NLS-1$
}
return (MappingSourceNode)criteriaResultSets.iterator().next();
}
@@ -259,7 +258,7 @@
MappingNode node = MappingNode.findNode(planEnv.mappingDoc, fullyQualifiedNodeName.toUpperCase());
MappingSourceNode sourceNode = node.getSourceNode();
if (sourceNode == null) {
- String msg = QueryExecPlugin.Util.getString("XMLPlanner.The_rowlimit_parameter_{0}_is_not_in_the_scope_of_any_mapping_class", fullyQualifiedNodeName); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("XMLPlanner.The_rowlimit_parameter_{0}_is_not_in_the_scope_of_any_mapping_class", fullyQualifiedNodeName); //$NON-NLS-1$
throw new QueryPlannerException(msg);
}
@@ -268,7 +267,7 @@
// Check for conflicting row limits on the same mapping class
int existingLimit = criteriaRsInfo.getUserRowLimit();
if (existingLimit > 0 && existingLimit != rowLimit) {
- String msg = QueryExecPlugin.Util.getString("XMLPlanner.Criteria_{0}_contains_conflicting_row_limits", wholeCrit); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("XMLPlanner.Criteria_{0}_contains_conflicting_row_limits", wholeCrit); //$NON-NLS-1$
throw new QueryPlannerException(msg);
}
@@ -301,13 +300,13 @@
//assumes that all non-xml group elements are temp elements
boolean hasTempElement = !metadata.isXMLGroup(group.getMetadataID());
if(!first && hasTempElement && resultSet == null) {
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0035, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0035, conjunct));
+ throw new QueryPlannerException("ERR.015.004.0035", QueryPlugin.Util.getString("ERR.015.004.0035", conjunct)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (hasTempElement) {
String currentResultSet = metadata.getFullName(element.getGroupSymbol().getMetadataID());
if (resultSet != null && !resultSet.equalsIgnoreCase(currentResultSet)) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("CriteriaPlanner.multiple_staging", conjunct)); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.multiple_staging", conjunct)); //$NON-NLS-1$
}
resultSet = currentResultSet;
}
@@ -317,7 +316,7 @@
if (resultSet != null) {
Collection functions = ContextReplacerVisitor.replaceContextFunctions(conjunct);
if (!functions.isEmpty()) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("CriteriaPlanner.staging_context")); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.staging_context")); //$NON-NLS-1$
}
//should also throw an exception if it contains a row limit function
@@ -336,7 +335,7 @@
MappingNode contextNode = MappingNode.findNode(planEnv.mappingDoc, targetContext.getCanonicalName());
if (contextNode == null){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0037, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0037, targetContext));
+ throw new QueryPlannerException("ERR.015.004.0037", QueryPlugin.Util.getString("ERR.015.004.0037", targetContext)); //$NON-NLS-1$ //$NON-NLS-2$
}
return contextNode;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -36,8 +36,8 @@
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataAdapter;
@@ -58,7 +58,6 @@
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
@@ -84,7 +83,7 @@
try {
query = QueryParser.getQueryParser().parseCommand(queryNode.getQuery());
} catch (QueryParserException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0054, new Object[]{queryNode.getGroupName(), queryNode.getQuery()}));
+ throw new QueryPlannerException(e, QueryPlugin.Util.getString("ERR.015.004.0054", new Object[]{queryNode.getGroupName(), queryNode.getQuery()})); //$NON-NLS-1$
}
}
return query;
@@ -144,7 +143,7 @@
ResolverUtil.resolveGroup(gs, metadata);
queryNode = metadata.getVirtualPlan(gs.getMetadataID());
} catch (QueryResolverException e) {
- throw new QueryPlannerException(e, ErrorMessageKeys.OPTIMIZER_0029, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0029, groupName));
+ throw new QueryPlannerException(e, "ERR.015.004.0029", QueryPlugin.Util.getString("ERR.015.004.0029", groupName)); //$NON-NLS-1$ //$NON-NLS-2$
}
return queryNode;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,7 +27,7 @@
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.mapping.xml.MappingDocument;
import org.teiid.query.mapping.xml.MappingNode;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -37,7 +37,6 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Symbol;
import org.teiid.query.sql.visitor.AbstractSymbolMappingVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -124,7 +123,7 @@
Collection unmappedSymbols = mappingVisitor.getUnmappedSymbols();
if (unmappedSymbols != null && unmappedSymbols.size() > 0){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0046, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0046, new Object[] {unmappedSymbols, object}));
+ throw new QueryPlannerException("ERR.015.004.0046", QueryPlugin.Util.getString("ERR.015.004.0046", new Object[] {unmappedSymbols, object})); //$NON-NLS-1$ //$NON-NLS-2$
}
return copy;
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,8 +33,8 @@
import org.teiid.core.id.IDGenerator;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.mapping.xml.MappingDocument;
import org.teiid.query.mapping.xml.MappingNode;
import org.teiid.query.mapping.xml.MappingNodeLogger;
@@ -290,7 +290,7 @@
// in the orderby. static nodes do not qualify for ordering.
if (elementNode.getNameInSource() == null){
Object[] params = new Object[] {elementNode, orderBy};
- String msg = QueryExecPlugin.Util.getString("XMLPlanner.The_XML_document_element_{0}_is_not_mapped_to_data_and_cannot_be_used_in_the_ORDER_BY_clause__{1}_1", params); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("XMLPlanner.The_XML_document_element_{0}_is_not_mapped_to_data_and_cannot_be_used_in_the_ORDER_BY_clause__{1}_1", params); //$NON-NLS-1$
throw new QueryPlannerException(msg);
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -37,7 +37,7 @@
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.mapping.xml.MappingBaseNode;
import org.teiid.query.mapping.xml.MappingDocument;
@@ -335,7 +335,7 @@
}
if (!singleParentage) {
- throw new QueryPlannerException(QueryExecPlugin.Util.getString("XMLQueryPlanner.cannot_plan", rsInfo.getCriteria())); //$NON-NLS-1$
+ throw new QueryPlannerException(QueryPlugin.Util.getString("XMLQueryPlanner.cannot_plan", rsInfo.getCriteria())); //$NON-NLS-1$
}
QueryUtil.handleBindings(command, planNode, planEnv);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -38,7 +38,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.BatchCollector.BatchProducer;
import org.teiid.query.util.CommandContext;
@@ -142,7 +142,7 @@
while(currentTime < context.getTimeSliceEnd() || context.isNonBlocking()) {
if (requestCanceled) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("QueryProcessor.request_cancelled", getProcessID())); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("QueryProcessor.request_cancelled", getProcessID())); //$NON-NLS-1$
}
if (currentTime > context.getTimeoutEnd()) {
throw new TeiidProcessingException("Query timed out"); //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.proc;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_SQL;
import java.util.Collections;
import java.util.HashMap;
@@ -41,8 +41,8 @@
import org.teiid.dqp.internal.process.Request;
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.optimizer.QueryOptimizer;
@@ -129,7 +129,7 @@
Object value = procEnv.evaluateExpression(dynamicCommand.getSql());
if (value == null) {
- throw new QueryProcessingException(QueryExecPlugin.Util
+ throw new QueryProcessingException(QueryPlugin.Util
.getString("ExecDynamicSqlInstruction.0")); //$NON-NLS-1$
}
@@ -214,7 +214,7 @@
procEnv.push(dynamicProgram);
} catch (TeiidProcessingException e) {
Object[] params = {dynamicCommand, dynamicCommand.getSql(), e.getMessage()};
- throw new QueryProcessingException(e, QueryExecPlugin.Util.getString("ExecDynamicSqlInstruction.couldnt_execute", params)); //$NON-NLS-1$
+ throw new QueryProcessingException(e, QueryPlugin.Util.getString("ExecDynamicSqlInstruction.couldnt_execute", params)); //$NON-NLS-1$
}
}
@@ -274,7 +274,7 @@
if (dynamicExpectedColumns != null && !dynamicExpectedColumns.isEmpty()) {
if (dynamicExpectedColumns.size() != sourceProjectedSymbolList.size()) {
- throw new QueryProcessingException(QueryExecPlugin.Util
+ throw new QueryProcessingException(QueryPlugin.Util
.getString("ExecDynamicSqlInstruction.4")); //$NON-NLS-1$
}
// If there is only one project symbol, we won't validate the name.
@@ -305,7 +305,7 @@
Object[] params = new Object[] { sourceTypeName,
dynamicSymbol.getShortCanonicalName(),
dynamicTypeName };
- throw new QueryProcessingException(QueryExecPlugin.Util
+ throw new QueryProcessingException(QueryPlugin.Util
.getString("ExecDynamicSqlInstruction.6", params)); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.proc;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_OUTPUT_COLS;
import java.util.ArrayList;
import java.util.Collections;
@@ -46,8 +46,8 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.SupportConstants;
import org.teiid.query.processor.BatchIterator;
@@ -64,7 +64,6 @@
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
*/
@@ -190,7 +189,7 @@
//check constraint
if (value == null && !metadata.elementSupports(param.getMetadataID(), SupportConstants.Element.NULL)) {
- throw new QueryValidatorException(QueryExecPlugin.Util.getString("ProcedurePlan.nonNullableParam", expr)); //$NON-NLS-1$
+ throw new QueryValidatorException(QueryPlugin.Util.getString("ProcedurePlan.nonNullableParam", expr)); //$NON-NLS-1$
}
setParameterValue(param, context, value);
}
@@ -532,7 +531,7 @@
private CursorState getCursorState(String rsKey) throws TeiidComponentException {
CursorState state = this.cursorStates.get(rsKey);
if (state == null) {
- throw new TeiidComponentException(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0037, rsKey));
+ throw new TeiidComponentException(QueryPlugin.Util.getString("ERR.015.006.0037", rsKey)); //$NON-NLS-1$
}
return state;
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,8 @@
package org.teiid.query.processor.relational;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_MODEL_NAME;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_SQL;
import java.util.ArrayList;
import java.util.Collections;
@@ -36,8 +37,8 @@
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.rewriter.QueryRewriter;
import org.teiid.query.sql.lang.Command;
@@ -138,7 +139,7 @@
// Defect 16059 - Rewrite the command once the references have been replaced with values.
QueryRewriter.evaluateAndRewrite(atomicCommand, eval, context, metadata);
} catch (QueryValidatorException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("AccessNode.rewrite_failed", atomicCommand)); //$NON-NLS-1$
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("AccessNode.rewrite_failed", atomicCommand)); //$NON-NLS-1$
}
return RelationalNodeUtil.shouldExecute(atomicCommand, true);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -34,8 +34,8 @@
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.sql.lang.BatchedUpdateCommand;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.util.VariableContext;
@@ -136,7 +136,7 @@
addBatchRow(Arrays.asList(new Object[] {tuple.get(0)}));
} else {
// Should never happen since the number of expected results is known
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("BatchedUpdateNode.unexpected_end_of_batch", commandCount, numExpectedCounts)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("BatchedUpdateNode.unexpected_end_of_batch", commandCount, numExpectedCounts)); //$NON-NLS-1$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.relational;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_SELECT_COLS;
import java.util.ArrayList;
import java.util.Arrays;
@@ -38,8 +38,8 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AliasSymbol;
@@ -48,7 +48,6 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.SelectSymbol;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
public class ProjectNode extends SubqueryAwareRelationalNode {
@@ -218,7 +217,7 @@
Expression expression = ((ExpressionSymbol)symbol).getExpression();
tuple.add(getEvaluator(this.elementMap).evaluate(expression, values));
} else {
- Assertion.failed(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0034, symbol.getClass().getName()));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.006.0034", symbol.getClass().getName())); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -42,7 +42,7 @@
import org.teiid.core.types.ClobType;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.TransformationException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.sql.lang.TextTable;
import org.teiid.query.sql.lang.TextTable.TextColumn;
@@ -179,13 +179,13 @@
index = nameIndexes.get(col.getName());
}
if (index >= vals.size()) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.no_value", col.getName(), textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.no_value", col.getName(), textLine, systemId)); //$NON-NLS-1$
}
val = vals.get(index);
try {
tuple.add(DataTypeManager.transformValue(val, table.getColumns().get(output).getSymbol().getType()));
} catch (TransformationException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("TextTableNode.conversion_error", col.getName(), textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("TextTableNode.conversion_error", col.getName(), textLine, systemId)); //$NON-NLS-1$
}
}
addBatchRow(tuple);
@@ -267,7 +267,7 @@
for (TextColumn col : table.getColumns()) {
Integer index = nameIndexes.get(col.getName().toUpperCase());
if (index == null) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.header_missing", col.getName(), systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.header_missing", col.getName(), systemId)); //$NON-NLS-1$
}
nameIndexes.put(col.getName(), index);
}
@@ -301,7 +301,7 @@
}
line = readLine();
if (line == null) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unclosed", systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.unclosed", systemId)); //$NON-NLS-1$
}
}
char[] chars = line.toCharArray();
@@ -331,7 +331,7 @@
builder.append(chr);
} else {
if (builder.toString().trim().length() != 0) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
}
qualified = true;
builder = new StringBuilder(); //start the entry over
@@ -342,11 +342,11 @@
} else {
if (escaped) {
//don't understand other escape sequences yet
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.unknown_escape", chr, textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.unknown_escape", chr, textLine, systemId)); //$NON-NLS-1$
}
if (wasQualified && !qualified) {
if (!Character.isWhitespace(chr)) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.character_not_allowed", textLine, systemId)); //$NON-NLS-1$
}
//else just ignore
} else {
@@ -371,7 +371,7 @@
private List<String> parseFixedWidth(String line)
throws TeiidProcessingException {
if (line.length() < lineWidth) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("TextTableNode.invalid_width", line.length(), lineWidth, textLine, systemId)); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("TextTableNode.invalid_width", line.length(), lineWidth, textLine, systemId)); //$NON-NLS-1$
}
ArrayList<String> result = new ArrayList<String>();
int beginIndex = 0;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -46,7 +46,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.XMLType;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
@@ -132,7 +132,7 @@
try {
item = result.next();
} catch (XPathException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("XMLTableNode.error", e.getMessage())); //$NON-NLS-1$
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("XMLTableNode.error", e.getMessage())); //$NON-NLS-1$
}
rowCount++;
if (item == null) {
@@ -164,7 +164,7 @@
continue;
}
if (pathIter.next() != null) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("XMLTableName.multi_value", proColumn.getName())); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("XMLTableName.multi_value", proColumn.getName())); //$NON-NLS-1$
}
Object value = Value.convertToJava(colItem);
if (value instanceof Item) {
@@ -184,7 +184,7 @@
value = FunctionDescriptor.importValue(value, proColumn.getSymbol().getType());
tuple.add(value);
} catch (XPathException e) {
- throw new TeiidProcessingException(e, QueryExecPlugin.Util.getString("XMLTableNode.path_error", proColumn.getName())); //$NON-NLS-1$
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("XMLTableNode.path_error", proColumn.getName())); //$NON-NLS-1$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,8 +27,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
-import org.teiid.query.execution.QueryExecPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
+import org.teiid.query.QueryPlugin;
/**
@@ -43,7 +42,7 @@
* Default message included in the RuntimeException thrown from
* {@link #process}
*/
- public static final String DEFAULT_MESSAGE = QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0054);
+ public static final String DEFAULT_MESSAGE = QueryPlugin.Util.getString("ERR.015.006.0054"); //$NON-NLS-1$
/**
* Constructor for AbortProcessingInstruction.
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/AddNodeInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/AddNodeInstruction.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/AddNodeInstruction.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,12 @@
package org.teiid.query.processor.xml;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_DATA_COL;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_DEFAULT;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_NAMESPACE;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_NAMESPACE_DECL;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_OPTIONAL;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_TAG;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -34,7 +39,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -139,9 +144,9 @@
}
if (!success){
- String elem = (isElement ? QueryExecPlugin.Util.getString("AddNodeInstruction.element__1" ) : QueryExecPlugin.Util.getString("AddNodeInstruction.attribute__2")); //$NON-NLS-1$ //$NON-NLS-2$
+ String elem = (isElement ? QueryPlugin.Util.getString("AddNodeInstruction.element__1" ) : QueryPlugin.Util.getString("AddNodeInstruction.attribute__2")); //$NON-NLS-1$ //$NON-NLS-2$
Object[] params = new Object[]{elem, this.descriptor.getQName(), this.descriptor.getNamespaceURI(), this.descriptor.getNamespaceURIs()};
- String msg = QueryExecPlugin.Util.getString("AddNodeInstruction.Unable_to_add_xml_{0}_{1},_namespace_{2},_namespace_declarations_{3}_3", params); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("AddNodeInstruction.Unable_to_add_xml_{0}_{1},_namespace_{2},_namespace_declarations_{3}_3", params); //$NON-NLS-1$
throw new TeiidComponentException(msg);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,8 +28,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogManager;
-import org.teiid.query.execution.QueryExecPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
+import org.teiid.query.QueryPlugin;
import org.xml.sax.SAXException;
@@ -71,7 +70,7 @@
doc.moveToLastChild();
break;
default:
- Assertion.failed(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0051, direction));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.006.0051", direction)); //$NON-NLS-1$
break;
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/NodeDescriptor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/NodeDescriptor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/NodeDescriptor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,7 @@
import java.util.Properties;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.mapping.xml.MappingAttribute;
import org.teiid.query.mapping.xml.MappingElement;
import org.teiid.query.mapping.xml.MappingNode;
@@ -287,7 +287,7 @@
} else if(namespacePrefix.equals(MappingNodeConstants.INSTANCES_NAMESPACE_PREFIX)) {
uri = MappingNodeConstants.INSTANCES_NAMESPACE;
}else {
- String msg = QueryExecPlugin.Util.getString("XMLPlanner.no_uri", new Object[] {namespacePrefix, name}); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString("XMLPlanner.no_uri", new Object[] {namespacePrefix, name}); //$NON-NLS-1$
throw new TeiidComponentException(msg);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,9 +27,8 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -93,7 +92,7 @@
//handle the case of exception on recursion limit reached
if (terminate && this.exceptionOnRecursionLimit){
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0039, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0039));
+ throw new TeiidComponentException("ERR.015.006.0039", QueryPlugin.Util.getString("ERR.015.006.0039")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -31,7 +31,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.mapping.xml.ResultSetInfo;
import org.teiid.query.processor.BatchIterator;
import org.teiid.query.processor.ProcessorDataManager;
@@ -123,7 +123,7 @@
// check if we walked over the row limit
if (this.currentRow != null && this.resultInfo.getUserRowLimit() > 0 && this.currentRowNumber > this.resultInfo.getUserRowLimit()) {
if (this.resultInfo.exceptionOnRowlimit()) {
- throw new TeiidProcessingException(QueryExecPlugin.Util.getString("row_limit_passed", new Object[] { new Integer(this.resultInfo.getUserRowLimit()), this.resultInfo.getResultSetName()})); //$NON-NLS-1$
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("row_limit_passed", new Object[] { new Integer(this.resultInfo.getUserRowLimit()), this.resultInfo.getResultSetName()})); //$NON-NLS-1$
}
// well, we did not throw a exception, that means we need to limit it to current row
this.currentRow = null;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLContext.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLContext.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.util.VariableContext;
@@ -83,7 +83,7 @@
if (this.parentContext != null) {
return this.parentContext.getCurrentRow(aliasResultName);
}
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("results_not_found", aliasResultName)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("results_not_found", aliasResultName)); //$NON-NLS-1$
}
return executor.currentRow();
}
@@ -100,7 +100,7 @@
if (this.parentContext != null) {
return this.parentContext.getNextRow(aliasResultName);
}
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("results_not_found", aliasResultName)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("results_not_found", aliasResultName)); //$NON-NLS-1$
}
return executor.nextRow();
}
@@ -138,7 +138,7 @@
if (this.parentContext != null) {
return this.parentContext.getOutputElements(resultName);
}
- throw new TeiidComponentException(QueryExecPlugin.Util.getString("results_not_found", resultName)); //$NON-NLS-1$
+ throw new TeiidComponentException(QueryPlugin.Util.getString("results_not_found", resultName)); //$NON-NLS-1$
}
return executor.getOutputElements();
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.xml;
-import static org.teiid.query.analysis.AnalysisRecord.*;
+import static org.teiid.query.analysis.AnalysisRecord.PROP_OUTPUT_COLS;
import java.io.IOException;
import java.io.InputStream;
@@ -53,15 +53,14 @@
import org.teiid.core.types.XMLType;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.xml.sax.Attributes;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
@@ -226,7 +225,7 @@
if (xmlSchemas == null || xmlSchemas.isEmpty()){
// if there is no schema no need to validate
// return a warning saying there is no schema
- TeiidException noSchema = new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0042, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0042));
+ TeiidException noSchema = new TeiidComponentException("ERR.015.006.0042", QueryPlugin.Util.getString("ERR.015.006.0042")); //$NON-NLS-1$ //$NON-NLS-2$
addWarning(noSchema);
return;
}
@@ -389,7 +388,7 @@
} catch (Exception e){
e.printStackTrace();
LogManager.logWarning(LogConstants.CTX_XML_PLAN, e,
- QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0001));
+ QueryPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
}
return "XMLPlan"; //$NON-NLS-1$
}
@@ -440,13 +439,13 @@
}
public void error(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0049, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0049", QueryPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
public void fatalError(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0048, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0048", QueryPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
public void warning(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0049, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0049", QueryPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/report/ActivityReport.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/report/ActivityReport.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/report/ActivityReport.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import java.util.Iterator;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -74,7 +73,7 @@
*/
public void addItem(ReportItem item) {
if(item == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.REPORT_0001));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.007.0001")); //$NON-NLS-1$
}
this.items.add(item);
@@ -87,7 +86,7 @@
*/
public void addItems(Collection items) {
if(items == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.REPORT_0001));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.007.0001")); //$NON-NLS-1$
}
Iterator iter = items.iterator();
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -46,7 +46,6 @@
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public abstract class ProcedureContainerResolver implements CommandResolver {
@@ -88,7 +87,7 @@
try {
subCommand = parser.parseCommand(plan);
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0045, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0045, group));
+ throw new QueryResolverException(e, "ERR.015.008.0045", QueryPlugin.Util.getString("ERR.015.008.0045", group)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(subCommand instanceof CreateUpdateProcedureCommand){
@@ -204,7 +203,7 @@
String plan = getPlan(metadata, procCommand.getGroup());
if(plan == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0009, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0009, procCommand.getGroup(), procCommand.getClass().getSimpleName()));
+ throw new QueryResolverException("ERR.015.008.0009", QueryPlugin.Util.getString("ERR.015.008.0009", procCommand.getGroup(), procCommand.getClass().getSimpleName())); //$NON-NLS-1$ //$NON-NLS-2$
}
return plan;
}
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -57,7 +57,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -154,7 +153,7 @@
}
if(!namedParameters && (inputParams != inputExpressions.size())) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0007, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0007, new Object[] {new Integer(inputParams), new Integer(inputExpressions.size()), storedProcedureCommand.getGroup().toString()}));
+ throw new QueryResolverException("ERR.015.008.0007", QueryPlugin.Util.getString("ERR.015.008.0007", new Object[] {new Integer(inputParams), new Integer(inputExpressions.size()), storedProcedureCommand.getGroup().toString()})); //$NON-NLS-1$ //$NON-NLS-2$
}
// Walk through the resolved parameters and set the expressions from the
@@ -268,7 +267,7 @@
// and add implicit conversion if necessary
Class exprType = expr.getType();
if(paramType == null || exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0061, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0061, storedProcedureCommand.getProcedureName(), param.getName()));
+ throw new QueryResolverException("ERR.015.008.0061", QueryPlugin.Util.getString("ERR.015.008.0061", storedProcedureCommand.getProcedureName(), param.getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
String tgtType = DataTypeManager.getDataTypeName(paramType);
String srcType = DataTypeManager.getDataTypeName(exprType);
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -57,7 +57,6 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -151,7 +150,7 @@
try {
resolveList(insert.getVariables(), metadata, null, groups);
} catch (QueryResolverException e) {
- throw new QueryResolverException(e, QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0054, insert.getGroup(), e.getUnresolvedSymbols()));
+ throw new QueryResolverException(e, QueryPlugin.Util.getString("ERR.015.012.0054", insert.getGroup(), e.getUnresolvedSymbols())); //$NON-NLS-1$
}
}
@@ -176,7 +175,7 @@
// check that # of variables == # of values
if(values.size() != insert.getVariables().size()) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0010, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0010, insert.getVariables().size(), values.size()));
+ throw new QueryResolverException("ERR.015.008.0010", QueryPlugin.Util.getString("ERR.015.008.0010", insert.getVariables().size(), values.size())); //$NON-NLS-1$ //$NON-NLS-2$
}
Iterator valueIter = values.iterator();
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -45,7 +45,6 @@
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public class SetQueryResolver implements CommandResolver {
@@ -76,7 +75,7 @@
QueryResolver.resolveCommand(rightCommand, Collections.EMPTY_MAP, metadata.getMetadata(), analysis, false);
if (firstProject.size() != rightCommand.getProjectedSymbols().size()) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0035, setQuery.getOperation()));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0035", setQuery.getOperation())); //$NON-NLS-1$
}
checkSymbolTypes(firstProjectTypes, rightCommand.getProjectedSymbols());
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -84,7 +84,6 @@
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class SimpleQueryResolver implements CommandResolver {
@@ -140,7 +139,7 @@
String groupAlias = name.substring(0, index);
List<GroupSymbol> groupSymbols = ResolverUtil.findMatchingGroups(groupAlias.toUpperCase(), groups, metadata);
if(groupSymbols.isEmpty() || groupSymbols.size() > 1) {
- String msg = QueryPlugin.Util.getString(groupSymbols.isEmpty()?ErrorMessageKeys.RESOLVER_0047:"SimpleQueryResolver.ambiguous_all_in_group", allInGroupSymbol); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString(groupSymbols.isEmpty()?"ERR.015.008.0047":"SimpleQueryResolver.ambiguous_all_in_group", allInGroupSymbol); //$NON-NLS-1$ //$NON-NLS-2$
QueryResolverException qre = new QueryResolverException(msg);
qre.addUnresolvedSymbol(new UnresolvedSymbolDescription(allInGroupSymbol.toString(), msg));
throw qre;
@@ -374,7 +373,7 @@
visitNode(group);
try {
if (!group.isProcedure() && metadata.isXMLGroup(group.getMetadataID())) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0003, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0003));
+ throw new QueryResolverException("ERR.015.008.0003", QueryPlugin.Util.getString("ERR.015.008.0003")); //$NON-NLS-1$ //$NON-NLS-2$
}
discoveredGroup(group);
if (group.isProcedure()) {
@@ -506,8 +505,8 @@
private void addDiscoveredGroups() {
for (GroupSymbol group : discoveredGroups) {
if (!this.currentGroups.add(group)) {
- String msg = QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0046, group.getName());
- QueryResolverException qre = new QueryResolverException(ErrorMessageKeys.RESOLVER_0046, msg);
+ String msg = QueryPlugin.Util.getString("ERR.015.008.0046", group.getName()); //$NON-NLS-1$
+ QueryResolverException qre = new QueryResolverException("ERR.015.008.0046", msg); //$NON-NLS-1$
qre.addUnresolvedSymbol(new UnresolvedSymbolDescription(group.toString(), msg));
throw new TeiidRuntimeException(qre);
}
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -72,7 +72,6 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -105,7 +104,7 @@
// If still haven't found virtual group, the external metadata is bad
if(virtualGroup == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0012, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0012));
+ throw new QueryResolverException("ERR.015.008.0012", QueryPlugin.Util.getString("ERR.015.008.0012")); //$NON-NLS-1$ //$NON-NLS-2$
}
ResolveVirtualGroupCriteriaVisitor.resolveCriteria(procCommand, virtualGroup, metadata);
@@ -132,7 +131,7 @@
try {
transformCmd = QueryParser.getQueryParser().parseCommand(transformQuery);
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0013, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0013, virtualGroup));
+ throw new QueryResolverException(e, "ERR.015.008.0013", QueryPlugin.Util.getString("ERR.015.008.0013", virtualGroup)); //$NON-NLS-1$ //$NON-NLS-2$
}
QueryResolver.resolveCommand(transformCmd, metadata);
@@ -289,7 +288,7 @@
String groupName = loopStmt.getCursorName();
if (metadata.getMetadataStore().getTempGroupID(groupName) != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0065));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0065")); //$NON-NLS-1$
}
//check - cursor name should not start with #
@@ -314,7 +313,7 @@
case Statement.TYPE_CONTINUE:
break;
default:
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0015, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0015, statement.getType()));
+ throw new QueryResolverException("ERR.015.008.0015", QueryPlugin.Util.getString("ERR.015.008.0015", statement.getType())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -340,7 +339,7 @@
sepIndex = varName.lastIndexOf(ElementSymbol.SEPARATOR);
String groupName = varName.substring(0, sepIndex);
if(!groupName.equals(ProcedureReservedWords.VARIABLES)) {
- handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0031, new Object[]{ProcedureReservedWords.VARIABLES, variable}));
+ handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString("ERR.015.010.0031", new Object[]{ProcedureReservedWords.VARIABLES, variable})); //$NON-NLS-1$
}
}
boolean exists = false;
@@ -351,7 +350,7 @@
//ignore, not already defined
}
if (exists) {
- handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0032, variable.getOutputName()));
+ handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString("ERR.015.010.0032", variable.getOutputName())); //$NON-NLS-1$
}
variable.setType(DataTypeManager.getDataTypeClass(typeName));
variable.setGroupSymbol(variables);
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -56,7 +56,6 @@
import org.teiid.query.sql.visitor.CommandCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -113,11 +112,11 @@
//we throw exceptions in these cases, since the clauses will not be resolved
if (query.getGroupBy() != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0031));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0031")); //$NON-NLS-1$
}
if (query.getHaving() != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0032));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0032")); //$NON-NLS-1$
}
}
@@ -200,7 +199,7 @@
} else if (ss instanceof ExpressionSymbol) {
throw new QueryResolverException(QueryPlugin.Util.getString("XMLQueryResolver.no_expressions_in_select")); //$NON-NLS-1$
} else if (ss instanceof AliasSymbol) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0070, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0070));
+ throw new QueryResolverException("ERR.015.008.0070", QueryPlugin.Util.getString("ERR.015.008.0070")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -388,11 +387,11 @@
try {
ResolverVisitor.resolveLanguageObject(elem, Collections.EMPTY_LIST, externalGroups, metadata);
} catch (QueryResolverException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0019, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0019, critElemName));
+ throw new QueryResolverException(e, "ERR.015.008.0019", QueryPlugin.Util.getString("ERR.015.008.0019", critElemName)); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
// Found multiple matches
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0020, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0020, critElemName));
+ throw new QueryResolverException("ERR.015.008.0020", QueryPlugin.Util.getString("ERR.015.008.0020", critElemName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -44,7 +44,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -75,7 +74,7 @@
* @param metadata source of metadata
*/
public BindVariableVisitor(List bindings, QueryMetadataInterface metadata) {
- ArgCheck.isNotNull(bindings, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0049));
+ ArgCheck.isNotNull(bindings, QueryPlugin.Util.getString("ERR.015.008.0049")); //$NON-NLS-1$
this.bindings = bindings;
this.metadata = metadata;
@@ -118,7 +117,7 @@
try {
bindReference(obj, binding);
} catch(QueryParserException e) {
- handleException(new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0022), e.getMessage()));
+ handleException(new QueryResolverException(QueryPlugin.Util.getString("ERR.015.008.0022"), e.getMessage())); //$NON-NLS-1$
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e, e.getMessage()));
} catch(QueryResolverException e) {
@@ -149,7 +148,7 @@
Expression expr = QueryParser.getQueryParser().parseExpression(binding);
if(!(expr instanceof ElementSymbol)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0025, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0025, expr));
+ throw new QueryResolverException("ERR.015.008.0025", QueryPlugin.Util.getString("ERR.015.008.0025", expr)); //$NON-NLS-1$ //$NON-NLS-2$
}
ElementSymbol element = (ElementSymbol) expr;
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -72,7 +72,6 @@
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -214,7 +213,7 @@
}
//Expression is wrong type and can't convert
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0041, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0041, new Object[] {targetTypeName, sourceExpression, sourceTypeName}));
+ throw new QueryResolverException("ERR.015.008.0041", QueryPlugin.Util.getString("ERR.015.008.0041", new Object[] {targetTypeName, sourceExpression, sourceTypeName})); //$NON-NLS-1$ //$NON-NLS-2$
}
public static Constant convertConstant(String sourceTypeName,
@@ -288,7 +287,7 @@
Reference ref = (Reference)expression;
if (ref.isPositional() && ref.getType() == null) {
if (targetType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0026, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0026, surroundingExpression));
+ throw new QueryResolverException("ERR.015.008.0026", QueryPlugin.Util.getString("ERR.015.008.0026", surroundingExpression)); //$NON-NLS-1$ //$NON-NLS-2$
}
ref.setType(targetType);
}
@@ -351,13 +350,38 @@
for (int i = 0; i < orderBy.getVariableCount(); i++) {
SingleElementSymbol sortKey = orderBy.getVariable(i);
if (sortKey instanceof ElementSymbol) {
- int index = resolveSortKey(fromClauseGroups, knownElements, metadata, isSimpleQuery,
- knownShortNames, (ElementSymbol)sortKey);
- if (index == -1) {
- index = expressions.indexOf(SymbolMap.getExpression(sortKey));
- }
- orderBy.setExpressionPosition(i, index);
- continue;
+ ElementSymbol symbol = (ElementSymbol)sortKey;
+ String groupPart = metadata.getGroupName(symbol.getName());
+ String symbolName = symbol.getName();
+ String shortName = symbol.getShortName();
+ if (groupPart == null) {
+ int position = -1;
+ SingleElementSymbol matchedSymbol = null;
+ // walk the SELECT col short names, looking for a match on the current ORDER BY 'short name'
+ for(int j=0; j<knownShortNames.length; j++) {
+ if( !shortName.equalsIgnoreCase( knownShortNames[j] )) {
+ continue;
+ }
+ // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
+ if(matchedSymbol != null) {
+ if (!matchedSymbol.equals(knownElements.get(j))) {
+ throw new QueryResolverException("ERR.015.008.0042", QueryPlugin.Util.getString("ERR.015.008.0042", symbolName)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ continue;
+ }
+ matchedSymbol = knownElements.get(j);
+ position = j;
+ }
+ if (matchedSymbol != null) {
+ TempMetadataID tempMetadataID = new TempMetadataID(symbol.getName(), matchedSymbol.getType());
+ symbol.setMetadataID(tempMetadataID);
+ symbol.setType(matchedSymbol.getType());
+ }
+ if (position != -1) {
+ orderBy.setExpressionPosition(i, position);
+ continue;
+ }
+ }
} else if (sortKey instanceof ExpressionSymbol) {
// check for legacy positional
ExpressionSymbol es = (ExpressionSymbol)sortKey;
@@ -377,75 +401,22 @@
throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.setquery_order_expression", sortKey)); //$NON-NLS-1$
}
for (ElementSymbol symbol : ElementCollectorVisitor.getElements(sortKey, false)) {
- resolveSortKey(fromClauseGroups, null, metadata, isSimpleQuery, null, symbol);
+ try {
+ ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, command.getExternalGroupContexts(), metadata);
+ } catch(QueryResolverException e) {
+ throw new QueryResolverException(e, "ERR.015.008.0043", QueryPlugin.Util.getString("ERR.015.008.0043", symbol.getName()) );//$NON-NLS-1$ //$NON-NLS-2$
+ }
}
ResolverVisitor.resolveLanguageObject(sortKey, metadata);
int index = expressions.indexOf(SymbolMap.getExpression(sortKey));
+ if (index == -1 && !isSimpleQuery) {
+ throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", sortKey)); //$NON-NLS-1$
+ }
orderBy.setExpressionPosition(i, index);
}
}
- private static int resolveSortKey(List fromClauseGroups, List knownElements,
- QueryMetadataInterface metadata, boolean isSimpleQuery,
- String[] knownShortNames, ElementSymbol symbol) throws TeiidComponentException,
- QueryMetadataException, QueryResolverException {
- SingleElementSymbol matchedSymbol = null;
- String symbolName = symbol.getName();
- String groupPart = metadata.getGroupName(symbolName);
- String shortName = symbol.getShortName();
-
- //check for union order by
- if (fromClauseGroups.isEmpty() && groupPart != null && !shortName.equals(symbolName)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbolName));
- }
-
- if (knownShortNames != null) {
- // walk the SELECT col short names, looking for a match on the current ORDER BY 'short name'
- for(int i=0; i<knownShortNames.length; i++) {
- if( shortName.equalsIgnoreCase( knownShortNames[i] )) {
- if (groupPart != null) {
- Object knownSymbol = knownElements.get(i);
- if(knownSymbol instanceof ElementSymbol) {
- ElementSymbol knownElement = (ElementSymbol) knownSymbol;
- GroupSymbol group = knownElement.getGroupSymbol();
-
- // skip this one if the two short names are not from the same group
- if (!nameMatchesGroup(groupPart.toUpperCase(), group.getCanonicalName())) {
- continue;
- }
- }
- }
-
- // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
- if(matchedSymbol != null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
- }
- matchedSymbol = (SingleElementSymbol)knownElements.get(i);
- }
- }
- if (matchedSymbol != null) {
- TempMetadataID tempMetadataID = new TempMetadataID(symbol.getName(), matchedSymbol.getType());
- int position = knownElements.indexOf(matchedSymbol);
- symbol.setMetadataID(tempMetadataID);
- symbol.setType(matchedSymbol.getType());
- return position;
- }
- }
-
- if (!isSimpleQuery) {
- throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", symbol.getName())); //$NON-NLS-1$
- }
- // Didn't find it by full name or short name, so try resolving
- try {
- ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, metadata);
- } catch(QueryResolverException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbol.getName()) );
- }
- return -1;
- }
-
-
/**
* Get the default value for the parameter, which could be null
* if the parameter is set to NULLABLE. If no default is available,
@@ -786,13 +757,13 @@
// single projected symbol of the subquery
Class exprType = expression.getType();
if(exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, expression));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", expression)); //$NON-NLS-1$ //$NON-NLS-2$
}
String exprTypeName = DataTypeManager.getDataTypeName(exprType);
Collection projectedSymbols = crit.getCommand().getProjectedSymbols();
if (projectedSymbols.size() != 1){
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0032, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0032, crit.getCommand()));
+ throw new QueryResolverException("ERR.015.008.0032", QueryPlugin.Util.getString("ERR.015.008.0032", crit.getCommand())); //$NON-NLS-1$ //$NON-NLS-2$
}
Class subqueryType = ((Expression)projectedSymbols.iterator().next()).getType();
String subqueryTypeName = DataTypeManager.getDataTypeName(subqueryType);
@@ -800,7 +771,7 @@
try {
result = convertExpression(expression, exprTypeName, subqueryTypeName, metadata);
} catch (QueryResolverException qre) {
- throw new QueryResolverException(qre, ErrorMessageKeys.RESOLVER_0033, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0033, crit));
+ throw new QueryResolverException(qre, "ERR.015.008.0033", QueryPlugin.Util.getString("ERR.015.008.0033", crit)); //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
}
@@ -810,17 +781,17 @@
ResolvedLookup result = new ResolvedLookup();
// Special code to handle setting return type of the lookup function to match the type of the return element
if( !(args[0] instanceof Constant) || !(args[1] instanceof Constant) || !(args[2] instanceof Constant)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0063, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0063));
+ throw new QueryResolverException("ERR.015.008.0063", QueryPlugin.Util.getString("ERR.015.008.0063")); //$NON-NLS-1$ //$NON-NLS-2$
}
// If code table name in lookup function refers to temp group throw exception
GroupSymbol groupSym = new GroupSymbol((String) ((Constant)args[0]).getValue());
try {
groupSym.setMetadataID(metadata.getGroupID((String) ((Constant)args[0]).getValue()));
if (groupSym.getMetadataID() instanceof TempMetadataID) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0065, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0065, ((Constant)args[0]).getValue()));
+ throw new QueryResolverException("ERR.015.008.0065", QueryPlugin.Util.getString("ERR.015.008.0065", ((Constant)args[0]).getValue())); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, ((Constant)args[0]).getValue()));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", ((Constant)args[0]).getValue())); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setGroup(groupSym);
@@ -831,7 +802,7 @@
try {
ResolverVisitor.resolveLanguageObject(returnElement, groups, metadata);
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, returnElementName));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", returnElementName)); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setReturnElement(returnElement);
@@ -840,7 +811,7 @@
try {
ResolverVisitor.resolveLanguageObject(keyElement, groups, metadata);
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, keyElementName));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", keyElementName)); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setKeyElement(keyElement);
args[3] = convertExpression(args[3], DataTypeManager.getDataTypeName(keyElement.getType()), metadata);
@@ -919,7 +890,7 @@
// didn't find this group ID
}
} else if(matches > 1) {
- throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0055));
+ throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString("ERR.015.008.0055")); //$NON-NLS-1$
}
}
}
@@ -936,7 +907,7 @@
}
if(groupID == null) {
- throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0056));
+ throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString("ERR.015.008.0056")); //$NON-NLS-1$
}
// set real metadata ID in the symbol
symbol.setMetadataID(groupID);
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -70,7 +70,6 @@
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.XMLQuery;
import org.teiid.query.sql.symbol.XMLSerialize;
-import org.teiid.query.util.ErrorMessageKeys;
public class ResolverVisitor extends LanguageVisitor {
@@ -184,7 +183,7 @@
resolveAgainstGroups(shortCanonicalName, matchedGroups, matches);
if (matches.size() > 1) {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0053, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0053", elementSymbol)); //$NON-NLS-1$
return;
}
@@ -199,9 +198,9 @@
if (matches.isEmpty()) {
if (groupMatched) {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0054, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0054", elementSymbol)); //$NON-NLS-1$
} else {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0051, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0051", elementSymbol)); //$NON-NLS-1$
}
return;
}
@@ -307,7 +306,7 @@
try {
resolveFunction(obj, this.metadata.getFunctionLibrary());
} catch(QueryResolverException e) {
- if (ErrorMessageKeys.RESOLVER_0036.equals(e.getCode()) || ErrorMessageKeys.RESOLVER_0035.equals(e.getCode())) {
+ if ("ERR.015.008.0036".equals(e.getCode()) || "ERR.015.008.0035".equals(e.getCode())) { //$NON-NLS-1$ //$NON-NLS-2$
if (unresolvedFunctions == null) {
unresolvedFunctions = new LinkedHashMap<Function, QueryResolverException>();
}
@@ -442,7 +441,7 @@
types[i] = args[i].getType();
if(types[i] == null) {
if(!(args[i] instanceof Reference)){
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0035, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0035, new Object[] {args[i], function}));
+ throw new QueryResolverException("ERR.015.008.0035", QueryPlugin.Util.getString("ERR.015.008.0035", new Object[] {args[i], function})); //$NON-NLS-1$ //$NON-NLS-2$
}
hasArgWithoutType = true;
}
@@ -466,14 +465,14 @@
FunctionForm form = library.findFunctionForm(function.getName(), args.length);
if(form == null) {
// Unknown function form
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0039, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0039, function));
+ throw new QueryResolverException("ERR.015.008.0039", QueryPlugin.Util.getString("ERR.015.008.0039", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Known function form - but without type information
if (hasArgWithoutType) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0036, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0036, function));
+ throw new QueryResolverException("ERR.015.008.0036", QueryPlugin.Util.getString("ERR.015.008.0036", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Known function form - unable to find implicit conversions
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0040, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0040, function));
+ throw new QueryResolverException("ERR.015.008.0040", QueryPlugin.Util.getString("ERR.015.008.0040", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(fd.getName().equalsIgnoreCase(FunctionLibrary.CONVERT) || fd.getName().equalsIgnoreCase(FunctionLibrary.CAST)) {
@@ -487,7 +486,7 @@
!srcTypeClass.equals(dataTypeClass) &&
!DataTypeManager.isTransformable(srcTypeClass, dataTypeClass)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0037, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0037, new Object[] {DataTypeManager.getDataTypeName(srcTypeClass), dataType}));
+ throw new QueryResolverException("ERR.015.008.0037", QueryPlugin.Util.getString("ERR.015.008.0037", new Object[] {DataTypeManager.getDataTypeName(srcTypeClass), dataType})); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
ResolverUtil.ResolvedLookup lookup = ResolverUtil.resolveLookup(function, metadata);
@@ -588,7 +587,7 @@
criteria.setUpperExpression(ResolverUtil.convertExpression(upper, upperTypeName, commonType, metadata));
} else {
// Couldn't find a common type to implicitly convert to
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0027, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0027, expTypeName, lowerTypeName, criteria));
+ throw new QueryResolverException("ERR.015.008.0027", QueryPlugin.Util.getString("ERR.015.008.0027", expTypeName, lowerTypeName, criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// invariants: exp.getType() == lower.getType() == upper.getType()
}
@@ -649,7 +648,7 @@
if (commonType == null) {
// Neither are aggs, but types can't be reconciled
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0027, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0027, new Object[] { leftTypeName, rightTypeName, ccrit }));
+ throw new QueryResolverException("ERR.015.008.0027", QueryPlugin.Util.getString("ERR.015.008.0027", new Object[] { leftTypeName, rightTypeName, ccrit })); //$NON-NLS-1$ //$NON-NLS-2$
}
ccrit.setLeftExpression(ResolverUtil.convertExpression(leftExpression, leftTypeName, commonType, metadata) );
ccrit.setRightExpression(ResolverUtil.convertExpression(rightExpression, rightTypeName, commonType, metadata) );
@@ -690,7 +689,7 @@
result = ResolverUtil.convertExpression(expr, type, DataTypeManager.DefaultDataTypes.CLOB, metadata);
} else {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0029, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0029, mcrit));
+ throw new QueryResolverException("ERR.015.008.0029", QueryPlugin.Util.getString("ERR.015.008.0029", mcrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -703,7 +702,7 @@
// Check that each of the values are the same type as expression
Class exprType = scrit.getExpression().getType();
if(exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, scrit.getExpression()));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", scrit.getExpression())); //$NON-NLS-1$ //$NON-NLS-2$
}
String exprTypeName = DataTypeManager.getDataTypeName(exprType);
@@ -744,9 +743,9 @@
while(valIter.hasNext()) {
Expression value = (Expression) valIter.next();
if(value.getType() == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, value));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", value)); //$NON-NLS-1$ //$NON-NLS-2$
} else if(! value.getType().equals(setType)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0031, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0031, scrit));
+ throw new QueryResolverException("ERR.015.008.0031", QueryPlugin.Util.getString("ERR.015.008.0031", scrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -754,7 +753,7 @@
scrit.setExpression(ResolverUtil.convertExpression(scrit.getExpression(), exprTypeName, setTypeName, metadata));
} else {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0031, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0031, scrit));
+ throw new QueryResolverException("ERR.015.008.0031", QueryPlugin.Util.getString("ERR.015.008.0031", scrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -828,11 +827,11 @@
// 3. Perform implicit type conversions
String whenTypeName = ResolverUtil.getCommonType((String[])whenTypeNames.toArray(new String[whenTypeNames.size()]));
if (whenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "WHEN", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "WHEN", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
String thenTypeName = ResolverUtil.getCommonType((String[])thenTypeNames.toArray(new String[thenTypeNames.size()]));
if (thenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "THEN/ELSE", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "THEN/ELSE", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
obj.setExpression(ResolverUtil.convertExpression(obj.getExpression(), whenTypeName, metadata));
ArrayList whens = new ArrayList(whenCount);
@@ -918,7 +917,7 @@
// 3. Perform implicit type conversions
String thenTypeName = ResolverUtil.getCommonType((String[])thenTypeNames.toArray(new String[thenTypeNames.size()]));
if (thenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "THEN/ELSE", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "THEN/ELSE", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
ArrayList thens = new ArrayList(whenCount);
for (int i = 0; i < whenCount; i++) {
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -55,8 +55,8 @@
import org.teiid.core.util.Assertion;
import org.teiid.core.util.TimestampWithTimezone;
import org.teiid.language.SQLConstants.NonReserved;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.function.FunctionMethods;
@@ -150,7 +150,6 @@
import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
import org.teiid.query.sql.visitor.EvaluatableVisitor.EvaluationLevel;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.translator.SourceSystemFunctions;
@@ -395,7 +394,7 @@
whileStatement.setCondition(crit);
if(crit.equals(TRUE_CRITERIA)) {
- throw new QueryValidatorException(QueryExecPlugin.Util.getString("QueryRewriter.infinite_while")); //$NON-NLS-1$
+ throw new QueryValidatorException(QueryPlugin.Util.getString("QueryRewriter.infinite_while")); //$NON-NLS-1$
} else if(crit.equals(FALSE_CRITERIA) || crit.equals(UNKNOWN_CRITERIA)) {
return null;
}
@@ -590,7 +589,7 @@
try {
ResolverVisitor.resolveLanguageObject(translatedCriteria, metadata);
} catch(TeiidException ex) {
- throw new QueryValidatorException(ex, ErrorMessageKeys.REWRITER_0002, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0002, translatedCriteria));
+ throw new QueryValidatorException(ex, "ERR.015.009.0002", QueryPlugin.Util.getString("ERR.015.009.0002", translatedCriteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
return translatedCriteria;
@@ -851,17 +850,20 @@
for (int i = 0; i < orderBy.getVariableCount(); i++) {
SingleElementSymbol querySymbol = orderBy.getVariable(i);
int index = orderBy.getExpressionPosition(i);
+ boolean isUnrelated = false;
if (index == -1) {
unrelatedItems.add(orderBy.getOrderByItems().get(i));
- hasUnrelatedExpression |= (querySymbol instanceof ExpressionSymbol);
- continue; // must be unrelated
+ isUnrelated = (querySymbol instanceof ExpressionSymbol);
+ } else {
+ querySymbol = (SingleElementSymbol)projectedSymbols.get(index);
}
- querySymbol = (SingleElementSymbol)projectedSymbols.get(index);
Expression expr = SymbolMap.getExpression(querySymbol);
- if (!previousExpressions.add(expr) || (queryCommand instanceof Query && EvaluatableVisitor.isFullyEvaluatable(expr, true))) {
+ if (!previousExpressions.add(expr) || (queryCommand instanceof Query && EvaluatableVisitor.willBecomeConstant(expr))) {
orderBy.removeOrderByItem(i--);
+ } else if (!isUnrelated) {
+ orderBy.getOrderByItems().get(i).setSymbol((SingleElementSymbol)querySymbol.clone());
} else {
- orderBy.getOrderByItems().get(i).setSymbol((SingleElementSymbol)querySymbol.clone());
+ hasUnrelatedExpression = true;
}
}
if (orderBy.getVariableCount() == 0) {
@@ -1165,7 +1167,7 @@
return FALSE_CRITERIA;
} catch(ExpressionEvaluationException e) {
- throw new QueryValidatorException(e, ErrorMessageKeys.REWRITER_0001, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0001, crit));
+ throw new QueryValidatorException(e, "ERR.015.009.0001", QueryPlugin.Util.getString("ERR.015.009.0001", crit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -1380,7 +1382,7 @@
Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() } );
combinedConst = new Constant(result, descriptor.getReturnType());
} catch(FunctionExecutionException e) {
- throw new QueryValidatorException(e, ErrorMessageKeys.REWRITER_0003, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0003, e.getMessage()));
+ throw new QueryValidatorException(e, "ERR.015.009.0003", QueryPlugin.Util.getString("ERR.015.009.0003", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
Function conversion = new Function(descriptor.getName(), new Expression[] { rightExpr, const1 });
@@ -2493,7 +2495,7 @@
if (result == null) {
result = changingValue;
} else if (!result.equals(changingValue)) {
- throw new QueryValidatorException(QueryExecPlugin.Util.getString("VariableSubstitutionVisitor.Input_vars_should_have_same_changing_state", expr)); //$NON-NLS-1$
+ throw new QueryValidatorException(QueryPlugin.Util.getString("VariableSubstitutionVisitor.Input_vars_should_have_same_changing_state", expr)); //$NON-NLS-1$
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -24,7 +24,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* <p>The common functionality of a {@link CompareCriteria} and a
@@ -79,7 +78,7 @@
*/
public void setOperator( int operator ) {
if (operator < EQ || operator > GE) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0001, operator));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0001", operator)); //$NON-NLS-1$
}
this.operator = operator;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -30,7 +30,6 @@
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -128,7 +127,7 @@
*/
public void setOperator(int operator) {
if (!isValidOperator(operator)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0002, operator));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0002", operator)); //$NON-NLS-1$
}
this.operator = operator;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -34,7 +34,6 @@
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -105,7 +104,7 @@
*/
public void replaceSymbols( Collection symbols ) {
if(symbols == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0003));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0003")); //$NON-NLS-1$
}
this.symbols = new ArrayList(symbols);
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -33,7 +33,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -126,7 +125,7 @@
public void setParameterType(int parameterType){
// validate against above types
if(parameterType < ParameterInfo.IN || parameterType > ParameterInfo.RESULT_SET) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0006, parameterType));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0006", parameterType)); //$NON-NLS-1$
}
this.parameterType = parameterType;
}
@@ -244,7 +243,7 @@
*/
public ElementSymbol getResultSetColumn(int position){
if(resultSetColumns == null){
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0009));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0009")); //$NON-NLS-1$
}
//position is 1 based
@@ -252,7 +251,7 @@
if(position >= 0 && position < resultSetColumns.size()) {
return (ElementSymbol) resultSetColumns.get(position);
}
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0010, new Integer(position + 1)));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0010", new Integer(position + 1))); //$NON-NLS-1$
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -39,7 +39,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -149,7 +148,7 @@
*/
public void setParameter(SPParameter parameter){
if(parameter == null){
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0011));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0011")); //$NON-NLS-1$
}
Integer key = new Integer(parameter.getIndex());
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -25,7 +25,6 @@
import org.teiid.core.util.Assertion;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -74,7 +73,7 @@
*/
public void setSymbol(SingleElementSymbol symbol) {
if(symbol instanceof AliasSymbol || symbol == null){
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0029));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.010.0029")); //$NON-NLS-1$
}
this.symbol = symbol;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class CaseExpression extends AbstractCaseExpression {
@@ -68,7 +67,7 @@
*/
public void setExpression(Expression expr) {
if (expr == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0035));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0035")); //$NON-NLS-1$
}
this.expression = expr;
}
@@ -106,18 +105,18 @@
*/
public void setWhen(List when, List then) {
if (when == null || then == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
if (when.size() != then.size() ||
when.size() < 1) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
for (int i = 0 ; i < when.size(); i++) {
if (!(when.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0037));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0037")); //$NON-NLS-1$
}
if (!(then.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0038));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$
}
}
if (this.when != when) {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -58,10 +57,10 @@
// Check that type is valid, then set it
if(type == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0014));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0014")); //$NON-NLS-1$
}
if(! DataTypeManager.getAllDataTypeClasses().contains(type)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0015, type.getName()));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0015", type.getName())); //$NON-NLS-1$
}
assert value == null || type.isAssignableFrom(value.getClass()) : "Invalid value for specified type."; //$NON-NLS-1$
this.type = type;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -24,7 +24,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* <p>This is the server's representation of a metadata group symbol. The group
@@ -132,7 +131,7 @@
*/
public void setMetadataID(Object metadataID) {
if(metadataID == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0016));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0016")); //$NON-NLS-1$
}
this.metadataID = metadataID;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -29,7 +29,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.util.ErrorMessageKeys;
public class SearchedCaseExpression extends AbstractCaseExpression {
@@ -81,18 +80,18 @@
*/
public void setWhen(List when, List then) {
if (when == null || then == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
if (when.size() != then.size() ||
when.size() < 1) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
for (int i = 0 ; i < when.size(); i++) {
if (!(when.get(i) instanceof Criteria)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0039));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0039")); //$NON-NLS-1$
}
if (!(then.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0038));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$
}
}
if (this.when != when) {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -26,7 +26,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -91,7 +90,7 @@
*/
public void setName(String name) {
if(name == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0017));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0017")); //$NON-NLS-1$
}
this.name = name;
this.outputName = null;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.proc.*;
import org.teiid.query.sql.symbol.*;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.validator.UpdateValidationVisitor;
import org.teiid.query.validator.ValidatorReport;
@@ -164,7 +163,7 @@
throws TeiidComponentException, QueryMetadataException{
if(physicalElements.size()!= virtualElements.size()) {
- throw new QueryMetadataException(ErrorMessageKeys.SQL_0018, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0018));
+ throw new QueryMetadataException("ERR.015.010.0018", QueryPlugin.Util.getString("ERR.015.010.0018")); //$NON-NLS-1$ //$NON-NLS-2$
}
//match the physical group elements to the virtual group elements
Modified: trunk/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -28,7 +28,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public class VariableContext {
@@ -66,7 +65,7 @@
}
Object value = variableMap.get(variable);
if (value == null && !variableMap.containsKey(variable)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, variable, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", variable, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.symbol.AllInGroupSymbol;
import org.teiid.query.sql.symbol.AllSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -60,7 +59,7 @@
*/
public ElementCollectorVisitor(Collection<ElementSymbol> elements) {
if(elements == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0021));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0021")); //$NON-NLS-1$
}
this.elements = elements;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,7 +32,6 @@
import org.teiid.query.sql.navigator.DeepPreOrderNavigator;
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -71,7 +70,7 @@
*/
public FunctionCollectorVisitor(Collection functions, String functionName) {
if(functions == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0022));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0022")); //$NON-NLS-1$
}
this.functions = functions;
this.functionName = functionName;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.navigator.DeepPreOrderNavigator;
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -66,7 +65,7 @@
*/
public GroupCollectorVisitor(Collection<GroupSymbol> groups) {
if(groups == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0023));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0023")); //$NON-NLS-1$
}
this.groups = groups;
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -22,6 +22,7 @@
package org.teiid.query.tempdata;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -36,6 +37,10 @@
import org.teiid.api.exception.query.QueryProcessingException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.api.exception.query.QueryValidatorException;
+import org.teiid.cache.Cache;
+import org.teiid.cache.CacheConfiguration;
+import org.teiid.cache.CacheFactory;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBuffer;
@@ -44,6 +49,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.HashCodeUtil;
import org.teiid.core.util.StringUtil;
import org.teiid.dqp.internal.process.CachedResults;
import org.teiid.dqp.internal.process.SessionAwareCache;
@@ -51,9 +57,10 @@
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.eval.Evaluator;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
@@ -87,6 +94,7 @@
import org.teiid.query.tempdata.TempTableStore.MatState;
import org.teiid.query.tempdata.TempTableStore.MatTableInfo;
import org.teiid.query.util.CommandContext;
+import org.teiid.vdb.runtime.VDBKey;
/**
* This proxy ProcessorDataManager is used to handle temporary tables.
@@ -104,15 +112,52 @@
private BufferManager bufferManager;
private SessionAwareCache<CachedResults> cache;
private Executor executor;
+
+ private static class MatTableKey implements Serializable {
+ private static final long serialVersionUID = 5481692896572663992L;
+ String name;
+ VDBKey vdb;
+
+ @Override
+ public int hashCode() {
+ return HashCodeUtil.hashCode(name.hashCode(), vdb);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof MatTableKey)) {
+ return false;
+ }
+ MatTableKey other = (MatTableKey)obj;
+ return this.name.equals(other.name) && this.vdb.equals(other.vdb);
+ }
+ }
+
+ private static class MatTableEntry implements Serializable {
+ private static final long serialVersionUID = 8559613701442751579L;
+ long lastUpdate = System.currentTimeMillis();
+ boolean valid;
+ }
+
+ private Cache<MatTableKey, MatTableEntry> tables;
+ private SessionAwareCache<CachedResults> distributedCache;
public TempTableDataManager(ProcessorDataManager processorDataManager, BufferManager bufferManager,
- Executor executor, SessionAwareCache<CachedResults> cache){
+ Executor executor, SessionAwareCache<CachedResults> cache, SessionAwareCache<CachedResults> distibutedCache, CacheFactory cacheFactory){
this.processorDataManager = processorDataManager;
this.bufferManager = bufferManager;
this.executor = executor;
this.cache = cache;
+ this.distributedCache = distibutedCache;
+ if (distibutedCache != null) {
+ CacheConfiguration cc = new CacheConfiguration(Policy.LRU, -1, -1);
+ tables = cacheFactory.get(Cache.Type.MATTABLES, cc);
+ }
}
-
+
public TupleSource registerRequest(
CommandContext context,
Command command,
@@ -139,7 +184,7 @@
if (command instanceof ProcedureContainer) {
if (command instanceof StoredProcedure) {
StoredProcedure proc = (StoredProcedure)command;
- if (CoreConstants.SYSTEM_MODEL.equals(modelName)) {
+ if (CoreConstants.SYSTEM_ADMIN_MODEL.equals(modelName)) {
TupleSource result = handleSystemProcedures(context, proc);
if (result != null) {
return result;
@@ -188,7 +233,7 @@
Create create = (Create)command;
String tempTableName = create.getTable().getCanonicalName();
if (contextStore.hasTempTable(tempTableName)) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableStore.table_exist_error", tempTableName));//$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableStore.table_exist_error", tempTableName));//$NON-NLS-1$
}
contextStore.addTempTable(tempTableName, create, bufferManager, true);
return CollectionTupleSource.createUpdateCountTupleSource(0);
@@ -259,7 +304,10 @@
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(1).getExpression()).getValue());
- MatState oldState = info.setState(MatState.NEEDS_LOADING, invalidate?Boolean.FALSE:null);
+ if (invalidate) {
+ touchTable(context, matTableName, false);
+ }
+ MatState oldState = info.setState(MatState.NEEDS_LOADING, invalidate?Boolean.FALSE:null, null);
if (oldState == MatState.LOADING) {
return CollectionTupleSource.createUpdateCountTupleSource(-1);
}
@@ -268,18 +316,18 @@
Object matTableId = RelationalPlanner.getGlobalTempTableMetadataId(group, matTableName, context, metadata, AnalysisRecord.createNonRecordingRecord());
GroupSymbol matTable = new GroupSymbol(matTableName);
matTable.setMetadataID(matTableId);
- int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info);
+ int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info, null);
return CollectionTupleSource.createUpdateCountTupleSource(rowCount);
} else if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEWROW)) {
Object groupID = validateMatView(metadata, proc);
Object pk = metadata.getPrimaryKey(groupID);
String matViewName = metadata.getFullName(groupID);
if (pk == null) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableDataManager.row_refresh_pk", matViewName)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.row_refresh_pk", matViewName)); //$NON-NLS-1$
}
List<?> ids = metadata.getElementIDsInKey(pk);
if (ids.size() > 1) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableDataManager.row_refresh_composite", matViewName)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.row_refresh_composite", matViewName)); //$NON-NLS-1$
}
String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase();
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
@@ -288,10 +336,10 @@
}
TempTable tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
if (!tempTable.isUpdatable()) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableDataManager.row_refresh_updatable", matViewName)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.row_refresh_updatable", matViewName)); //$NON-NLS-1$
}
Constant key = (Constant)proc.getParameter(2).getExpression();
- LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.row_refresh", matViewName, key)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.row_refresh", matViewName, key)); //$NON-NLS-1$
String queryString = Reserved.SELECT + " * " + Reserved.FROM + ' ' + matViewName + ' ' + Reserved.WHERE + ' ' + //$NON-NLS-1$
metadata.getFullName(ids.iterator().next()) + " = ?" + ' ' + Reserved.OPTION + ' ' + Reserved.NOCACHE; //$NON-NLS-1$
QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(queryString, matViewName.toUpperCase(), context, key.getValue());
@@ -305,6 +353,7 @@
tuple = Arrays.asList(key.getValue());
}
List<?> result = tempTable.updateTuple(tuple, delete);
+ //TODO: maintain a table log and distribute the events
return CollectionTupleSource.createUpdateCountTupleSource(result != null ? 1 : 0);
}
return null;
@@ -317,7 +366,7 @@
try {
Object groupID = metadata.getGroupID(name);
if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableDataManager.not_implicit_matview", name)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.not_implicit_matview", name)); //$NON-NLS-1$
}
return groupID;
} catch (QueryMetadataException e) {
@@ -340,20 +389,27 @@
if (group.isGlobalTable()) {
final TempTableStore globalStore = context.getGlobalTableStore();
final MatTableInfo info = globalStore.getMatTableInfo(tableName);
+ Long loadTime = null;
+ if (this.distributedCache != null) {
+ MatTableKey key = new MatTableKey();
+ key.name = tableName;
+ key.vdb = new VDBKey(context.getVdbName(), context.getVdbVersion());
+
+ MatTableEntry entry = this.tables.get(key);
+ if (entry != null && entry.lastUpdate > info.getUpdateTime()
+ && info.getState() != MatState.LOADING) {
+ //remote load
+ info.setState(MatState.NEEDS_LOADING, entry.valid, null);
+ loadTime = entry.lastUpdate;
+ }
+ }
boolean load = info.shouldLoad();
if (load) {
if (!info.isValid()) {
//blocking load
- loadGlobalTable(context, group, tableName, globalStore, info);
+ loadGlobalTable(context, group, tableName, globalStore, info, loadTime);
} else {
- Callable<Integer> toCall = new Callable<Integer>() {
- @Override
- public Integer call() throws Exception {
- return loadGlobalTable(context, group, tableName, globalStore, info);
- }
- };
- FutureTask<Integer> task = new FutureTask<Integer>(toCall);
- executor.execute(task);
+ loadAsynch(context, group, tableName, globalStore, info, loadTime);
}
}
table = globalStore.getOrCreateTempTable(tableName, query, bufferManager, false);
@@ -377,11 +433,25 @@
return table.createTupleSource(query.getProjectedSymbols(), query.getCriteria(), query.getOrderBy());
}
+ private void loadAsynch(final CommandContext context,
+ final GroupSymbol group, final String tableName,
+ final TempTableStore globalStore, final MatTableInfo info,
+ final Long loadTime) {
+ Callable<Integer> toCall = new Callable<Integer>() {
+ @Override
+ public Integer call() throws Exception {
+ return loadGlobalTable(context, group, tableName, globalStore, info, loadTime);
+ }
+ };
+ FutureTask<Integer> task = new FutureTask<Integer>(toCall);
+ executor.execute(task);
+ }
+
private int loadGlobalTable(CommandContext context,
GroupSymbol group, final String tableName,
- TempTableStore globalStore, MatTableInfo info)
+ TempTableStore globalStore, MatTableInfo info, Long loadTime)
throws TeiidComponentException, TeiidProcessingException {
- LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.loading", tableName)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loading", tableName)); //$NON-NLS-1$
QueryMetadataInterface metadata = context.getMetadata();
Create create = new Create();
create.setTable(group);
@@ -408,12 +478,37 @@
int rowCount = -1;
try {
String fullName = metadata.getFullName(group.getMetadataID());
- //TODO: order by primary key nulls first - then have an insert ordered optimization
- //TODO: use the getCommand logic in RelationalPlanner to reuse commands for this.
- String transformation = metadata.getVirtualPlan(group.getMetadataID()).getQuery();
- QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(transformation, fullName, context);
- qp.setNonBlocking(true);
- TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
+ TupleSource ts = null;
+ CacheID cid = null;
+ if (distributedCache != null) {
+ cid = new CacheID(new ParseInfo(), fullName, context.getVdbName(),
+ context.getVdbVersion(), context.getConnectionID(), context.getUserName());
+ CachedResults cr = this.distributedCache.get(cid);
+ if (cr != null) {
+ ts = cr.getResults().createIndexedTupleSource();
+ }
+ }
+
+ if (ts == null) {
+ //TODO: coordinate a distributed load
+ //TODO: order by primary key nulls first - then have an insert ordered optimization
+ String transformation = metadata.getVirtualPlan(group.getMetadataID()).getQuery();
+ QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(transformation, fullName, context);
+ qp.setNonBlocking(true);
+
+ if (distributedCache != null) {
+ CachedResults cr = new CachedResults();
+ BatchCollector bc = qp.createBatchCollector();
+ TupleBuffer tb = bc.collectTuples();
+ cr.setResults(tb);
+ touchTable(context, fullName, true);
+ this.distributedCache.put(cid, FunctionMethod.VDB_DETERMINISTIC, cr, info.getTtl());
+ ts = tb.createIndexedTupleSource();
+ } else {
+ ts = new BatchCollector.BatchProducerTupleSource(qp);
+ }
+ }
+
//TODO: if this insert fails, it's unnecessary to do the undo processing
table.insert(ts, table.getColumns());
rowCount = table.getRowCount();
@@ -428,23 +523,32 @@
}
table.setUpdatable(updatable);
} catch (TeiidComponentException e) {
- LogManager.logError(LogConstants.CTX_MATVIEWS, e, QueryExecPlugin.Util.getString("TempTableDataManager.failed_load", tableName)); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_MATVIEWS, e, QueryPlugin.Util.getString("TempTableDataManager.failed_load", tableName)); //$NON-NLS-1$
throw e;
} catch (TeiidProcessingException e) {
- LogManager.logError(LogConstants.CTX_MATVIEWS, e, QueryExecPlugin.Util.getString("TempTableDataManager.failed_load", tableName)); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_MATVIEWS, e, QueryPlugin.Util.getString("TempTableDataManager.failed_load", tableName)); //$NON-NLS-1$
throw e;
} finally {
if (rowCount == -1) {
- info.setState(MatState.FAILED_LOAD, null);
+ info.setState(MatState.FAILED_LOAD, null, null);
} else {
globalStore.swapTempTable(tableName, table);
- info.setState(MatState.LOADED, true);
- LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount)); //$NON-NLS-1$
+ info.setState(MatState.LOADED, true, loadTime);
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount)); //$NON-NLS-1$
}
}
return rowCount;
}
+ private void touchTable(CommandContext context, String fullName, boolean valid) {
+ MatTableKey key = new MatTableKey();
+ key.name = fullName;
+ key.vdb = new VDBKey(context.getVdbName(), context.getVdbVersion());
+ MatTableEntry matTableEntry = new MatTableEntry();
+ matTableEntry.valid = valid;
+ tables.put(key, matTableEntry, null);
+ }
+
/**
* Return a list of ElementSymbols for the given index/key object
*/
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -32,7 +32,7 @@
import org.teiid.api.exception.query.QueryProcessingException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.resolver.command.TempTableResolver;
@@ -84,16 +84,19 @@
}
}
- public synchronized MatState setState(MatState state, Boolean valid) {
+ public synchronized MatState setState(MatState state, Boolean valid, Long timestamp) {
MatState oldState = this.state;
if (valid != null) {
this.valid = valid;
}
setState(state);
+ if (timestamp != null) {
+ this.updateTime = timestamp;
+ }
notifyAll();
return oldState;
}
-
+
private void setState(MatState state) {
this.state = state;
this.updateTime = System.currentTimeMillis();
@@ -115,6 +118,10 @@
return valid;
}
+ public synchronized long getTtl() {
+ return ttl;
+ }
+
}
private ConcurrentHashMap<String, MatTableInfo> matTables = new ConcurrentHashMap<String, MatTableInfo>();
@@ -210,7 +217,7 @@
}
}
if (columns == null) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("TempTableStore.table_doesnt_exist_error", tempTableID)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableStore.table_doesnt_exist_error", tempTableID)); //$NON-NLS-1$
}
Create create = new Create();
create.setTable(new GroupSymbol(tempTableID));
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -38,7 +38,6 @@
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.SecurityFunctionEvaluator;
-import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.relational.PlanToProcessConverter;
@@ -325,7 +324,7 @@
if (recursionStack == null) {
recursionStack = new LinkedList<String>();
} else if (recursionStack.contains(value)) {
- throw new QueryProcessingException(QueryExecPlugin.Util.getString("ExecDynamicSqlInstruction.3", value)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("ExecDynamicSqlInstruction.3", value)); //$NON-NLS-1$
}
recursionStack.push(value);
@@ -401,11 +400,11 @@
public Object getFromContext(Expression expression) throws TeiidComponentException {
if (variableContext == null || !(expression instanceof ElementSymbol)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
Object value = variableContext.getValue((ElementSymbol)expression);
if (value == null && !variableContext.containsVariable((ElementSymbol)expression)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value;
}
Deleted: trunk/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -1,409 +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.
- */
-
-/*
- * Date: Apr 3, 2003
- * Time: 11:01:10 AM
- */
-package org.teiid.query.util;
-
-/**
- * LogMessageKeys.
- *
- * <p>Error messages for query project (015) to address internationalization.</p>
- *
- */
-public class ErrorMessageKeys {
-
- /** function package (001) */
- public static final String FUNCTION_0001 = "ERR.015.001.0001"; //$NON-NLS-1$
- public static final String FUNCTION_0002 = "ERR.015.001.0002"; //$NON-NLS-1$
- public static final String FUNCTION_0003 = "ERR.015.001.0003"; //$NON-NLS-1$
- public static final String FUNCTION_0004 = "ERR.015.001.0004"; //$NON-NLS-1$
- public static final String FUNCTION_0005 = "ERR.015.001.0005"; //$NON-NLS-1$
- public static final String FUNCTION_0006 = "ERR.015.001.0006"; //$NON-NLS-1$
- public static final String FUNCTION_0007 = "ERR.015.001.0007"; //$NON-NLS-1$
- public static final String FUNCTION_0008 = "ERR.015.001.0008"; //$NON-NLS-1$
- public static final String FUNCTION_0009 = "ERR.015.001.0009"; //$NON-NLS-1$
- public static final String FUNCTION_0010 = "ERR.015.001.0010"; //$NON-NLS-1$
- public static final String FUNCTION_0011 = "ERR.015.001.0011"; //$NON-NLS-1$
- public static final String FUNCTION_0012 = "ERR.015.001.0012"; //$NON-NLS-1$
- public static final String FUNCTION_0013 = "ERR.015.001.0013"; //$NON-NLS-1$
- public static final String FUNCTION_0014 = "ERR.015.001.0014"; //$NON-NLS-1$
- public static final String FUNCTION_0015 = "ERR.015.001.0015"; //$NON-NLS-1$
- public static final String FUNCTION_0016 = "ERR.015.001.0016"; //$NON-NLS-1$
- public static final String FUNCTION_0017 = "ERR.015.001.0017"; //$NON-NLS-1$
- public static final String FUNCTION_0018 = "ERR.015.001.0018"; //$NON-NLS-1$
- public static final String FUNCTION_0019 = "ERR.015.001.0019"; //$NON-NLS-1$
- public static final String FUNCTION_0020 = "ERR.015.001.0020"; //$NON-NLS-1$
- public static final String FUNCTION_0021 = "ERR.015.001.0021"; //$NON-NLS-1$
- public static final String FUNCTION_0022 = "ERR.015.001.0022"; //$NON-NLS-1$
- public static final String FUNCTION_0024 = "ERR.015.001.0024"; //$NON-NLS-1$
- public static final String FUNCTION_0025 = "ERR.015.001.0025"; //$NON-NLS-1$
- public static final String FUNCTION_0026 = "ERR.015.001.0026"; //$NON-NLS-1$
- public static final String FUNCTION_0027 = "ERR.015.001.0027"; //$NON-NLS-1$
- public static final String FUNCTION_0028 = "ERR.015.001.0028"; //$NON-NLS-1$
- public static final String FUNCTION_0029 = "ERR.015.001.0029"; //$NON-NLS-1$
- public static final String FUNCTION_0030 = "ERR.015.001.0030"; //$NON-NLS-1$
- public static final String FUNCTION_0031 = "ERR.015.001.0031"; //$NON-NLS-1$
- public static final String FUNCTION_0032 = "ERR.015.001.0032"; //$NON-NLS-1$
- public static final String FUNCTION_0033 = "ERR.015.001.0033"; //$NON-NLS-1$
- public static final String FUNCTION_0034 = "ERR.015.001.0034"; //$NON-NLS-1$
- public static final String FUNCTION_0035 = "ERR.015.001.0035"; //$NON-NLS-1$
- public static final String FUNCTION_0035a = "ERR.015.001.0035a"; //$NON-NLS-1$
- public static final String FUNCTION_0036 = "ERR.015.001.0036"; //$NON-NLS-1$
- public static final String FUNCTION_0037 = "ERR.015.001.0037"; //$NON-NLS-1$
- public static final String FUNCTION_0038 = "ERR.015.001.0038"; //$NON-NLS-1$
- public static final String FUNCTION_0039 = "ERR.015.001.0039"; //$NON-NLS-1$
- public static final String FUNCTION_0040 = "ERR.015.001.0040"; //$NON-NLS-1$
- public static final String FUNCTION_0041 = "ERR.015.001.0041"; //$NON-NLS-1$
- public static final String FUNCTION_0042 = "ERR.015.001.0042"; //$NON-NLS-1$
- public static final String FUNCTION_0043 = "ERR.015.001.0043"; //$NON-NLS-1$
- public static final String FUNCTION_0044 = "ERR.015.001.0044"; //$NON-NLS-1$
- public static final String FUNCTION_0045 = "ERR.015.001.0045"; //$NON-NLS-1$
- public static final String FUNCTION_0046 = "ERR.015.001.0046"; //$NON-NLS-1$
- public static final String FUNCTION_0047 = "ERR.015.001.0047"; //$NON-NLS-1$
- public static final String FUNCTION_0048 = "ERR.015.001.0048"; //$NON-NLS-1$
- public static final String FUNCTION_0050 = "ERR.015.001.0050"; //$NON-NLS-1$
- public static final String FUNCTION_0051 = "ERR.015.001.0051"; //$NON-NLS-1$
- public static final String FUNCTION_0052 = "ERR.015.001.0052"; //$NON-NLS-1$
- public static final String FUNCTION_0053 = "ERR.015.001.0053"; //$NON-NLS-1$
- public static final String FUNCTION_0054 = "ERR.015.001.0054"; //$NON-NLS-1$
- public static final String FUNCTION_0055 = "ERR.015.001.0055"; //$NON-NLS-1$
- public static final String FUNCTION_0056 = "ERR.015.001.0056"; //$NON-NLS-1$
- public static final String FUNCTION_0057 = "ERR.015.001.0057"; //$NON-NLS-1$
- public static final String FUNCTION_0058 = "ERR.015.001.0058"; //$NON-NLS-1$
- public static final String FUNCTION_0059 = "ERR.015.001.0059"; //$NON-NLS-1$
- public static final String FUNCTION_0060 = "ERR.015.001.0060"; //$NON-NLS-1$
- public static final String FUNCTION_0061 = "ERR.015.001.0061"; //$NON-NLS-1$
- public static final String FUNCTION_0062 = "ERR.015.001.0062"; //$NON-NLS-1$
- public static final String FUNCTION_0063 = "ERR.015.001.0063"; //$NON-NLS-1$
- public static final String FUNCTION_0064 = "ERR.015.001.0064"; //$NON-NLS-1$
- public static final String FUNCTION_0065 = "ERR.015.001.0065"; //$NON-NLS-1$
- public static final String FUNCTION_0066 = "ERR.015.001.0066"; //$NON-NLS-1$
- public static final String FUNCTION_0067 = "ERR.015.001.0067"; //$NON-NLS-1$
- public static final String FUNCTION_0068 = "ERR.015.001.0068"; //$NON-NLS-1$
- public static final String FUNCTION_0069 = "ERR.015.001.0069"; //$NON-NLS-1$
- public static final String FUNCTION_0070 = "ERR.015.001.0070"; //$NON-NLS-1$
- public static final String FUNCTION_0071 = "ERR.015.001.0071"; //$NON-NLS-1$
-
- /** mapping package (002) */
- public static final String MAPPING_0008 = "ERR.015.002.0008"; //$NON-NLS-1$
- public static final String MAPPING_0009 = "ERR.015.002.0009"; //$NON-NLS-1$
- public static final String MAPPING_0010 = "ERR.015.002.0010"; //$NON-NLS-1$
- public static final String MAPPING_0011 = "ERR.015.002.0011"; //$NON-NLS-1$
- public static final String MAPPING_0012 = "ERR.015.002.0012"; //$NON-NLS-1$
-
- /** optimizer package (004) */
- public static final String OPTIMIZER_0002 = "ERR.015.004.0002"; //$NON-NLS-1$
- public static final String OPTIMIZER_0005 = "ERR.015.004.0005"; //$NON-NLS-1$
- public static final String OPTIMIZER_0006 = "ERR.015.004.0006"; //$NON-NLS-1$
- public static final String OPTIMIZER_0007 = "ERR.015.004.0007"; //$NON-NLS-1$
- public static final String OPTIMIZER_0008 = "ERR.015.004.0008"; //$NON-NLS-1$
- public static final String OPTIMIZER_0009 = "ERR.015.004.0009"; //$NON-NLS-1$
- public static final String OPTIMIZER_0010 = "ERR.015.004.0010"; //$NON-NLS-1$
- public static final String OPTIMIZER_0011 = "ERR.015.004.0011"; //$NON-NLS-1$
- public static final String OPTIMIZER_0012 = "ERR.015.004.0012"; //$NON-NLS-1$
- public static final String OPTIMIZER_0014 = "ERR.015.004.0014"; //$NON-NLS-1$
- public static final String OPTIMIZER_0015 = "ERR.015.004.0015"; //$NON-NLS-1$
- public static final String OPTIMIZER_0016 = "ERR.015.004.0016"; //$NON-NLS-1$
- public static final String OPTIMIZER_0017 = "ERR.015.004.0017"; //$NON-NLS-1$
- public static final String OPTIMIZER_0019 = "ERR.015.004.0019"; //$NON-NLS-1$
- public static final String OPTIMIZER_0020 = "ERR.015.004.0020"; //$NON-NLS-1$
- public static final String OPTIMIZER_0021 = "ERR.015.004.0021"; //$NON-NLS-1$
- public static final String OPTIMIZER_0023 = "ERR.015.004.0023"; //$NON-NLS-1$
- public static final String OPTIMIZER_0024 = "ERR.015.004.0024"; //$NON-NLS-1$
- public static final String OPTIMIZER_0026 = "ERR.015.004.0026"; //$NON-NLS-1$
- public static final String OPTIMIZER_0029 = "ERR.015.004.0029"; //$NON-NLS-1$
- public static final String OPTIMIZER_0033 = "ERR.015.004.0033"; //$NON-NLS-1$
- public static final String OPTIMIZER_0034 = "ERR.015.004.0034"; //$NON-NLS-1$
- public static final String OPTIMIZER_0035 = "ERR.015.004.0035"; //$NON-NLS-1$
- public static final String OPTIMIZER_0036 = "ERR.015.004.0036"; //$NON-NLS-1$
- public static final String OPTIMIZER_0037 = "ERR.015.004.0037"; //$NON-NLS-1$
- public static final String OPTIMIZER_0038 = "ERR.015.004.0038"; //$NON-NLS-1$
- public static final String OPTIMIZER_0040 = "ERR.015.004.0040"; //$NON-NLS-1$
- public static final String OPTIMIZER_0041 = "ERR.015.004.0041"; //$NON-NLS-1$
- public static final String OPTIMIZER_0042 = "ERR.015.004.0042"; //$NON-NLS-1$
- public static final String OPTIMIZER_0043 = "ERR.015.004.0043"; //$NON-NLS-1$
- public static final String OPTIMIZER_0044 = "ERR.015.004.0044"; //$NON-NLS-1$
- public static final String OPTIMIZER_0045 = "ERR.015.004.0045"; //$NON-NLS-1$
- public static final String OPTIMIZER_0046 = "ERR.015.004.0046"; //$NON-NLS-1$
- public static final String OPTIMIZER_0047 = "ERR.015.004.0047"; //$NON-NLS-1$
- public static final String OPTIMIZER_0048 = "ERR.015.004.0048"; //$NON-NLS-1$
- public static final String OPTIMIZER_0051 = "ERR.015.004.0051"; //$NON-NLS-1$
- public static final String OPTIMIZER_0053 = "ERR.015.004.0053"; //$NON-NLS-1$
- public static final String OPTIMIZER_0054 = "ERR.015.004.0054"; //$NON-NLS-1$
- public static final String OPTIMIZER_0055 = "ERR.015.004.0055"; //$NON-NLS-1$
- public static final String OPTIMIZER_0056 = "ERR.015.004.0056"; //$NON-NLS-1$
- public static final String OPTIMIZER_0057 = "ERR.015.004.0057"; //$NON-NLS-1$
- public static final String OPTIMIZER_0058 = "ERR.015.004.0058"; //$NON-NLS-1$
- public static final String OPTIMIZER_0059 = "ERR.015.004.0059"; //$NON-NLS-1$
- public static final String OPTIMIZER_0060 = "ERR.015.004.0060"; //$NON-NLS-1$
- public static final String OPTIMIZER_0061 = "ERR.015.004.0061"; //$NON-NLS-1$
- public static final String OPTIMIZER_0063 = "ERR.015.004.0063"; //$NON-NLS-1$
- public static final String OPTIMIZER_0064 = "ERR.015.004.0064"; //$NON-NLS-1$
- public static final String OPTIMIZER_0066 = "ERR.015.004.0066"; //$NON-NLS-1$
- public static final String OPTIMIZER_0067 = "ERR.015.004.0067"; //$NON-NLS-1$
- public static final String OPTIMIZER_0068 = "ERR.015.004.0068"; //$NON-NLS-1$
- public static final String OPTIMIZER_0069 = "ERR.015.004.0069"; //$NON-NLS-1$
- public static final String OPTIMIZER_0070 = "ERR.015.004.0070"; //$NON-NLS-1$
- public static final String OPTIMIZER_0071 = "ERR.015.004.0071"; //$NON-NLS-1$
-
- /** processor package (006) */
- public static final String PROCESSOR_0001 = "ERR.015.006.0001"; //$NON-NLS-1$
- public static final String PROCESSOR_0003 = "ERR.015.006.0003"; //$NON-NLS-1$
- public static final String PROCESSOR_0010 = "ERR.015.006.0010"; //$NON-NLS-1$
- public static final String PROCESSOR_0011 = "ERR.015.006.0011"; //$NON-NLS-1$
- public static final String PROCESSOR_0012 = "ERR.015.006.0012"; //$NON-NLS-1$
- public static final String PROCESSOR_0014 = "ERR.015.006.0014"; //$NON-NLS-1$
- public static final String PROCESSOR_0015 = "ERR.015.006.0015"; //$NON-NLS-1$
- public static final String PROCESSOR_0016 = "ERR.015.006.0016"; //$NON-NLS-1$
- public static final String PROCESSOR_0017 = "ERR.015.006.0017"; //$NON-NLS-1$
- public static final String PROCESSOR_0019 = "ERR.015.006.0019"; //$NON-NLS-1$
- public static final String PROCESSOR_0020 = "ERR.015.006.0020"; //$NON-NLS-1$
- public static final String PROCESSOR_0021 = "ERR.015.006.0021"; //$NON-NLS-1$
- public static final String PROCESSOR_0022 = "ERR.015.006.0022"; //$NON-NLS-1$
- public static final String PROCESSOR_0023 = "ERR.015.006.0023"; //$NON-NLS-1$
- public static final String PROCESSOR_0024 = "ERR.015.006.0024"; //$NON-NLS-1$
- public static final String PROCESSOR_0025 = "ERR.015.006.0025"; //$NON-NLS-1$
- public static final String PROCESSOR_0026 = "ERR.015.006.0026"; //$NON-NLS-1$
- public static final String PROCESSOR_0027 = "ERR.015.006.0027"; //$NON-NLS-1$
- public static final String PROCESSOR_0029 = "ERR.015.006.0029"; //$NON-NLS-1$
- public static final String PROCESSOR_0032 = "ERR.015.006.0032"; //$NON-NLS-1$
- public static final String PROCESSOR_0033 = "ERR.015.006.0033"; //$NON-NLS-1$
- public static final String PROCESSOR_0034 = "ERR.015.006.0034"; //$NON-NLS-1$
- public static final String PROCESSOR_0035 = "ERR.015.006.0035"; //$NON-NLS-1$
- public static final String PROCESSOR_0037 = "ERR.015.006.0037"; //$NON-NLS-1$
- public static final String PROCESSOR_0038 = "ERR.015.006.0038"; //$NON-NLS-1$
- public static final String PROCESSOR_0039 = "ERR.015.006.0039"; //$NON-NLS-1$
- public static final String PROCESSOR_0040 = "ERR.015.006.0040"; //$NON-NLS-1$
- public static final String PROCESSOR_0041 = "ERR.015.006.0041"; //$NON-NLS-1$
- public static final String PROCESSOR_0042 = "ERR.015.006.0042"; //$NON-NLS-1$
- public static final String PROCESSOR_0046 = "ERR.015.006.0046"; //$NON-NLS-1$
- public static final String PROCESSOR_0047 = "ERR.015.006.0047"; //$NON-NLS-1$
- public static final String PROCESSOR_0048 = "ERR.015.006.0048"; //$NON-NLS-1$
- public static final String PROCESSOR_0049 = "ERR.015.006.0049"; //$NON-NLS-1$
- public static final String PROCESSOR_0050 = "ERR.015.006.0050"; //$NON-NLS-1$
- public static final String PROCESSOR_0051 = "ERR.015.006.0051"; //$NON-NLS-1$
- public static final String PROCESSOR_0052 = "ERR.015.006.0052"; //$NON-NLS-1$
- public static final String PROCESSOR_0054 = "ERR.015.006.0054"; //$NON-NLS-1$
- public static final String PROCESSOR_0055 = "ERR.015.006.0055"; //$NON-NLS-1$
- public static final String PROCESSOR_0056 = "ERR.015.006.0056"; //$NON-NLS-1$
- public static final String PROCESSOR_0057 = "ERR.015.006.0057"; //$NON-NLS-1$
- public static final String PROCESSOR_0058 = "ERR.015.006.0058"; //$NON-NLS-1$
- public static final String PROCESSOR_0060 = "ERR.015.006.0060"; //$NON-NLS-1$
- public static final String PROCESSOR_0061 = "ERR.015.006.0061"; //$NON-NLS-1$
-
- /** report package (007) */
- public static final String REPORT_0001 = "ERR.015.007.0001"; //$NON-NLS-1$
-
- /** resolver package (008) */
- public static final String RESOLVER_0001 = "ERR.015.008.0001"; //$NON-NLS-1$
- public static final String RESOLVER_0002 = "ERR.015.008.0002"; //$NON-NLS-1$
- public static final String RESOLVER_0003 = "ERR.015.008.0003"; //$NON-NLS-1$
- public static final String RESOLVER_0004 = "ERR.015.008.0004"; //$NON-NLS-1$
- public static final String RESOLVER_0005 = "ERR.015.008.0005"; //$NON-NLS-1$
- public static final String RESOLVER_0006 = "ERR.015.008.0006"; //$NON-NLS-1$
- public static final String RESOLVER_0007 = "ERR.015.008.0007"; //$NON-NLS-1$
- public static final String RESOLVER_0008 = "ERR.015.008.0008"; //$NON-NLS-1$
- public static final String RESOLVER_0009 = "ERR.015.008.0009"; //$NON-NLS-1$
- public static final String RESOLVER_0010 = "ERR.015.008.0010"; //$NON-NLS-1$
- public static final String RESOLVER_0011 = "ERR.015.008.0011"; //$NON-NLS-1$
- public static final String RESOLVER_0012 = "ERR.015.008.0012"; //$NON-NLS-1$
- public static final String RESOLVER_0013 = "ERR.015.008.0013"; //$NON-NLS-1$
- public static final String RESOLVER_0014 = "ERR.015.008.0014"; //$NON-NLS-1$
- public static final String RESOLVER_0015 = "ERR.015.008.0015"; //$NON-NLS-1$
- public static final String RESOLVER_0016 = "ERR.015.008.0016"; //$NON-NLS-1$
- public static final String RESOLVER_0017 = "ERR.015.008.0017"; //$NON-NLS-1$
- public static final String RESOLVER_0018 = "ERR.015.008.0018"; //$NON-NLS-1$
- public static final String RESOLVER_0019 = "ERR.015.008.0019"; //$NON-NLS-1$
- public static final String RESOLVER_0020 = "ERR.015.008.0020"; //$NON-NLS-1$
- public static final String RESOLVER_0021 = "ERR.015.008.0021"; //$NON-NLS-1$
- public static final String RESOLVER_0022 = "ERR.015.008.0022"; //$NON-NLS-1$
- public static final String RESOLVER_0023 = "ERR.015.008.0023"; //$NON-NLS-1$
- public static final String RESOLVER_0024 = "ERR.015.008.0024"; //$NON-NLS-1$
- public static final String RESOLVER_0025 = "ERR.015.008.0025"; //$NON-NLS-1$
- public static final String RESOLVER_0026 = "ERR.015.008.0026"; //$NON-NLS-1$
- public static final String RESOLVER_0027 = "ERR.015.008.0027"; //$NON-NLS-1$
- public static final String RESOLVER_0028 = "ERR.015.008.0028"; //$NON-NLS-1$
- public static final String RESOLVER_0029 = "ERR.015.008.0029"; //$NON-NLS-1$
- public static final String RESOLVER_0030 = "ERR.015.008.0030"; //$NON-NLS-1$
- public static final String RESOLVER_0031 = "ERR.015.008.0031"; //$NON-NLS-1$
- public static final String RESOLVER_0032 = "ERR.015.008.0032"; //$NON-NLS-1$
- public static final String RESOLVER_0033 = "ERR.015.008.0033"; //$NON-NLS-1$
- public static final String RESOLVER_0034 = "ERR.015.008.0034"; //$NON-NLS-1$
- public static final String RESOLVER_0035 = "ERR.015.008.0035"; //$NON-NLS-1$
- public static final String RESOLVER_0036 = "ERR.015.008.0036"; //$NON-NLS-1$
- public static final String RESOLVER_0037 = "ERR.015.008.0037"; //$NON-NLS-1$
- public static final String RESOLVER_0038 = "ERR.015.008.0038"; //$NON-NLS-1$
- public static final String RESOLVER_0039 = "ERR.015.008.0039"; //$NON-NLS-1$
- public static final String RESOLVER_0040 = "ERR.015.008.0040"; //$NON-NLS-1$
- public static final String RESOLVER_0041 = "ERR.015.008.0041"; //$NON-NLS-1$
- public static final String RESOLVER_0042 = "ERR.015.008.0042"; //$NON-NLS-1$
- public static final String RESOLVER_0043 = "ERR.015.008.0043"; //$NON-NLS-1$
- public static final String RESOLVER_0044 = "ERR.015.008.0044"; //$NON-NLS-1$
- public static final String RESOLVER_0045 = "ERR.015.008.0045"; //$NON-NLS-1$
- public static final String RESOLVER_0046 = "ERR.015.008.0046"; //$NON-NLS-1$
- public static final String RESOLVER_0047 = "ERR.015.008.0047"; //$NON-NLS-1$
- public static final String RESOLVER_0048 = "ERR.015.008.0048"; //$NON-NLS-1$
- public static final String RESOLVER_0049 = "ERR.015.008.0049"; //$NON-NLS-1$
- public static final String RESOLVER_0050 = "ERR.015.008.0050"; //$NON-NLS-1$
- public static final String RESOLVER_0051 = "ERR.015.008.0051"; //$NON-NLS-1$
- public static final String RESOLVER_0052 = "ERR.015.008.0052"; //$NON-NLS-1$
- public static final String RESOLVER_0053 = "ERR.015.008.0053"; //$NON-NLS-1$
- public static final String RESOLVER_0054 = "ERR.015.008.0054"; //$NON-NLS-1$
- public static final String RESOLVER_0055 = "ERR.015.008.0055"; //$NON-NLS-1$
- public static final String RESOLVER_0056 = "ERR.015.008.0056"; //$NON-NLS-1$
- public static final String RESOLVER_0057 = "ERR.015.008.0057"; //$NON-NLS-1$
- public static final String RESOLVER_0058 = "ERR.015.008.0058"; //$NON-NLS-1$
- public static final String RESOLVER_0059 = "ERR.015.008.0059"; //$NON-NLS-1$
- public static final String RESOLVER_0060 = "ERR.015.008.0060"; //$NON-NLS-1$
- public static final String RESOLVER_0061 = "ERR.015.008.0061"; //$NON-NLS-1$
- public static final String RESOLVER_0062 = "ERR.015.008.0062"; //$NON-NLS-1$
- public static final String RESOLVER_0063 = "ERR.015.008.0063"; //$NON-NLS-1$
- public static final String RESOLVER_0064 = "ERR.015.008.0064"; //$NON-NLS-1$
- public static final String RESOLVER_0065 = "ERR.015.008.0065"; //$NON-NLS-1$
- public static final String RESOLVER_0066 = "ERR.015.008.0066"; //$NON-NLS-1$
- public static final String RESOLVER_0067 = "ERR.015.008.0067"; //$NON-NLS-1$
- public static final String RESOLVER_0068 = "ERR.015.008.0068"; //$NON-NLS-1$
- public static final String RESOLVER_0069 = "ERR.015.008.0069"; //$NON-NLS-1$
- public static final String RESOLVER_0070 = "ERR.015.008.0070"; //$NON-NLS-1$
-
- /** rewriter package (009) */
- public static final String REWRITER_0001 = "ERR.015.009.0001"; //$NON-NLS-1$
- public static final String REWRITER_0002 = "ERR.015.009.0002"; //$NON-NLS-1$
- public static final String REWRITER_0003 = "ERR.015.009.0003"; //$NON-NLS-1$
- public static final String REWRITER_0004 = "ERR.015.009.0004"; //$NON-NLS-1$
- public static final String REWRITER_0005 = "ERR.015.009.0005"; //$NON-NLS-1$
-
- /** sql package (010) */
- public static final String SQL_0001 = "ERR.015.010.0001"; //$NON-NLS-1$
- public static final String SQL_0002 = "ERR.015.010.0002"; //$NON-NLS-1$
- public static final String SQL_0003 = "ERR.015.010.0003"; //$NON-NLS-1$
- public static final String SQL_0004 = "ERR.015.010.0004"; //$NON-NLS-1$
- public static final String SQL_0005 = "ERR.015.010.0005"; //$NON-NLS-1$
- public static final String SQL_0006 = "ERR.015.010.0006"; //$NON-NLS-1$
- public static final String SQL_0007 = "ERR.015.010.0007"; //$NON-NLS-1$
- public static final String SQL_0008 = "ERR.015.010.0008"; //$NON-NLS-1$
- public static final String SQL_0009 = "ERR.015.010.0009"; //$NON-NLS-1$
- public static final String SQL_0010 = "ERR.015.010.0010"; //$NON-NLS-1$
- public static final String SQL_0011 = "ERR.015.010.0011"; //$NON-NLS-1$
- public static final String SQL_0012 = "ERR.015.010.0012"; //$NON-NLS-1$
- public static final String SQL_0013 = "ERR.015.010.0013"; //$NON-NLS-1$
- public static final String SQL_0014 = "ERR.015.010.0014"; //$NON-NLS-1$
- public static final String SQL_0015 = "ERR.015.010.0015"; //$NON-NLS-1$
- public static final String SQL_0016 = "ERR.015.010.0016"; //$NON-NLS-1$
- public static final String SQL_0017 = "ERR.015.010.0017"; //$NON-NLS-1$
- public static final String SQL_0018 = "ERR.015.010.0018"; //$NON-NLS-1$
- public static final String SQL_0019 = "ERR.015.010.0019"; //$NON-NLS-1$
- public static final String SQL_0020 = "ERR.015.010.0020"; //$NON-NLS-1$
- public static final String SQL_0021 = "ERR.015.010.0021"; //$NON-NLS-1$
- public static final String SQL_0022 = "ERR.015.010.0022"; //$NON-NLS-1$
- public static final String SQL_0023 = "ERR.015.010.0023"; //$NON-NLS-1$
- public static final String SQL_0024 = "ERR.015.010.0024"; //$NON-NLS-1$
- public static final String SQL_0025 = "ERR.015.010.0025"; //$NON-NLS-1$
- public static final String SQL_0026 = "ERR.015.010.0026"; //$NON-NLS-1$
- public static final String SQL_0027 = "ERR.015.010.0027"; //$NON-NLS-1$
- public static final String SQL_0028 = "ERR.015.010.0028"; //$NON-NLS-1$
- public static final String SQL_0029 = "ERR.015.010.0029"; //$NON-NLS-1$
- public static final String SQL_0030 = "ERR.015.010.0030"; //$NON-NLS-1$
- public static final String SQL_0031 = "ERR.015.010.0031"; //$NON-NLS-1$
- public static final String SQL_0032 = "ERR.015.010.0032"; //$NON-NLS-1$
- public static final String SQL_0034 = "ERR.015.010.0034"; //$NON-NLS-1$
- public static final String SQL_0035 = "ERR.015.010.0035"; //$NON-NLS-1$
- public static final String SQL_0036 = "ERR.015.010.0036"; //$NON-NLS-1$
- public static final String SQL_0037 = "ERR.015.010.0037"; //$NON-NLS-1$
- public static final String SQL_0038 = "ERR.015.010.0038"; //$NON-NLS-1$
- public static final String SQL_0039 = "ERR.015.010.0039"; //$NON-NLS-1$
-
- /** util package (011) */
- public static final String UTIL_0001 = "ERR.015.011.0001"; //$NON-NLS-1$
-
- /** validator package (012) */
- public static final String VALIDATOR_0001 = "ERR.015.012.0001"; //$NON-NLS-1$
- public static final String VALIDATOR_0002 = "ERR.015.012.0002"; //$NON-NLS-1$
- public static final String VALIDATOR_0003 = "ERR.015.012.0003"; //$NON-NLS-1$
- public static final String VALIDATOR_0004 = "ERR.015.012.0004"; //$NON-NLS-1$
- public static final String VALIDATOR_0005 = "ERR.015.012.0005"; //$NON-NLS-1$
- public static final String VALIDATOR_0006 = "ERR.015.012.0006"; //$NON-NLS-1$
- public static final String VALIDATOR_0007 = "ERR.015.012.0007"; //$NON-NLS-1$
- public static final String VALIDATOR_0008 = "ERR.015.012.0008"; //$NON-NLS-1$
- public static final String VALIDATOR_0009 = "ERR.015.012.0009"; //$NON-NLS-1$
- public static final String VALIDATOR_0010 = "ERR.015.012.0010"; //$NON-NLS-1$
- public static final String VALIDATOR_0011 = "ERR.015.012.0011"; //$NON-NLS-1$
- public static final String VALIDATOR_0012 = "ERR.015.012.0012"; //$NON-NLS-1$
- public static final String VALIDATOR_0013 = "ERR.015.012.0013"; //$NON-NLS-1$
- public static final String VALIDATOR_0014 = "ERR.015.012.0014"; //$NON-NLS-1$
- public static final String VALIDATOR_0015 = "ERR.015.012.0015"; //$NON-NLS-1$
- public static final String VALIDATOR_0016 = "ERR.015.012.0016"; //$NON-NLS-1$
- public static final String VALIDATOR_0017 = "ERR.015.012.0017"; //$NON-NLS-1$
- public static final String VALIDATOR_0018 = "ERR.015.012.0018"; //$NON-NLS-1$
- public static final String VALIDATOR_0019 = "ERR.015.012.0019"; //$NON-NLS-1$
- public static final String VALIDATOR_0020 = "ERR.015.012.0020"; //$NON-NLS-1$
- public static final String VALIDATOR_0021 = "ERR.015.012.0021"; //$NON-NLS-1$
- public static final String VALIDATOR_0022 = "ERR.015.012.0022"; //$NON-NLS-1$
- public static final String VALIDATOR_0023 = "ERR.015.012.0023"; //$NON-NLS-1$
- public static final String VALIDATOR_0024 = "ERR.015.012.0024"; //$NON-NLS-1$
- public static final String VALIDATOR_0025 = "ERR.015.012.0025"; //$NON-NLS-1$
- public static final String VALIDATOR_0026 = "ERR.015.012.0026"; //$NON-NLS-1$
- public static final String VALIDATOR_0027 = "ERR.015.012.0027"; //$NON-NLS-1$
- public static final String VALIDATOR_0028 = "ERR.015.012.0028"; //$NON-NLS-1$
- public static final String VALIDATOR_0029 = "ERR.015.012.0029"; //$NON-NLS-1$
- public static final String VALIDATOR_0030 = "ERR.015.012.0030"; //$NON-NLS-1$
- public static final String VALIDATOR_0031 = "ERR.015.012.0031"; //$NON-NLS-1$
- public static final String VALIDATOR_0032 = "ERR.015.012.0032"; //$NON-NLS-1$
- public static final String VALIDATOR_0033 = "ERR.015.012.0033"; //$NON-NLS-1$
- public static final String VALIDATOR_0034 = "ERR.015.012.0034"; //$NON-NLS-1$
- public static final String VALIDATOR_0035 = "ERR.015.012.0035"; //$NON-NLS-1$
- public static final String VALIDATOR_0036 = "ERR.015.012.0036"; //$NON-NLS-1$
- public static final String VALIDATOR_0037 = "ERR.015.012.0037"; //$NON-NLS-1$
- public static final String VALIDATOR_0038 = "ERR.015.012.0038"; //$NON-NLS-1$
- public static final String VALIDATOR_0039 = "ERR.015.012.0039"; //$NON-NLS-1$
- public static final String VALIDATOR_0040 = "ERR.015.012.0040"; //$NON-NLS-1$
- public static final String VALIDATOR_0041 = "ERR.015.012.0041"; //$NON-NLS-1$
- public static final String VALIDATOR_0042 = "ERR.015.012.0042"; //$NON-NLS-1$
- public static final String VALIDATOR_0045 = "ERR.015.012.0045"; //$NON-NLS-1$
- public static final String VALIDATOR_0046 = "ERR.015.012.0046"; //$NON-NLS-1$
- public static final String VALIDATOR_0047 = "ERR.015.012.0047"; //$NON-NLS-1$
- public static final String VALIDATOR_0048 = "ERR.015.012.0048"; //$NON-NLS-1$
- public static final String VALIDATOR_0049 = "ERR.015.012.0049"; //$NON-NLS-1$
- public static final String VALIDATOR_0050 = "ERR.015.012.0050"; //$NON-NLS-1$
- public static final String VALIDATOR_0051 = "ERR.015.012.0051"; //$NON-NLS-1$
- public static final String VALIDATOR_0052 = "ERR.015.012.0052"; //$NON-NLS-1$
- public static final String VALIDATOR_0053 = "ERR.015.012.0053"; //$NON-NLS-1$
- public static final String VALIDATOR_0054 = "ERR.015.012.0054"; //$NON-NLS-1$
- public static final String VALIDATOR_0055 = "ERR.015.012.0055"; //$NON-NLS-1$
- public static final String VALIDATOR_0056 = "ERR.015.012.0056"; //$NON-NLS-1$
- public static final String VALIDATOR_0057 = "ERR.015.012.0057"; //$NON-NLS-1$
- public static final String VALIDATOR_0058 = "ERR.015.012.0058"; //$NON-NLS-1$
- public static final String VALIDATOR_0059 = "ERR.015.012.0059"; //$NON-NLS-1$
- public static final String VALIDATOR_0060 = "ERR.015.012.0060"; //$NON-NLS-1$
- public static final String VALIDATOR_0061 = "ERR.015.012.0061"; //$NON-NLS-1$
- public static final String VALIDATOR_0062 = "ERR.015.012.0062"; //$NON-NLS-1$
- public static final String VALIDATOR_0063 = "ERR.015.012.0063"; //$NON-NLS-1$
- public static final String VALIDATOR_0064 = "ERR.015.012.0064"; //$NON-NLS-1$
- public static final String VALIDATOR_0065 = "ERR.015.012.0065"; //$NON-NLS-1$
- public static final String VALIDATOR_0066 = "ERR.015.012.0066"; //$NON-NLS-1$
- public static final String VALIDATOR_0067 = "ERR.015.012.0067"; //$NON-NLS-1$
- public static final String VALIDATOR_0069 = "ERR.015.012.0069"; //$NON-NLS-1$
- public static final String VALIDATOR_0070 = "ERR.015.012.0070"; //$NON-NLS-1$
-}
Modified: trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -39,7 +39,6 @@
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* Validate that all ElementSymbol and ExpressionSymbols used in the HAVING
@@ -64,14 +63,14 @@
if(aggExp != null) {
Collection<AggregateSymbol> nestedAggs = AggregateSymbolCollectorVisitor.getAggregates(aggExp, true);
if(nestedAggs.size() > 0) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0039, nestedAggs), nestedAggs);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0039", nestedAggs), nestedAggs); //$NON-NLS-1$
}
}
// Verify data type of aggregate expression
Type aggregateFunction = obj.getAggregateFunction();
if((aggregateFunction == Type.SUM || aggregateFunction == Type.AVG) && obj.getType() == null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
} else if (obj.getType() != DataTypeManager.DefaultDataClasses.NULL) {
if (aggregateFunction == Type.XMLAGG && aggExp.getType() != DataTypeManager.DefaultDataClasses.XML) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
@@ -84,7 +83,7 @@
}
if(obj.isEnhancedNumeric()) {
if (!Number.class.isAssignableFrom(aggExp.getType())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
if (obj.isDistinct()) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.invalid_distinct", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
@@ -121,11 +120,11 @@
if(groupExpressions == null) {
if (symbol instanceof ElementSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0037, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0037", symbol), symbol); //$NON-NLS-1$
}
} else if(! groupExpressions.contains(symbol)) {
if (symbol instanceof ElementSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0038, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0038", symbol), symbol); //$NON-NLS-1$
}
} else {
validateBelow = false;
Modified: trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -80,7 +79,7 @@
* @param obj The <code>SetQuery</code> object to be visited for validation
*/
public void visit(SetQuery obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0001));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0001")); //$NON-NLS-1$
}
/**
@@ -89,7 +88,7 @@
* @param obj The <code>StoredProcedure</code> object to be visited for validation
*/
public void visit(StoredProcedure obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0002));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0002")); //$NON-NLS-1$
}
/**
@@ -98,7 +97,7 @@
* @param obj The <code>Insert</code> object to be visited for validation
*/
public void visit(Insert obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0003));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0003")); //$NON-NLS-1$
}
/**
@@ -107,7 +106,7 @@
* @param obj The <code>Update</code> object to be visited for validation
*/
public void visit(Update obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0004));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0004")); //$NON-NLS-1$
}
/**
@@ -116,7 +115,7 @@
* @param obj The <code>Delete</code> object to be visited for validation
*/
public void visit(Delete obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0005));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0005")); //$NON-NLS-1$
}
/**
@@ -126,7 +125,7 @@
*/
public void visit(Query obj) {
if((obj.getGroupBy() != null) || (obj.getHaving() != null)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0006));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0006")); //$NON-NLS-1$
}
}
@@ -149,7 +148,7 @@
Expression ex = SymbolMap.getExpression(symbol);
if (!(ex instanceof ElementSymbol || ex instanceof Constant)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0007, symbol));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0007", symbol)); //$NON-NLS-1$
}
}
@@ -170,12 +169,12 @@
GroupSymbol group = (GroupSymbol) groupIter.next();
if(groupIter.hasNext()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0009, obj.getGroups()));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0009", obj.getGroups())); //$NON-NLS-1$
} else {
try {
Object groupID = group.getMetadataID();
if(groupID instanceof TempMetadataID) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0002));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0002")); //$NON-NLS-1$
} else {
Iterator elementsInGroupIter = getMetadata().getElementIDsInGroupID(groupID).iterator();
// walk through all the elements in the physical group
@@ -218,7 +217,7 @@
// this method should only be executed if the element is a required element
// and none of cases above are true
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0010, element));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0010", element)); //$NON-NLS-1$
} catch(TeiidException e) {
handleException(e);
}
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -124,7 +124,6 @@
import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
import org.teiid.translator.SourceSystemFunctions;
@@ -238,7 +237,7 @@
if(isXMLCommand(obj)) {
//no temp table (Select Into) allowed
if(obj.getInto() != null){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0069),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0069"),obj); //$NON-NLS-1$
}
this.isXML = true;
@@ -249,7 +248,7 @@
//if it is select with no from, should not have ScalarSubQuery
if(obj.getSelect() != null && obj.getFrom() == null){
if(!ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(obj.getSelect()).isEmpty()){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0067),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0067"),obj); //$NON-NLS-1$
}
}
@@ -268,7 +267,7 @@
public void visit(SubquerySetCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
@@ -277,7 +276,7 @@
//Subcommand should have one projected symbol (query with one expression
//in SELECT or stored procedure execution that returns a single value).
if(projSymbols.size() != 1) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0011),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0011"),obj); //$NON-NLS-1$
}
}
@@ -320,7 +319,7 @@
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.The_context_function_cannot_be_used_in_a_non-XML_command"), obj); //$NON-NLS-1$
} else {
if (!(obj.getArg(0) instanceof ElementSymbol)){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0036), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.004.0036"), obj); //$NON-NLS-1$
}
for (Iterator functions = FunctionCollectorVisitor.getFunctions(obj.getArg(1), false).iterator(); functions.hasNext();) {
@@ -370,7 +369,7 @@
String groupName = variable.getGroupSymbol().getCanonicalName();
if(groupName.equals(ProcedureReservedWords.CHANGING) || groupName.equals(ProcedureReservedWords.INPUTS)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0012, ProcedureReservedWords.INPUTS, ProcedureReservedWords.CHANGING), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0012", ProcedureReservedWords.INPUTS, ProcedureReservedWords.CHANGING), obj); //$NON-NLS-1$
}
}
@@ -382,7 +381,7 @@
//Scalar subquery should have one projected symbol (query with one expression
//in SELECT or stored procedure execution that returns a single value).
if(projSymbols.size() != 1) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0032, obj.getCommand()), obj.getCommand());
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.008.0032", obj.getCommand()), obj.getCommand()); //$NON-NLS-1$
}
}
@@ -412,7 +411,7 @@
// varible cannot be one of the special variables
if(elementname.equals(ProcedureReservedWords.ROWS_UPDATED)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0017, new Object[] {ProcedureReservedWords.ROWS_UPDATED}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0017", new Object[] {ProcedureReservedWords.ROWS_UPDATED}), obj); //$NON-NLS-1$
}
visit((AssignmentStatement)obj);
@@ -441,12 +440,12 @@
Criteria predicateCriteria = (Criteria) criteriaIter.next();
Iterator elmntIter = ElementCollectorVisitor.getElements(predicateCriteria, true).iterator();
if(predicateCriteria instanceof TranslateCriteria) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0019), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0019"), obj); //$NON-NLS-1$
} else if(!(predicateCriteria instanceof HasCriteria)) {
while(elmntIter.hasNext()) {
ElementSymbol element = (ElementSymbol) elmntIter.next();
if(!element.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0020), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0020"), obj); //$NON-NLS-1$
}
}
}
@@ -468,7 +467,7 @@
ElementSymbol leftExpr = (ElementSymbol)leftElmnts.iterator().next();
if(selectElmnts != null && !selectElmnts.contains(leftExpr)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0021), leftExpr);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0021"), leftExpr); //$NON-NLS-1$
}
}
}
@@ -589,7 +588,7 @@
if(transleElmnts.contains(criteriaElement)) {
Expression mappedExpr = (Expression) symbolMap.get(criteriaElement);
if(mappedExpr instanceof AggregateSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0022, criteriaElement), criteriaElement);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0022", criteriaElement), criteriaElement); //$NON-NLS-1$
}
Iterator mapElmntIter = ElementCollectorVisitor.getElements(mappedExpr, true).iterator();
@@ -602,7 +601,7 @@
}
}
if(!groupMatch) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0023, criteriaElement), criteriaElement);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0023", criteriaElement), criteriaElement); //$NON-NLS-1$
}
}
}
@@ -621,13 +620,13 @@
SupportConstants.Element.SELECT );
if(cantSelect != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0024, cantSelect), cantSelect);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0024", cantSelect), cantSelect); //$NON-NLS-1$
}
}
protected void validateHasProjectedSymbols(Command obj) {
if(obj.getProjectedSymbols().size() == 0) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0025), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0025"), obj); //$NON-NLS-1$
}
}
@@ -646,7 +645,7 @@
private void validateSortable(SingleElementSymbol symbol) {
if (isNonComparable(symbol)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0026, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0026", symbol), symbol); //$NON-NLS-1$
}
}
@@ -660,7 +659,7 @@
*/
protected void validateNoXMLUpdates(Command obj) {
if(isXMLCommand(obj)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0029), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0029"), obj); //$NON-NLS-1$
}
}
@@ -670,16 +669,16 @@
*/
protected void validateNoXMLProcedures(Command obj) {
if(isXMLCommand(obj)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0030), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0030"), obj); //$NON-NLS-1$
}
}
private void validateXMLQuery(Query obj) {
if(obj.getGroupBy() != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0031), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0031"), obj); //$NON-NLS-1$
}
if(obj.getHaving() != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0032), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0032"), obj); //$NON-NLS-1$
}
if(obj.getLimit() != null) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.limit_not_valid_for_xml"), obj); //$NON-NLS-1$
@@ -697,7 +696,7 @@
protected void validateGroupSupportsUpdate(GroupSymbol groupSymbol) {
try {
if(! getMetadata().groupSupports(groupSymbol.getMetadataID(), SupportConstants.Group.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0033, SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0033", SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol); //$NON-NLS-1$
}
} catch (TeiidComponentException e) {
handleException(e, groupSymbol);
@@ -709,7 +708,7 @@
// also check the columns of each for comparability
for (QueryCommand subQuery : query.getQueryCommands()) {
if(isXMLCommand(subQuery)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0034), query);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0034"), query); //$NON-NLS-1$
}
if (subQuery instanceof Query && ((Query)subQuery).getInto() != null) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.union_insert"), query); //$NON-NLS-1$
@@ -774,7 +773,7 @@
while(elementIter.hasNext()) {
ElementSymbol insertElem = (ElementSymbol) elementIter.next();
if(! getMetadata().elementSupports(insertElem.getMetadataID(), SupportConstants.Element.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0052, insertElem), insertElem);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0052", insertElem), insertElem); //$NON-NLS-1$
}
}
@@ -790,7 +789,7 @@
if(!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.DEFAULT_VALUE) &&
!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.NULL) &&
!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.AUTO_INCREMENT)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0053, new Object[] {insertGroup, nextElmnt}), nextElmnt);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0053", new Object[] {insertGroup, nextElmnt}), nextElmnt); //$NON-NLS-1$
}
}
@@ -805,7 +804,7 @@
// If nextValue is an expression, evaluate it before checking for null
Object evaluatedValue = Evaluator.evaluate(nextValue);
if(evaluatedValue == null && ! getMetadata().elementSupports(nextVar.getMetadataID(), SupportConstants.Element.NULL)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0055, SQLStringVisitor.getSQLString(nextVar)), nextVar);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0055", SQLStringVisitor.getSQLString(nextVar)), nextVar); //$NON-NLS-1$
}
} catch(ExpressionEvaluationException e) {
//ignore for now, we don't have the context which could be the problem
@@ -827,7 +826,7 @@
}
}
if(!dups.isEmpty()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0062, dups), dups);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0062", dups), dups); //$NON-NLS-1$
}
}
@@ -837,12 +836,12 @@
for (SetClause entry : update.getChangeList().getClauses()) {
ElementSymbol elementID = entry.getSymbol();
if(elementID.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0058, SQLStringVisitor.getSQLString(elementID)), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0058", SQLStringVisitor.getSQLString(elementID)), elementID); //$NON-NLS-1$
}
// Check that left side element is updatable
if(! getMetadata().elementSupports(elementID.getMetadataID(), SupportConstants.Element.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0059, elementID), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0059", elementID), elementID); //$NON-NLS-1$
}
// Check that right expression is a constant and is non-null
@@ -858,7 +857,7 @@
if(value instanceof Constant) {
// If value is null, check that element supports this as a nullable column
if(((Constant)value).isNull() && ! getMetadata().elementSupports(elementID.getMetadataID(), SupportConstants.Element.NULL)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0060, SQLStringVisitor.getSQLString(elementID)), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0060", SQLStringVisitor.getSQLString(elementID)), elementID); //$NON-NLS-1$
}// end of if
} else if (!EvaluatableVisitor.willBecomeConstant(value)) {
// If this is an update on a virtual group, verify that no elements are in the right side
@@ -870,7 +869,7 @@
while(iter.hasNext()) {
ElementSymbol element = (ElementSymbol) iter.next();
if(! element.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0061, SQLStringVisitor.getSQLString(value)), value);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0061", SQLStringVisitor.getSQLString(value)), value); //$NON-NLS-1$
}
}
}
@@ -955,7 +954,7 @@
}
}
if(!foundVar) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0016, ProcedureReservedWords.ROWS_UPDATED), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0016", ProcedureReservedWords.ROWS_UPDATED), obj); //$NON-NLS-1$
}
}
@@ -977,7 +976,7 @@
*/
public void visit(BetweenCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1012,7 +1011,7 @@
*/
public void visit(SetCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1023,7 +1022,7 @@
*/
public void visit(SubqueryCompareCriteria obj) {
if (isNonComparable(obj.getLeftExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1079,7 +1078,7 @@
@Override
public void visit(CompareCriteria obj) {
if (isNonComparable(obj.getLeftExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
// Validate use of 'rowlimit' and 'rowlimitexception' pseudo-functions - they cannot be nested within another
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java 2010-09-24 18:27:53 UTC (rev 2602)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java 2010-09-24 18:51:07 UTC (rev 2603)
@@ -27,7 +27,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
public class ValidatorReport extends ActivityReport {
@@ -51,12 +50,12 @@
public String getF