[teiid-commits] teiid SVN: r1981 - in trunk: client/src/main/java/com/metamatrix and 80 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Mar 19 23:07:00 EDT 2010


Author: shawkins
Date: 2010-03-19 23:06:44 -0400 (Fri, 19 Mar 2010)
New Revision: 1981

Added:
   trunk/client/src/main/java/org/teiid/client/
   trunk/client/src/main/java/org/teiid/client/BatchSerializer.java
   trunk/client/src/main/java/org/teiid/client/DQP.java
   trunk/client/src/main/java/org/teiid/client/RequestMessage.java
   trunk/client/src/main/java/org/teiid/client/ResultsMessage.java
   trunk/client/src/main/java/org/teiid/client/SourceWarning.java
   trunk/client/src/main/java/org/teiid/client/lob/
   trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java
   trunk/client/src/main/java/org/teiid/client/metadata/
   trunk/client/src/main/java/org/teiid/client/metadata/MetadataResult.java
   trunk/client/src/main/java/org/teiid/client/metadata/ParameterInfo.java
   trunk/client/src/main/java/org/teiid/client/security/
   trunk/client/src/main/java/org/teiid/client/security/InvalidSessionException.java
   trunk/client/src/main/java/org/teiid/client/security/LogonException.java
   trunk/client/src/main/java/org/teiid/client/security/MetaMatrixSecurityException.java
   trunk/client/src/main/java/org/teiid/client/util/
   trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java
   trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java
   trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java
   trunk/client/src/main/java/org/teiid/client/xa/
   trunk/client/src/main/java/org/teiid/net/
   trunk/client/src/main/java/org/teiid/net/CommunicationException.java
   trunk/client/src/main/java/org/teiid/net/ConnectionException.java
   trunk/client/src/main/java/org/teiid/net/HostInfo.java
   trunk/client/src/main/java/org/teiid/net/NetPlugin.java
   trunk/client/src/main/java/org/teiid/net/TeiidURL.java
   trunk/client/src/main/java/org/teiid/net/socket/
   trunk/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java
   trunk/client/src/main/java/org/teiid/net/socket/Handshake.java
   trunk/client/src/main/java/org/teiid/net/socket/Message.java
   trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java
   trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java
   trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
   trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
   trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
   trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java
   trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
   trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
   trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
   trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.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/java/org/teiid/net/socket/UrlServerDiscovery.java
   trunk/client/src/main/resources/org/
   trunk/client/src/main/resources/org/teiid/
   trunk/client/src/main/resources/org/teiid/net/
   trunk/client/src/main/resources/org/teiid/net/i18n.properties
   trunk/client/src/test/java/org/teiid/client/
   trunk/client/src/test/java/org/teiid/client/TestBatchSerializer.java
   trunk/client/src/test/java/org/teiid/client/TestRequestMessage.java
   trunk/client/src/test/java/org/teiid/client/lob/
   trunk/client/src/test/java/org/teiid/client/util/
   trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java
   trunk/client/src/test/java/org/teiid/client/xa/
   trunk/client/src/test/java/org/teiid/net/
   trunk/client/src/test/java/org/teiid/net/TestMMURL.java
   trunk/client/src/test/java/org/teiid/net/socket/
   trunk/client/src/test/java/org/teiid/net/socket/TestSocketUtil.java
   trunk/common-core/src/test/java/com/metamatrix/common/util/TestReaderInputStream.java
   trunk/common-core/src/test/resources/legal_notice.xml
   trunk/engine/src/main/java/org/teiid/adminapi/impl/AdminPlugin.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java
   trunk/engine/src/main/resources/org/teiid/adminapi/
   trunk/engine/src/main/resources/org/teiid/adminapi/impl/
   trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestByteLobChunkStream.java
Removed:
   trunk/client/src/main/java/com/metamatrix/admin/AdminPlugin.java
   trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/
   trunk/client/src/main/java/com/metamatrix/api/exception/security/
   trunk/client/src/main/java/com/metamatrix/client/
   trunk/client/src/main/java/com/metamatrix/common/api/
   trunk/client/src/main/java/com/metamatrix/common/batch/
   trunk/client/src/main/java/com/metamatrix/common/comm/CommonCommPlugin.java
   trunk/client/src/main/java/com/metamatrix/common/comm/api/
   trunk/client/src/main/java/com/metamatrix/common/comm/exception/
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/CommPlatformPlugin.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/
   trunk/client/src/main/java/com/metamatrix/common/lob/
   trunk/client/src/main/java/com/metamatrix/common/xa/
   trunk/client/src/main/java/com/metamatrix/dqp/client/
   trunk/client/src/main/java/com/metamatrix/dqp/exception/
   trunk/client/src/main/java/com/metamatrix/dqp/message/
   trunk/client/src/main/java/com/metamatrix/dqp/metadata/
   trunk/client/src/main/java/com/metamatrix/platform/security/api/
   trunk/client/src/main/java/org/teiid/adminapi/LogConfiguration.java
   trunk/client/src/main/java/org/teiid/adminapi/Logger.java
   trunk/client/src/main/java/org/teiid/client/ExceptionUtil.java
   trunk/client/src/main/java/org/teiid/client/lob/ByteLobChunkStream.java
   trunk/client/src/main/java/org/teiid/net/Message.java
   trunk/client/src/main/java/org/teiid/net/ResultsReceiver.java
   trunk/client/src/main/java/org/teiid/plan/
   trunk/client/src/main/resources/com/
   trunk/client/src/test/java/com/metamatrix/admin/
   trunk/client/src/test/java/com/metamatrix/common/batch/
   trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/TestSocketUtil.java
   trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/
   trunk/client/src/test/java/com/metamatrix/common/lob/
   trunk/client/src/test/java/com/metamatrix/common/util/
   trunk/client/src/test/java/com/metamatrix/common/xa/
   trunk/client/src/test/java/com/metamatrix/dqp/client/
   trunk/client/src/test/java/com/metamatrix/dqp/message/
   trunk/client/src/test/java/org/teiid/adminapi/
   trunk/client/src/test/java/org/teiid/client/TestResultsFuture.java
   trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunkStream.java
   trunk/client/src/test/java/org/teiid/client/lob/TestReaderInputStream.java
   trunk/client/src/test/resources/legal_notice.xml
   trunk/engine/src/main/java/org/teiid/security/SecurityPlugin.java
   trunk/engine/src/main/resources/org/teiid/security/
Modified:
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/BaseDataSource.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/ConnectionImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/ExecutionProperties.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/JDBCURL.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/SocketProfile.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/StatementImpl.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDataSource.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidSQLException.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/WarningUtil.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/XAResourceImpl.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMCallableStatement.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMConnection.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMDriver.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMJDBCURL.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMPreparedStatement.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMResultSet.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMSQLException.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMStatement.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMXAConnection.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java
   trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
   trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java
   trunk/client/src/main/java/org/teiid/adminapi/VDB.java
   trunk/client/src/main/java/org/teiid/client/lob/LobChunk.java
   trunk/client/src/main/java/org/teiid/client/lob/LobChunkInputStream.java
   trunk/client/src/main/java/org/teiid/client/lob/LobChunkProducer.java
   trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataConstants.java
   trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java
   trunk/client/src/main/java/org/teiid/client/security/ILogon.java
   trunk/client/src/main/java/org/teiid/client/security/LogonResult.java
   trunk/client/src/main/java/org/teiid/client/security/SessionToken.java
   trunk/client/src/main/java/org/teiid/client/xa/XATransactionException.java
   trunk/client/src/main/java/org/teiid/client/xa/XidImpl.java
   trunk/client/src/main/java/org/teiid/net/ServerConnection.java
   trunk/client/src/main/java/org/teiid/net/ServerConnectionFactory.java
   trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java
   trunk/client/src/test/java/org/teiid/client/lob/TestLobChunkInputStream.java
   trunk/client/src/test/java/org/teiid/client/xa/TestMMXid.java
   trunk/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
   trunk/client/src/test/java/org/teiid/net/socket/TestServiceInvocationStruct.java
   trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
   trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
   trunk/client/src/test/java/org/teiid/net/socket/TestSocketServiceRegistry.java
   trunk/engine/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java
   trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBatch.java
   trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java
   trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicResultsMessage.java
   trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java
   trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
   trunk/engine/src/main/java/com/metamatrix/query/metadata/StoredProcedureInfo.java
   trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLPlan.java
   trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java
   trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java
   trunk/engine/src/main/java/com/metamatrix/query/resolver/util/BindVariableVisitor.java
   trunk/engine/src/main/java/com/metamatrix/query/sql/lang/SPParameter.java
   trunk/engine/src/main/java/com/metamatrix/query/sql/lang/StoredProcedure.java
   trunk/engine/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java
   trunk/engine/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
   trunk/engine/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.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/MetaDataProcessor.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/transaction/TransactionServerImpl.java
   trunk/engine/src/test/java/com/metamatrix/dqp/message/TestAtomicRequestMessage.java
   trunk/engine/src/test/java/com/metamatrix/dqp/message/TestResultsMessage.java
   trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataStore.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLPlanningEnhancements.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
   trunk/engine/src/test/java/com/metamatrix/query/resolver/TestProcedureResolving.java
   trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java
   trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
   trunk/engine/src/test/java/com/metamatrix/query/sql/util/TestUpdateProcedureGenerator.java
   trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestSQLStringVisitor.java
   trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java
   trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
   trunk/engine/src/test/java/com/metamatrix/query/unittest/RealMetadataFactory.java
   trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCoreRequestHandling.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestMetaDataProcessor.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/transaction/TestTransactionServer.java
   trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
   trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
   trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
   trunk/pom.xml
   trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
   trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
   trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java
   trunk/runtime/src/main/java/org/teiid/transport/ClientInstance.java
   trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
   trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.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/ServerWorkItem.java
   trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
   trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java
   trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java
   trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
   trunk/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java
   trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
   trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStaticMetadataProvider.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java
Log:
TEIID-918 repackaging the client code, fixing the unit tests, and changing vdb resources to start with a /

Deleted: trunk/client/src/main/java/com/metamatrix/admin/AdminPlugin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/AdminPlugin.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/admin/AdminPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -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 com.metamatrix.admin;
-
-import java.util.ResourceBundle;
-import com.metamatrix.core.BundleUtil;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class AdminPlugin {
-
-    /**
-     * The plug-in identifier of this plugin
-     * (value <code>"com.metamatrix.platform"</code>).
-     */
-    public static final String PLUGIN_ID = "com.metamatrix.admin" ; //$NON-NLS-1$
-
-	public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
-	                                                     PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-
-}

Deleted: trunk/client/src/main/java/com/metamatrix/common/comm/CommonCommPlugin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/CommonCommPlugin.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/CommonCommPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,37 +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 com.metamatrix.common.comm;
-
-import java.util.ResourceBundle;
-import com.metamatrix.core.BundleUtil;
-
-public class CommonCommPlugin {
-
-    /**
-     * The plug-in identifier of this plugin
-     */
-    public static final String PLUGIN_ID = "com.metamatrix.common.comm" ; //$NON-NLS-1$
-
-	public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
-	                                                     PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-}

Deleted: trunk/client/src/main/java/com/metamatrix/common/comm/platform/CommPlatformPlugin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/CommPlatformPlugin.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/CommPlatformPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,44 +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 com.metamatrix.common.comm.platform;
-
-import java.util.ResourceBundle;
-import com.metamatrix.core.BundleUtil;
-
-/**
- * CommPlatformPlugin
- * <p>Used here in <code>comm.platform</code> to have access to the new
- * logging framework.</p>
- */
-public class CommPlatformPlugin { // extends Plugin {
-
-    /**
-     * The plug-in identifier of this plugin
-     * (value <code>"com.metamatrix.comm.platform"</code>).
-     */
-    public static final String PLUGIN_ID = "com.metamatrix.common.comm.platform" ; //$NON-NLS-1$
-
-	public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
-	                                                     PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-
-}

Deleted: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,83 +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 com.metamatrix.common.comm.platform.socket;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import com.metamatrix.common.util.ApplicationInfo;
-
-/**
- * Represents the information needed in a socket connection handshake  
- */
-public class Handshake implements Externalizable {
-    
-	private static final long serialVersionUID = 7839271224736355515L;
-    
-    private String version = ApplicationInfo.getInstance().getMajorReleaseNumber();
-    private byte[] publicKey;
-    
-    /** 
-     * @return Returns the version.
-     */
-    public String getVersion() {
-        return this.version;
-    }
-    
-    /** 
-     * @param version The version to set.
-     */
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    /** 
-     * @return Returns the key.
-     */
-    public byte[] getPublicKey() {
-        return this.publicKey;
-    }
-    
-    /** 
-     * @param key The key to set.
-     */
-    public void setPublicKey(byte[] key) {
-        this.publicKey = key;
-    }
-    
-    @Override
-    public void readExternal(ObjectInput in) throws IOException,
-    		ClassNotFoundException {
-    	version = (String)in.readObject();
-    	publicKey = (byte[])in.readObject();
-    }
-    
-    @Override
-    public void writeExternal(ObjectOutput out) throws IOException {
-    	out.writeObject(version);
-    	out.writeObject(publicKey);
-    }
-    
-}

Deleted: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,41 +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 com.metamatrix.common.comm.platform.socket;
-
-import java.io.IOException;
-import java.net.SocketAddress;
-import java.util.concurrent.Future;
-
-public interface ObjectChannel {
-	
-	Object read() throws IOException, ClassNotFoundException;
-	
-	SocketAddress getRemoteAddress();
-		
-	Future<?> write(Object msg);
-	
-	boolean isOpen();
-	
-	void close();
-
-}

Deleted: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,227 +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 com.metamatrix.common.comm.platform.socket;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.Socket;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.util.Arrays;
-import java.util.Properties;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
-import com.metamatrix.core.util.Assertion;
-
-
-/** 
- * This class provides some utility methods to create ssl sockets using the
- * keystores and trust stores. these are the properties required for the making the 
- * ssl connection
- */
-public class SocketUtil {
-    
-    static final String TRUSTSTORE_PASSWORD = "org.teiid.ssl.trustStorePassword"; //$NON-NLS-1$
-    public static final String TRUSTSTORE_FILENAME = "org.teiid.ssl.trustStore"; //$NON-NLS-1$
-    static final String KEYSTORE_ALGORITHM = "org.teiid.ssl.algorithm"; //$NON-NLS-1$
-    static final String PROTOCOL = "org.teiid.ssl.protocol"; //$NON-NLS-1$
-    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$
-    
-    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 class SSLSocketFactory {
-    	private boolean isAnon;
-    	private javax.net.ssl.SSLSocketFactory factory;
-    	
-    	public SSLSocketFactory(SSLContext context, boolean isAnon) {
-			this.factory = context.getSocketFactory();
-			this.isAnon = isAnon;
-		}
-
-		public synchronized Socket getSocket() throws IOException {
-    		SSLSocket result = (SSLSocket)factory.createSocket();
-    		result.setUseClientMode(true);
-    		if (isAnon) {
-    			addCipherSuite(result, ANON_CIPHER_SUITE);
-    		}
-    		return result;
-    	}
-    }
-    
-    public static SSLSocketFactory getSSLSocketFactory(Properties props) throws IOException, GeneralSecurityException{
-        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 keystoreAlgorithm = props.getProperty(KEYSTORE_ALGORITHM); 
-        String truststore = props.getProperty(TRUSTSTORE_FILENAME, keystore); 
-        String truststorePassword = props.getProperty(TRUSTSTORE_PASSWORD, keystorePassword); 
-        
-        boolean anon = NONE.equalsIgnoreCase(truststore);
-        
-        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) {
-            // 2 way SSL
-            result = getClientSSLContext(keystore, keystorePassword, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
-        } else  if(truststore != null) {
-            // One way SSL with custom properties defined
-            result = getClientSSLContext(null, null, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
-        } else {
-        	//## JDBC4.0-begin ##
-        	result = SSLContext.getDefault();
-        	//## JDBC4.0-end ##
-        	/*## JDBC3.0-JDK1.5-begin ##
-			result = SSLContext.getInstance("Default"); 
- 	  	      ## JDBC3.0-JDK1.5-end ##*/
-        }
-        return new SSLSocketFactory(result, anon);
-    }
-    
-    /**
-     * create socket factory for the client socket.  
-     * @throws GeneralSecurityException 
-     */
-    static SSLContext getClientSSLContext(String keystore,
-                                            String password,
-                                            String truststore,
-                                            String truststorePassword,
-                                            String algorithm,
-                                            String keystoreType,
-                                            String protocol) throws IOException, GeneralSecurityException {
-        return getSSLContext(keystore, password, truststore, truststorePassword, algorithm, keystoreType, protocol);
-    }
-    
-    public static void addCipherSuite(SSLSocket engine, String cipherSuite) {
-        Assertion.assertTrue(Arrays.asList(engine.getSupportedCipherSuites()).contains(cipherSuite));
-
-        String[] suites = engine.getEnabledCipherSuites();
-
-        String[] newSuites = new String[suites.length + 1];
-        System.arraycopy(suites, 0, newSuites, 0, suites.length);
-        
-        newSuites[suites.length] = cipherSuite;
-        
-        engine.setEnabledCipherSuites(newSuites);
-    }
-
-    public static SSLContext getAnonSSLContext() throws IOException, GeneralSecurityException {
-        return getSSLContext(null, null, null, null, null, null, ANON_PROTOCOL);
-    }
-    
-    public static SSLContext getSSLContext(String keystore,
-                                            String password,
-                                            String truststore,
-                                            String truststorePassword,
-                                            String algorithm,
-                                            String keystoreType,
-                                            String protocol) throws IOException, GeneralSecurityException {
-        
-    	if (algorithm == null) {
-    		algorithm = KeyManagerFactory.getDefaultAlgorithm();
-    	}
-        // Configure the Keystore Manager
-        KeyManager[] keyManagers = null;
-        if (keystore != null) {
-            KeyStore ks = loadKeyStore(keystore, password, keystoreType);
-            if (ks != null) {
-                KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm);
-                kmf.init(ks, password.toCharArray());
-                keyManagers = kmf.getKeyManagers();
-            }
-        }
-        
-        // Configure the Trust Store Manager
-        TrustManager[] trustManagers = null;
-        if (truststore != null) {
-            KeyStore ks = loadKeyStore(truststore, truststorePassword, keystoreType);
-            if (ks != null) {
-                TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
-                tmf.init(ks);
-                trustManagers = tmf.getTrustManagers();
-            }
-        } 
-
-        // Configure the SSL
-        SSLContext sslc = SSLContext.getInstance(protocol);
-        sslc.init(keyManagers, trustManagers, null);
-        return sslc;
-    }
-    
-    /**
-     * Load any defined keystore file, by first looking in the classpath
-     * then looking in the file system path.
-     *   
-     * @param name - name of the keystore
-     * @param password - password to load the keystore
-     * @param type - type of the keystore
-     * @return loaded keystore 
-     */
-    public static KeyStore loadKeyStore(String name, String password, String type) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException {
-        
-        // Check in the classpath
-        InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
-        if (stream == null) {
-            try {
-                stream = new FileInputStream(name);
-            } catch (FileNotFoundException e) {
-                IOException exception = new IOException(CommPlatformPlugin.Util.getString("SocketHelper.keystore_not_found", name)); //$NON-NLS-1$
-                exception.initCause(e);
-                throw exception;
-            }
-        }
-                
-        KeyStore ks = KeyStore.getInstance(type);        
-        
-        ks.load(stream, password != null ? password.toCharArray() : null);
-        return ks;
-    }
-
-}

Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,21 +28,16 @@
 import java.lang.reflect.Proxy;
 import java.util.Properties;
 
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminComponentException;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.AdminObject;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.util.ExceptionUtil;
+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;
+import org.teiid.net.socket.SocketServerConnectionFactory;
 
-import com.metamatrix.admin.AdminPlugin;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionFactory;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
 import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 
@@ -69,7 +64,7 @@
     	
     	private synchronized Admin getTarget() throws AdminComponentException, CommunicationException {
     		if (closed) {
-    			throw new AdminComponentException(CommPlatformPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
+    			throw new AdminComponentException(NetPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
     		}
     		if (target != null && registry.isOpen()) {
     			return target;
@@ -210,25 +205,25 @@
                                    String applicationName) throws AdminException {
         
         if (userName == null || userName.trim().length() == 0) {
-            throw new IllegalArgumentException(AdminPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
+            throw new IllegalArgumentException(NetPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
         }
         
     	final Properties p = new Properties();
-    	p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
-    	p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
+    	p.setProperty(TeiidURL.CONNECTION.APP_NAME, applicationName);
+    	p.setProperty(TeiidURL.CONNECTION.USER_NAME, userName);
         if (password != null) {
-        	p.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+        	p.setProperty(TeiidURL.CONNECTION.PASSWORD, new String(password));
         }
-    	p.setProperty(MMURL.CONNECTION.SERVER_URL, serverURL);
+    	p.setProperty(TeiidURL.CONNECTION.SERVER_URL, serverURL);
     	return createAdmin(p);
     }
 
 	public Admin createAdmin(Properties p) throws AdminException {
 		p = PropertiesUtils.clone(p);
-		p.remove(MMURL.JDBC.VDB_NAME);
-		p.remove(MMURL.JDBC.VDB_VERSION);
-    	p.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
-    	p.setProperty(MMURL.CONNECTION.ADMIN, Boolean.TRUE.toString());
+		p.remove(TeiidURL.JDBC.VDB_NAME);
+		p.remove(TeiidURL.JDBC.VDB_VERSION);
+    	p.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
+    	p.setProperty(TeiidURL.CONNECTION.ADMIN, Boolean.TRUE.toString());
     	
 		try {
 			Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));

Deleted: trunk/client/src/main/java/org/teiid/adminapi/LogConfiguration.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/LogConfiguration.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/org/teiid/adminapi/LogConfiguration.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,106 +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.adminapi;
-
-import java.util.Set;
-
-import com.metamatrix.core.log.MessageLevel;
-
-
-/** 
- * The LogConfiguration describes the current configuration of the
- * system logger.
- * 
- * <p>The log configuration is used to filter on log contexts (components) 
- * and log levels (severity).</p>
- * 
- * @since 4.3
- */
-public interface LogConfiguration {
-    
-    /**
-     * Message level value that specifies that no messages are to be recorded.
-     */
-    public static final int NONE = MessageLevel.NONE;
-
-    /**
-     * Message level value that specifies that critical messages are to be recorded.
-     */
-    public static final int CRITICAL = MessageLevel.CRITICAL;
-
-    /**
-     * Message level value that specifies that error messages and critical
-     * messages are to be recorded.
-     */
-    public static final int ERROR = MessageLevel.ERROR;
-
-    /**
-     * Message level value that specifies that warning, error and critical
-     * messages are to be recorded.
-     */
-    public static final int WARNING = MessageLevel.WARNING;
-
-    /**
-     * Message level value that specifies that information, warning, error and critical
-     * messages are to be recorded.
-     */
-    public static final int INFO = MessageLevel.INFO;
-
-    /**
-     * Message level value that specifies that detailed, information, warning, error and critical
-     * messages are to be recorded.
-     */
-    public static final int DETAIL = MessageLevel.DETAIL;
-
-    /**
-     * Message level value that specifies that all messages are to be recorded.
-     */
-    public static final int TRACE = MessageLevel.TRACE;
-    
-    
-    /**
-     * Get the current configured Log Level for supplied context
-     * @param context
-     * @return int value 
-     * @see com.metamatrix.core.log.MessageLevel
-     * @since 4.3
-     */
-    int getLogLevel(String context);
-    
-    /**
-     * Obtain the set of message contexts that are currently used.
-     * @return the unmodifiable set of context Strings; never null
-     */
-    Set<String> getContexts(); 
-    
-    /** 
-     * Set the Log Level
-     * 
-     *  Note:  Must call setLogConfiguration(LogConfiguration) for log level to take
-     *  affect on the server. 
-     * 
-     * @param context log context name
-     * @param logLevel The logLevel to set.
-     */
-    public void setLogLevel(String context, int logLevel);
-}

Deleted: trunk/client/src/main/java/org/teiid/adminapi/Logger.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Logger.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/org/teiid/adminapi/Logger.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,44 +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.adminapi;
-
-
-/** 
- * Custom logging interface that provides a hook for custom implementations to log messages
- * produced by MM Query.
- * @since 4.3
- */
-public interface Logger {
-    
-    /**
-     * Logs the given message if the current logging level is &gt;= the logLevel parameter. 
-     * @param logLevel logging level for this message
-     * @param timestamp timestamp at which this log message was generated
-     * @param componentName name of the component that generated this message
-     * @param threadName name of the thread that generated this message
-     * @param message message body. May be null.
-     * @param throwable exception thrown. May be null.
-     * @since 4.3
-     */
-    void log(int logLevel, long timestamp, String componentName, String threadName, String message, Throwable throwable);
-}

Modified: trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/org/teiid/adminapi/ProcessObject.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -55,7 +55,7 @@
 
 
     /**
-     * Get the port number for this MetaMatrix Process
+     * Get the port number for this Process
      *  
      * @return listener port for this host
      * @since 4.3
@@ -63,8 +63,8 @@
     public int getPort();
     
     /**
-     * Get the IP address for the MetaMatrix Process 
-     * @return the IP address for the MetaMatrix Process 
+     * Get the IP address for the Process 
+     * @return the IP address for the Process 
      * @since 4.3
      */
     public InetAddress getInetAddress(); 

Modified: trunk/client/src/main/java/org/teiid/adminapi/VDB.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/VDB.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/main/java/org/teiid/adminapi/VDB.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -40,13 +40,6 @@
  */
 public interface VDB extends AdminObject {
 
-    /** 
-     * Constant to denote the latest version of a VDB located
-     * at a given repository location. Used when deploying a
-     * VDB to the MetaMatrix Server from the server repository.
-     */
-    public static final String SERVER_REPOSITORY_LATEST_VERSION = "LATEST"; //$NON-NLS-1$
-    
     public static enum Status{INCOMPLETE, INACTIVE, ACTIVE, DELETED, ACTIVE_DEFAULT};
 
 

Copied: trunk/client/src/main/java/org/teiid/client (from rev 1978, trunk/client/src/main/java/com/metamatrix/client)

Copied: trunk/client/src/main/java/org/teiid/client/BatchSerializer.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/batch/BatchSerializer.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/BatchSerializer.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/BatchSerializer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,414 @@
+/*
+ * 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.client;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.teiid.net.NetPlugin;
+
+import com.metamatrix.common.types.DataTypeManager;
+
+
+/** 
+ * @since 4.2
+ */
+public class BatchSerializer {
+    
+    private BatchSerializer() {} // Uninstantiable
+    
+    private static ColumnSerializer defaultSerializer = new ColumnSerializer();
+    
+    private static final Map<String, ColumnSerializer> serializers = new HashMap<String, ColumnSerializer>();
+    static {
+        serializers.put(DataTypeManager.DefaultDataTypes.BIG_DECIMAL,   new BigDecimalColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER,   new BigIntegerColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.BOOLEAN,       new BooleanColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.BYTE,          new ByteColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.CHAR,          new CharColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.DATE,          new DateColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.DOUBLE,        new DoubleColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.FLOAT,         new FloatColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.INTEGER,       new IntColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.LONG,          new LongColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.SHORT,         new ShortColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.TIME,          new TimeColumnSerializer());
+        serializers.put(DataTypeManager.DefaultDataTypes.TIMESTAMP,     new TimestampColumnSerializer());
+    }
+    
+    /**
+     * Packs the (boolean) information about whether data values in the column are null
+     * into bytes so that we send ~n/8 instead of n bytes.
+     * @param out
+     * @param col
+     * @param batch
+     * @throws IOException
+     * @since 4.2
+     */
+    static void writeIsNullData(ObjectOutput out, int col, List[] batch) throws IOException {
+        int numBytes = batch.length / 8, row = 0, currentByte = 0;
+        for (int byteNum = 0; byteNum < numBytes; byteNum++, row+=8) {
+            currentByte  = (batch[row].get(col) == null) ? 0x80 : 0;
+            if (batch[row+1].get(col) == null) currentByte |= 0x40;
+            if (batch[row+2].get(col) == null) currentByte |= 0x20;
+            if (batch[row+3].get(col) == null) currentByte |= 0x10;
+            if (batch[row+4].get(col) == null) currentByte |= 0x08;
+            if (batch[row+5].get(col) == null) currentByte |= 0x04;
+            if (batch[row+6].get(col) == null) currentByte |= 0x02;
+            if (batch[row+7].get(col) == null) currentByte |= 0x01;
+            out.write(currentByte);
+        }
+        if (batch.length % 8 > 0) {
+            currentByte = 0;
+            for (int mask = 0x80; row < batch.length; row++, mask >>= 1) {
+                if (batch[row].get(col) == null) currentByte |= mask;
+            }
+            out.write(currentByte);
+        }
+    }
+    /**
+     * Reads the isNull data into a byte array 
+     * @param in
+     * @param isNullBytes
+     * @throws IOException
+     * @since 4.2
+     */
+    static void readIsNullData(ObjectInput in, byte[] isNullBytes) throws IOException {
+        for (int i = 0; i < isNullBytes.length; i++) {
+            isNullBytes[i] = in.readByte();
+        }
+    }
+    
+    /**
+     * Gets whether a data value is null based on a packed byte array containing boolean data 
+     * @param isNull
+     * @param row
+     * @return
+     * @since 4.2
+     */
+    static boolean isNullObject(byte[] isNull, int row) {
+        //              byte number           mask     bits to shift mask
+        return (isNull [ row / 8 ]         & (0x01 << (7 - (row % 8))))   != 0;
+    }
+    
+    /**
+     * An abstract serializer for native types
+     * @since 4.2
+     */
+    private static class ColumnSerializer {
+        public void writeColumn(ObjectOutput out, int col, List[] batch) throws IOException {
+            writeIsNullData(out, col, batch);
+            Object obj = null;
+            for (int i = 0; i < batch.length; i++) {
+                obj = batch[i].get(col);
+                if (obj != null) {
+                    writeObject(out, obj);
+                }
+            }
+        }
+        
+        public void readColumn(ObjectInput in, int col, List[] batch, byte[] isNull) throws IOException, ClassNotFoundException {
+            readIsNullData(in, isNull);
+            for (int i = 0; i < batch.length; i++) {
+                if (!isNullObject(isNull, i)) {
+                    batch[i].set(col, DataTypeManager.getCanonicalValue(readObject(in)));
+                }
+            }
+        }
+        
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+        	out.writeObject(obj);
+        }
+        protected Object readObject(ObjectInput in) throws IOException, ClassNotFoundException {
+        	return in.readObject();
+        }
+    }
+    
+    private static class IntColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeInt(((Integer)obj).intValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return Integer.valueOf(in.readInt());
+        }
+    }
+    
+    private static class LongColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeLong(((Long)obj).longValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return Long.valueOf(in.readLong());
+        }
+    }
+    
+    private static class FloatColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeFloat(((Float)obj).floatValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return new Float(in.readFloat());
+        }
+    }
+    
+    private static class DoubleColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeDouble(((Double)obj).doubleValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return new Double(in.readDouble());
+        }
+    }
+    
+    private static class ShortColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeShort(((Short)obj).shortValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return Short.valueOf(in.readShort());
+        }
+    }
+    
+    private static class BooleanColumnSerializer extends ColumnSerializer {
+        /* This implementation compacts the isNull and boolean data for non-null values into a byte[]
+         * by using a 8 bit mask that is bit-shifted to mask each value.
+         */
+        public void writeColumn(ObjectOutput out, int col, List[] batch) throws IOException {
+            int currentByte = 0;
+            int mask = 0x80;
+            Object obj;
+            for (int row = 0; row < batch.length; row++) {
+                // Write the isNull value
+                obj = batch[row].get(col);
+                if (obj == null ) {
+                    currentByte |= mask;
+                }
+                mask >>= 1; // Shift the mask to the next bit
+                if (mask == 0) {
+                    // If the current byte has been used up, write it and reset.
+                    out.write(currentByte);
+                    currentByte = 0;
+                    mask = 0x80;
+                }
+                if (obj != null) {
+                    // Write the boolean value if it's not null
+                    if (((Boolean)obj).booleanValue()) {
+                        currentByte |= mask;
+                    }
+                    mask >>= 1;
+                    if (mask == 0) {
+                        out.write(currentByte);
+                        currentByte = 0;
+                        mask = 0x80;
+                    }
+                }
+            }
+            // Invariant mask != 0
+            // If we haven't reached the eight-row mark then the loop would not have written this byte
+            // Write the final byte containing data for th extra rows, if it exists.
+            if (mask != 0x80) {
+                out.write(currentByte);
+            }
+        }
+        
+        public void readColumn(ObjectInput in, int col, List[] batch, byte[] isNull) throws IOException, ClassNotFoundException {
+            int currentByte = 0, mask = 0; // Initialize the mask so that it is reset in the loop
+            boolean isNullVal;
+            for (int row = 0; row < batch.length; row++) {
+                if (mask == 0) {
+                    // If we used up the byte, read the next one, and reset the mask
+                    currentByte = in.read();
+                    mask = 0x80;
+                }
+                isNullVal = (currentByte & mask) != 0;
+                mask >>= 1; // Shift the mask to the next bit
+                if (!isNullVal) {
+                    if (mask == 0) {
+                        currentByte = in.read();
+                        mask = 0x80;
+                    }
+                    batch[row].set(col, ((currentByte & mask) == 0) ? Boolean.FALSE : Boolean.TRUE);
+                    mask >>= 1;
+                }
+            }
+        }
+    }
+    
+    private static class ByteColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeByte(((Byte)obj).byteValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return Byte.valueOf(in.readByte());
+        }
+    }
+    
+    private static class CharColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeChar(((Character)obj).charValue());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return Character.valueOf(in.readChar());
+        }
+    }
+    
+    private static class BigIntegerColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            BigInteger val = (BigInteger)obj;
+            byte[] bytes = val.toByteArray();
+            out.writeInt(bytes.length);
+            out.write(bytes);
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            int length = in.readInt();
+            byte[] bytes = new byte[length];
+            in.readFully(bytes);
+            return new BigInteger(bytes);
+        }
+    }
+    
+    private static class BigDecimalColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            BigDecimal val = (BigDecimal)obj;
+            out.writeInt(val.scale());
+            BigInteger unscaled = val.unscaledValue();
+            byte[] bytes = unscaled.toByteArray();
+            out.writeInt(bytes.length);
+            out.write(bytes);
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            int scale = in.readInt();
+            int length = in.readInt();
+            byte[] bytes = new byte[length];
+            in.readFully(bytes);
+            return new BigDecimal(new BigInteger(bytes), scale);
+        }
+    }
+    
+    private static class DateColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeLong(((java.sql.Date)obj).getTime());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return new java.sql.Date(in.readLong());
+        }
+    }
+    
+    private static class TimeColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            out.writeLong(((Time)obj).getTime());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            return new Time(in.readLong());
+        }
+    }
+    
+    private static class TimestampColumnSerializer extends ColumnSerializer {
+        protected void writeObject(ObjectOutput out, Object obj) throws IOException {
+            Timestamp ts =  (Timestamp)obj;
+            out.writeLong(ts.getTime());
+            out.writeInt(ts.getNanos());
+        }
+        protected Object readObject(ObjectInput in) throws IOException {
+            Timestamp ts = new Timestamp(in.readLong());
+            ts.setNanos(in.readInt());
+            return ts;
+        }
+    }
+        
+    private static ColumnSerializer getSerializer(String type) {
+        ColumnSerializer cs = serializers.get((type == null) ? DataTypeManager.DefaultDataTypes.OBJECT : type);
+        if (cs == null) {
+        	return defaultSerializer;
+        }
+        return cs;
+    }
+    
+    public static void writeBatch(ObjectOutput out, String[] types, List[] batch) throws IOException {
+        // If there are no type hints, simply use the default mechanism to serialize
+        if (types == null || types.length == 0) {
+            out.writeObject(batch);
+            return;
+        }
+        if (batch == null) {
+            out.writeInt(-1);
+        } else {
+            out.writeInt(batch.length);
+            if (batch.length > 0) {
+	            int columns = types.length;
+	            out.writeInt(columns);
+	            for(int i = 0; i < columns; i++) {
+	            	ColumnSerializer serializer = getSerializer(types[i]);
+	                try {
+	                    serializer.writeColumn(out, i, batch);
+	                } catch (ClassCastException e) {
+	                    Object obj = null;
+	                    String objectClass = null;
+	                    objectSearch: for (int row = 0; row < batch.length; row++) {
+	                        obj = batch[row].get(i);
+	                        if (obj != null) {
+	                            objectClass = obj.getClass().getName();
+	                            break objectSearch;
+	                        }
+	                    }
+	                    throw new IOException(NetPlugin.Util.getString("BatchSerializer.datatype_mismatch", new Object[] {types[i], new Integer(i), objectClass})); //$NON-NLS-1$
+	                }
+	            }
+            }
+        }
+    }
+    
+    public static List[] readBatch(ObjectInput in, String[] types) throws IOException, ClassNotFoundException {
+        // If there are no type hints, use the default mechanism to deserialize
+        if (types == null || types.length == 0) {
+            return (List[])in.readObject();
+        }
+        int rows = in.readInt();
+        if (rows == 0) {
+            return new List[0];
+        } else if (rows > 0) {
+            int columns = in.readInt();
+            List[] batch = new List[rows];
+            int numBytes = rows/8;
+            int extraRows = rows % 8;
+            for (int currentRow = 0; currentRow < rows; currentRow++) {
+                batch[currentRow] = Arrays.asList(new Object[columns]);
+            }
+            byte[] isNullBuffer = new byte[(extraRows > 0) ? numBytes + 1: numBytes];
+            for (int col = 0; col < columns; col++) {
+                getSerializer(types[col]).readColumn(in, col, batch, isNullBuffer);
+            }
+            return batch;
+        }
+        return null;
+    }
+}

Added: trunk/client/src/main/java/org/teiid/client/DQP.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/DQP.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/DQP.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,81 @@
+/*
+ * 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.client;
+
+import javax.transaction.xa.Xid;
+
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+
+public interface DQP {
+	
+	ResultsFuture<ResultsMessage> executeRequest(long reqID, RequestMessage message) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+	
+	ResultsFuture<ResultsMessage> processCursorRequest(long reqID, int batchFirst, int fetchSize) throws MetaMatrixProcessingException;
+
+	ResultsFuture<?> closeRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+	
+	boolean cancelRequest(long requestID) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+	
+	ResultsFuture<?> closeLobChunkStream(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+	
+	ResultsFuture<LobChunk> requestNextLobChunk(int lobRequestId, long requestId, String streamId) throws MetaMatrixProcessingException, MetaMatrixComponentException;
+		
+	MetadataResult getMetadata(long requestID) throws MetaMatrixComponentException, MetaMatrixProcessingException;
+	
+	MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws MetaMatrixComponentException, MetaMatrixProcessingException;
+	
+    // local transaction
+ 
+	ResultsFuture<?> begin() throws XATransactionException;
+
+    ResultsFuture<?> commit() throws XATransactionException; 
+
+    ResultsFuture<?> rollback() throws XATransactionException; 
+
+    // XA
+
+    ResultsFuture<?> start(XidImpl xid,
+            int flags,
+            int timeout) throws XATransactionException;
+
+    ResultsFuture<?> end(XidImpl xid,
+            int flags) throws XATransactionException;
+
+    ResultsFuture<Integer> prepare(XidImpl xid) throws XATransactionException;
+
+    ResultsFuture<?> commit(XidImpl xid, boolean onePhase) throws XATransactionException;
+    
+    ResultsFuture<?> rollback(XidImpl xid) throws XATransactionException;
+
+    ResultsFuture<?> forget(XidImpl xid) throws XATransactionException;
+
+    ResultsFuture<Xid[]> recover(int flag) throws XATransactionException; 
+    
+}

Deleted: trunk/client/src/main/java/org/teiid/client/ExceptionUtil.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/ExceptionUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,82 +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 com.metamatrix.client;
-
-import java.lang.reflect.Method;
-
-import org.teiid.adminapi.AdminComponentException;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.AdminProcessingException;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.common.xa.XATransactionException;
-import com.metamatrix.core.MetaMatrixRuntimeException;
-
-public class ExceptionUtil {
-	
-    @SuppressWarnings("unchecked")
-	public static <T extends Throwable> T getExceptionOfType(Throwable ex, Class<T> cls) {
-        while (ex != null) {
-            if (cls.isAssignableFrom(ex.getClass())) {
-                return (T)ex;
-            } 
-            if (ex.getCause() == ex) {
-            	break;
-            }
-            ex = ex.getCause();
-        }
-        return null;
-    }
-	
-	public static Throwable convertException(Method method, Throwable exception) {
-		boolean canThrowXATransactionException = false;
-		boolean canThrowComponentException = false;
-		boolean canThrowAdminException = false;
-        Class<?>[] exceptionClasses = method.getExceptionTypes();
-        for (int i = 0; i < exceptionClasses.length; i++) {
-			if (exception.getClass().isAssignableFrom(exceptionClasses[i])) {
-				return exception;
-			}
-			canThrowComponentException |= MetaMatrixComponentException.class.isAssignableFrom(exceptionClasses[i]);
-			canThrowAdminException |= AdminException.class.isAssignableFrom(exceptionClasses[i]);
-			canThrowXATransactionException |= XATransactionException.class.isAssignableFrom(exceptionClasses[i]);
-        }
-        if (canThrowComponentException) {
-        	return new MetaMatrixComponentException(exception);
-        }
-        if (canThrowAdminException) {
-			if (exception instanceof MetaMatrixProcessingException) {
-				return new AdminProcessingException(exception);
-			}
-        	return new AdminComponentException(exception);
-		}
-        if (canThrowXATransactionException) {
-        	return new XATransactionException(exception);
-        }
-        if (RuntimeException.class.isAssignableFrom(exception.getClass())) {
-        	return exception;
-        }
-        return new MetaMatrixRuntimeException(exception);
-	}
-}

Copied: trunk/client/src/main/java/org/teiid/client/RequestMessage.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/RequestMessage.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/RequestMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,395 @@
+/*
+ * 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.client;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.teiid.net.NetPlugin;
+
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+import com.metamatrix.core.util.ExternalizeUtil;
+
+/**
+ * Request Message, used by MMXStatement for submitting queries.
+ */
+public class RequestMessage implements Externalizable {
+
+    public static final int DEFAULT_FETCH_SIZE = 2048;
+    
+    /** Transaction auto wrap constant - never wrap a command execution in a transaction */
+    public static final String TXN_WRAP_OFF = "OFF"; //$NON-NLS-1$
+
+    /** Transaction auto wrap constant - always wrap commands in a transaction. */
+    public static final String TXN_WRAP_ON = "ON"; //$NON-NLS-1$
+
+    /**
+     * Transaction auto wrap constant - checks if a command
+     * requires a transaction and will be automatically wrap it.
+     */
+    public static final String TXN_WRAP_DETECT = "DETECT"; //$NON-NLS-1$
+
+    
+    public enum StatementType {
+    	PREPARED, CALLABLE, STATEMENT
+    }
+    
+    public enum ResultsMode {
+    	RESULTSET, UPDATECOUNT, EITHER
+    }
+
+    private String[] commands;
+    private boolean isBatchedUpdate;
+    private int fetchSize = DEFAULT_FETCH_SIZE;
+    private int cursorType;
+    private boolean partialResultsFlag;
+    private StatementType statementType = StatementType.STATEMENT;
+    private List<?> parameterValues;
+    private boolean validationMode;
+    private String txnAutoWrapMode;
+    private String XMLFormat;
+    private String styleSheet;
+    private ResultsMode resultsMode = ResultsMode.EITHER;
+    //whether to use ResultSet cache if there is one
+    private boolean useResultSetCache;
+    // Treat the double quoted strings as variables in the command
+    private boolean ansiQuotedIdentifiers = true;
+    private boolean showPlan;
+    private int rowLimit;
+    private Serializable executionPayload;
+    private long executionId;
+    private int transactionIsolation;
+    
+    public RequestMessage() {
+    }
+
+	public RequestMessage(String command) {
+		this();
+		setCommands(command);
+	}
+
+    public int getFetchSize() {
+        return fetchSize;
+    }
+
+    public boolean supportsPartialResults() {
+        return partialResultsFlag;
+    }
+
+    /**
+     * @param i
+     */
+    public void setFetchSize(int fetchSize) {
+        this.fetchSize = fetchSize;
+    }
+
+    /**
+     * @param partial
+     */
+    public void setPartialResults(boolean partial) {
+        partialResultsFlag = partial;
+    }
+
+    /**
+     * @return True if this request includes a prepared statement.
+     */
+    public boolean isPreparedStatement() {
+        return this.statementType == StatementType.PREPARED;
+    }
+
+    /**
+     * @return True if this request includes a callable statement.
+     */
+    public boolean isCallableStatement() {
+        return this.statementType == StatementType.CALLABLE;
+    }
+    
+    public void setStatementType(StatementType statementType) {
+		this.statementType = statementType;
+	}
+	
+	/**
+     * @return A list of parameter values. May be null.
+     */
+    public List<?> getParameterValues() {
+    	if (parameterValues == null) {
+    		return Collections.EMPTY_LIST;
+    	}
+        return parameterValues;
+    }
+
+    /**
+     * @param values
+     */
+    public void setParameterValues(List<?> values) {
+        parameterValues = values;
+    }
+
+    /**
+     * @return String
+     */
+    public int getCursorType() {
+        return cursorType;
+    }
+
+    /**
+     * Sets the cursorType.
+     * @param cursorType The cursorType to set
+     */
+    public void setCursorType(int cursorType) {
+        this.cursorType = cursorType;
+    }
+
+    /**
+     * @return boolean
+     */
+    public boolean getValidationMode() {
+        return validationMode;
+    }
+
+    /**
+     * @return String
+     */
+    public String getXMLFormat() {
+        return XMLFormat;
+    }
+
+    /**
+     * Sets the validationMode.
+     * @param validationMode The validationMode to set
+     */
+    public void setValidationMode(boolean validationMode) {
+        this.validationMode = validationMode;
+    }
+
+    /**
+     * Sets the xMLFormat.
+     * @param xMLFormat The xMLFormat to set
+     */
+    public void setXMLFormat(String xMLFormat) {
+        XMLFormat = xMLFormat;
+    }
+
+    /**
+     * @return String
+     */
+    public String getTxnAutoWrapMode() {
+    	if (txnAutoWrapMode == null) {
+    		return TXN_WRAP_DETECT;
+    	}
+        return txnAutoWrapMode;
+    }
+
+    /**
+     * Sets the txnAutoWrapMode.
+     * @param txnAutoWrapMode The txnAutoWrapMode to set
+     * @throws MetaMatrixProcessingException 
+     */
+    public void setTxnAutoWrapMode(String txnAutoWrapMode) throws MetaMatrixProcessingException {
+    	if (txnAutoWrapMode != null) {
+    		txnAutoWrapMode = txnAutoWrapMode.toUpperCase();
+    		if (!(txnAutoWrapMode.equals(TXN_WRAP_OFF)
+    			|| txnAutoWrapMode.equals(TXN_WRAP_ON)
+    			|| txnAutoWrapMode.equals(TXN_WRAP_DETECT))) {
+    			throw new MetaMatrixProcessingException(NetPlugin.Util.getString("RequestMessage.invalid_txnAutoWrap", txnAutoWrapMode)); //$NON-NLS-1$
+    		}
+    	} 
+        this.txnAutoWrapMode = txnAutoWrapMode;
+    }
+
+    /**
+     * @return String
+     */
+    public String getStyleSheet() {
+        return styleSheet;
+    }
+
+    /**
+     * Sets the styleSheet.
+     * @param styleSheet The styleSheet to set
+     */
+    public void setStyleSheet(String styleSheet) {
+        this.styleSheet = styleSheet;
+    }
+
+	public boolean useResultSetCache() {
+		//not use caching when there is a txn 
+		return useResultSetCache;
+	}
+
+	public void setUseResultSetCache(boolean useResultSetCacse) {
+		this.useResultSetCache = useResultSetCacse;
+	}
+
+	public String getCommandString() {
+		if (commands.length == 1) {
+			return commands[0];
+		}
+		return Arrays.deepToString(commands);
+	}
+           
+	public boolean isAnsiQuotedIdentifiers() {
+		return ansiQuotedIdentifiers;
+	}
+	
+	public void setAnsiQuotedIdentifiers(boolean ansiQuotedIdentifiers) {
+		this.ansiQuotedIdentifiers = ansiQuotedIdentifiers;
+	}
+
+    /** 
+     * @return Returns the showPlan.
+     * @since 4.3
+     */
+    public boolean getShowPlan() {
+        return this.showPlan;
+    }
+
+    
+    /** 
+     * @param showPlan The showPlan to set.
+     * @since 4.3
+     */
+    public void setShowPlan(boolean showPlan) {
+        this.showPlan = showPlan;
+    }
+
+    
+    /** 
+     * @return Returns the rowLimit.
+     * @since 4.3
+     */
+    public int getRowLimit() {
+        return this.rowLimit;
+    }
+
+    
+    /** 
+     * @param rowLimit The rowLimit to set.
+     * @since 4.3
+     */
+    public void setRowLimit(int rowLimit) {
+        this.rowLimit = rowLimit;
+    }
+
+	public String[] getCommands() {
+		return commands;
+	}
+
+	public void setCommands(String... batchedCommands) {
+		this.commands = batchedCommands;
+	}
+
+	public void setExecutionPayload(Serializable executionPayload) {
+		this.executionPayload = executionPayload;
+	}
+
+	public Serializable getExecutionPayload() {
+		return executionPayload;
+	}
+
+	public long getExecutionId() {
+		return executionId;
+	}
+
+	public void setExecutionId(long executionId) {
+		this.executionId = executionId;
+	}
+	
+	public void setBatchedUpdate(boolean isBatchedUpdate) {
+		this.isBatchedUpdate = isBatchedUpdate;
+	}
+
+	public boolean isBatchedUpdate() {
+		return isBatchedUpdate;
+	}
+
+	public ResultsMode getResultsMode() {
+		return resultsMode;
+	}
+	
+	public void setResultsMode(ResultsMode resultsMode) {
+		this.resultsMode = resultsMode;
+	}
+	
+	public int getTransactionIsolation() {
+		return transactionIsolation;
+	}
+	
+	public void setTransactionIsolation(int transactionIsolation) {
+		this.transactionIsolation = transactionIsolation;
+	}
+
+	@Override
+	public void readExternal(ObjectInput in) throws IOException,
+			ClassNotFoundException {
+		this.commands = ExternalizeUtil.readStringArray(in);
+		this.isBatchedUpdate = in.readBoolean();
+		this.fetchSize = in.readInt();
+		this.cursorType = in.readInt();
+		this.partialResultsFlag = in.readBoolean();
+		this.statementType = StatementType.values()[in.readByte()];
+		this.parameterValues = ExternalizeUtil.readList(in);
+		this.validationMode = in.readBoolean();
+		this.txnAutoWrapMode = (String)in.readObject();
+		this.XMLFormat = (String)in.readObject();
+		this.styleSheet = (String)in.readObject();
+		this.resultsMode = ResultsMode.values()[in.readByte()];
+		this.useResultSetCache = in.readBoolean();
+		this.ansiQuotedIdentifiers = in.readBoolean();
+		this.showPlan = in.readBoolean();
+		this.rowLimit = in.readInt();
+		this.executionPayload = (Serializable)in.readObject();
+		this.executionId = in.readLong();
+		this.transactionIsolation = in.readInt();
+	}
+	
+	@Override
+	public void writeExternal(ObjectOutput out) throws IOException {
+		ExternalizeUtil.writeArray(out, commands);
+		out.writeBoolean(isBatchedUpdate);
+		out.writeInt(fetchSize);
+		out.writeInt(cursorType);
+		out.writeBoolean(partialResultsFlag);
+		out.writeByte(statementType.ordinal());
+		ExternalizeUtil.writeList(out, parameterValues);
+		out.writeBoolean(validationMode);
+		out.writeObject(txnAutoWrapMode);
+		out.writeObject(XMLFormat);
+		out.writeObject(styleSheet);
+		out.writeByte(resultsMode.ordinal());
+		out.writeBoolean(useResultSetCache);
+		out.writeBoolean(ansiQuotedIdentifiers);
+		out.writeBoolean(showPlan);
+		out.writeInt(rowLimit);
+		out.writeObject(executionPayload);
+		out.writeLong(executionId);
+		out.writeInt(transactionIsolation);
+	}
+	
+}

Copied: trunk/client/src/main/java/org/teiid/client/ResultsMessage.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/message/ResultsMessage.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/ResultsMessage.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/ResultsMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,355 @@
+/*
+ * 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.client;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import com.metamatrix.api.exception.ExceptionHolder;
+import com.metamatrix.api.exception.MetaMatrixException;
+import com.metamatrix.core.util.ExternalizeUtil;
+
+/**
+ * Results Message, used by MMStatement to get the query results.
+ */
+public class ResultsMessage implements Externalizable {
+
+    static final long serialVersionUID = 3546924172976187793L;
+
+	private List[] results = null;
+	private String[] columnNames = null;
+	private String[] dataTypes = null;
+
+    /** A description of planning that occurred as requested in the request. */
+    private Map planDescription;
+
+    /** An exception that occurred. */
+    private MetaMatrixException exception;
+
+    /** Warning could be schema validation errors or partial results warnings */
+    private List<Throwable> warnings;
+
+    /** First row index */
+    private int firstRow = 0;
+
+    /** Last row index */
+    private int lastRow;
+
+    /** Final row index in complete result set, if known */
+    private int finalRow = -1;
+
+    /** The parameters of a Stored Procedure */
+    private List parameters;
+
+    /** OPTION DEBUG log if OPTION DEBUG was used */
+    private String debugLog;
+        
+    /** 
+     * Query plan annotations, if OPTION SHOWPLAN or OPTION PLANONLY was used:
+     * Collection of Object[] where each Object[] holds annotation information
+     * that can be used to create an Annotation implementation in JDBC.  
+     */
+    private Collection annotations;
+    
+    private boolean isUpdateResult;
+
+    public ResultsMessage(){
+    }
+
+    /**
+     * Instantiate and copy relevant information from the original request message.
+     * Typically, the transaction context should only be copied if this results
+     * message is being returned from the connector to the query engine. Clients
+     * will be unable to deserialize this object.
+     * @param requestMsg
+     * @param copyTransactionContext true if the transaction context should be copied; false otherwise.
+     * @since 4.2
+     */
+    public ResultsMessage(RequestMessage requestMsg){
+        this.results = new ArrayList[0];
+
+    }
+
+    public ResultsMessage(RequestMessage requestMsg, List[] results, String[] columnNames, String[] dataTypes){
+        this (requestMsg);
+        setResults( results );
+        setFirstRow( 1 );
+        setLastRow( results.length );
+
+        this.columnNames = columnNames;
+        this.dataTypes = dataTypes;
+    }
+
+	public  List[] getResults() {
+		return results;
+	}
+
+    public void setResults(List[] results) {
+		this.results = results;
+	}
+
+	public  String[] getColumnNames() {
+        return this.columnNames;
+	}
+
+	public String[] getDataTypes() {
+        return this.dataTypes;
+	}
+
+    /**
+     * @return
+     */
+    public MetaMatrixException getException() {
+        return exception;
+    }
+
+    /**
+     * @return
+     */
+    public int getFinalRow() {
+        return finalRow;
+    }
+
+    /**
+     * @return
+     */
+    public int getFirstRow() {
+        return firstRow;
+    }
+
+    /**
+     * @return
+     */
+    public int getLastRow() {
+        return lastRow;
+    }
+
+    /**
+     * @return
+     */
+    public Map getPlanDescription() {
+        return planDescription;
+    }
+
+    /**
+     * @return
+     */
+    public List getWarnings() {
+        return warnings;
+    }
+
+    /**
+     * @param exception
+     */
+    public void setException(Throwable e) {
+        if(e instanceof MetaMatrixException) {
+            this.exception = (MetaMatrixException)e;
+        } else {
+            this.exception = new MetaMatrixException(e, e.getMessage());
+        }
+    }
+
+    /**
+     * @param i
+     */
+    public void setFinalRow(int i) {
+        finalRow = i;
+    }
+
+    /**
+     * @param i
+     */
+    public void setFirstRow(int i) {
+        firstRow = i;
+    }
+
+    /**
+     * @param i
+     */
+    public void setLastRow(int i) {
+        lastRow = i;
+    }
+
+    /**
+     * @param object
+     */
+    public void setPlanDescription(Map object) {
+        planDescription = object;
+    }
+
+    /**
+     * @param list
+     */
+    public void setWarnings(List<Throwable> list) {
+        warnings = list;
+    }
+
+    /**
+     * @return
+     */
+    public List getParameters() {
+        return parameters;
+    }
+
+    /**
+     * @param list
+     */
+    public void setParameters(List list) {
+        parameters = list;
+    }
+
+    /**
+     * @param strings
+     */
+    public void setColumnNames(String[] columnNames) {
+        this.columnNames = columnNames;
+    }
+
+    /**
+     * @param strings
+     */
+    public void setDataTypes(String[] dataTypes) {
+        this.dataTypes = dataTypes;
+    }
+
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+
+        columnNames = ExternalizeUtil.readStringArray(in);
+        dataTypes = ExternalizeUtil.readStringArray(in);
+
+        // Row data
+        results = BatchSerializer.readBatch(in, dataTypes);
+
+        // Plan Descriptions
+        planDescription = ExternalizeUtil.readMap(in);
+
+        ExceptionHolder holder = (ExceptionHolder)in.readObject();
+        if (holder != null) {
+        	this.exception = (MetaMatrixException)holder.getException();
+        }
+        List<ExceptionHolder> holderList = (List<ExceptionHolder>)in.readObject();
+        if (holderList != null) {
+        	this.warnings = ExceptionHolder.toThrowables(holderList);
+        }
+
+        firstRow = in.readInt();
+        lastRow = in.readInt();
+        finalRow = in.readInt();
+
+        //Parameters
+        parameters = ExternalizeUtil.readList(in);
+
+        debugLog = (String)in.readObject();
+        annotations = (Collection)in.readObject();
+        isUpdateResult = in.readBoolean();
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException {
+
+        ExternalizeUtil.writeArray(out, columnNames);
+        ExternalizeUtil.writeArray(out, dataTypes);
+
+        // Results data
+        BatchSerializer.writeBatch(out, dataTypes, results);
+
+        // Plan descriptions
+        ExternalizeUtil.writeMap(out, planDescription);
+
+        if (exception != null) {
+        	out.writeObject(new ExceptionHolder(exception));
+        } else {
+        	out.writeObject(exception);
+        }
+        if (this.warnings != null) {
+        	out.writeObject(ExceptionHolder.toExceptionHolders(this.warnings));
+        } else {
+        	out.writeObject(this.warnings);
+        }
+
+        out.writeInt(firstRow);
+        out.writeInt(lastRow);
+        out.writeInt(finalRow);
+
+        // Parameters
+        ExternalizeUtil.writeList(out, parameters);
+
+        out.writeObject(debugLog);
+        out.writeObject(annotations);
+        out.writeBoolean(isUpdateResult);
+    }
+
+    /**
+     * @return
+     */
+    public Collection getAnnotations() {
+        return annotations;
+    }
+
+    /**
+     * @return
+     */
+    public String getDebugLog() {
+        return debugLog;
+    }
+
+    /**
+     * @param collection
+     */
+    public void setAnnotations(Collection collection) {
+        annotations = collection;
+    }
+
+    /**
+     * @param string
+     */
+    public void setDebugLog(String string) {
+        debugLog = string;
+    }
+    
+          
+    /* 
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return new StringBuffer("ResultsMessage rowCount=") //$NON-NLS-1$
+            .append(results == null ? 0 : results.length)
+            .append(" finalRow=") //$NON-NLS-1$
+            .append(finalRow)
+            .toString();
+    }
+
+	public void setUpdateResult(boolean isUpdateResult) {
+		this.isUpdateResult = isUpdateResult;
+	}
+
+	public boolean isUpdateResult() {
+		return isUpdateResult;
+	}
+}
+

Copied: trunk/client/src/main/java/org/teiid/client/SourceWarning.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/exception/SourceWarning.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/SourceWarning.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/SourceWarning.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,98 @@
+/*
+ * 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.client;
+
+import com.metamatrix.api.exception.MetaMatrixException;
+
+/**
+ * <p> This class is used to store the details of an atomic query warning.
+ * It stores model name on which the atomic query is based, name of the 
+ * connector binding for the data source against which the atomic query 
+ * is executed, and the actual exception thrown when the atomic 
+ * query is executed.</p>
+ */
+
+public class SourceWarning extends MetaMatrixException {
+	
+	private String modelName = "UNKNOWN"; // variable stores the name of the model for the atomic query //$NON-NLS-1$
+	private String connectorBindingName = "UNKNOWN"; // variable stores name of the connector binding //$NON-NLS-1$
+	private boolean partialResults;
+	
+    /**
+	 * <p>Constructor that stores atomic query failure details.</p>
+	 * @param model Name of the model for the atomic query
+	 * @param connectorBinding Name of the connector binding name for the atomic query
+	 * @param ex Exception thrown when atomic query fails
+	 */ 
+	public SourceWarning(String model, String connectorBinding, Throwable ex, boolean partialResults) {
+		super(ex); 
+		if(model != null) {
+			this.modelName = model;
+		}		
+		if(connectorBinding != null) {			
+			this.connectorBindingName = connectorBinding;
+		}		
+		this.partialResults = partialResults;
+	}
+	
+	/**
+	 * <p>Get's the model name for the atomic query.</p>
+	 * @return The name of the model
+	 */
+	public String getModelName() {
+		return modelName;		
+	}
+	
+	/**
+	 * <p>Get's the connector binding name for the atomic query.</p>
+	 * @return The Connector Binding Name
+	 */	
+	public String getConnectorBindingName() {
+		return connectorBindingName;
+	}
+	
+	public boolean isPartialResultsError() {
+		return partialResults;
+	}
+	
+	/**
+	 * <p>Gets a message detailing the source against which the atomic query failed.</p>
+	 * @return Message containing details of the source for which there is a failure.
+	 */
+	public String toString() {
+		StringBuffer warningBuf = new StringBuffer();
+		if (partialResults) {
+			warningBuf.append("Error ");
+		} else {
+			warningBuf.append("Warning ");
+		}
+		warningBuf.append("querying the connector with binding name "); //$NON-NLS-1$
+		warningBuf.append(connectorBindingName);
+		warningBuf.append(" for the model "); //$NON-NLS-1$
+		warningBuf.append(modelName);
+		warningBuf.append(" : "); //$NON-NLS-1$
+		warningBuf.append(this.getCause());
+		return warningBuf.toString();
+	}
+	
+} // END CLASS


Property changes on: trunk/client/src/main/java/org/teiid/client/SourceWarning.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/client/src/main/java/org/teiid/client/lob (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/lob)

Deleted: trunk/client/src/main/java/org/teiid/client/lob/ByteLobChunkStream.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/lob/ByteLobChunkStream.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/lob/ByteLobChunkStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,82 +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 com.metamatrix.common.lob;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-
-import com.metamatrix.core.CorePlugin;
-
-/**
- * A wrapper class, given a InputStream object can convert a underlying 
- * stream into sequence of ByteLobChunk objects of given chunk size. 
- */
-public class ByteLobChunkStream  implements LobChunkProducer {
-    private PushbackInputStream stream;
-    private int chunkSize;
-    private boolean closed;
-    
-    public ByteLobChunkStream(InputStream stream, int chunkSize) {
-        this.stream = new PushbackInputStream(stream);
-        this.chunkSize = chunkSize;
-    }
-    
-    /**  
-     * @see com.metamatrix.common.lob.ByteLobChunkProducer#getNextChunk(int)
-     */
-    public LobChunk getNextChunk() throws IOException{
-
-        if (this.closed) {
-            throw new IllegalStateException(CorePlugin.Util.getString("stream_closed")); //$NON-NLS-1$
-        }
-                
-        // read contents from the stream
-        byte[] cbuf = new byte[this.chunkSize];
-        int read = this.stream.read(cbuf);
-        if (read == -1) {
-            return new LobChunk(new byte[0], true);
-        }
-        boolean isLast = false;
-        if (read != this.chunkSize) {
-            byte[] buf = new byte[read];
-            System.arraycopy(cbuf, 0, buf, 0, read);
-            cbuf = buf;
-        }
-        int next = this.stream.read();
-        if (next == -1) {
-        	isLast = true;
-        } else {
-        	this.stream.unread(next);
-        }
-        return new LobChunk(cbuf, isLast);
-    }
-
-    /** 
-     * @see com.metamatrix.common.lob.ByteLobChunkProducer#close()
-     */
-    public void close() throws IOException {
-        this.closed = true;
-        this.stream.close();
-    }        
-}
\ No newline at end of file

Modified: trunk/client/src/main/java/org/teiid/client/lob/LobChunk.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/lob/LobChunk.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/lob/LobChunk.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,9 +20,12 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.lob;
+package org.teiid.client.lob;
 
-import java.io.Serializable;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 
 
 /** 
@@ -30,12 +33,16 @@
  * class used as value object to transfer blob object's data chunk back and forth
  * between the client and server. 
  */
-public class LobChunk implements Serializable {
+public class LobChunk implements Externalizable {
     static final long serialVersionUID = -5634014429424520672L;
     
     private byte[] data;
     private boolean last = false;
     
+    public LobChunk() {
+    	
+    }
+    
     public LobChunk(byte[] data, boolean last){
         this.last = last;
         this.data = data;
@@ -47,6 +54,19 @@
     
     public boolean isLast() {
         return this.last;
-    }        
+    }
+    
+    @Override
+    public void readExternal(ObjectInput in) throws IOException,
+    		ClassNotFoundException {
+    	data = (byte[])in.readObject();
+    	last = in.readBoolean();
+    }
+    
+    @Override
+    public void writeExternal(ObjectOutput out) throws IOException {
+    	out.writeObject(data);
+    	out.writeBoolean(last);
+    }
 
 }

Modified: trunk/client/src/main/java/org/teiid/client/lob/LobChunkInputStream.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/lob/LobChunkInputStream.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/lob/LobChunkInputStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.lob;
+package org.teiid.client.lob;
 
 import java.io.IOException;
 import java.io.InputStream;

Modified: trunk/client/src/main/java/org/teiid/client/lob/LobChunkProducer.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/lob/LobChunkProducer.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/lob/LobChunkProducer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.lob;
+package org.teiid.client.lob;
 
 import java.io.IOException;
 

Added: trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/lob/StreamingLobChunckProducer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,89 @@
+/*
+ * 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.client.lob;
+
+import java.io.IOException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.teiid.client.DQP;
+import org.teiid.net.NetPlugin;
+
+import com.metamatrix.api.exception.MetaMatrixException;
+import com.metamatrix.common.types.Streamable;
+
+public class StreamingLobChunckProducer implements LobChunkProducer {
+	
+	public static class Factory {
+		private final Streamable<?> streamable;
+		private final DQP dqp;
+		private final long requestId;
+		
+		public Factory(DQP dqp,
+				long requestId, Streamable<?> streamable) {
+			super();
+			this.dqp = dqp;
+			this.requestId = requestId;
+			this.streamable = streamable;
+		}
+
+		public StreamingLobChunckProducer getLobChunkProducer() {
+			return new StreamingLobChunckProducer(dqp, requestId, streamable);
+		}
+	}
+	
+	private static AtomicInteger REQUEST_SEQUENCE = new AtomicInteger(0);
+
+	private final Streamable<?> streamable;
+	private final DQP dqp;
+	private final long requestId;
+	private final int streamRequestId = REQUEST_SEQUENCE.getAndIncrement();
+
+	public StreamingLobChunckProducer(DQP dqp, long requestId,
+			Streamable<?> streamable) {
+		this.dqp = dqp;
+		this.requestId = requestId;
+		this.streamable = streamable;
+	}
+
+	public LobChunk getNextChunk() throws IOException {
+	    try {
+	    	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$
+	        ex.initCause(e);
+	        throw ex;                        
+	    }                
+	}
+
+	public void close() throws IOException {
+	    try {
+	    	dqp.closeLobChunkStream(streamRequestId, requestId, streamable.getReferenceStreamId());
+	    } catch (MetaMatrixException e) {
+	        IOException ex = new IOException(e.getMessage());
+	        ex.initCause(e);
+	        throw  ex;
+		}                    
+	}
+}

Copied: trunk/client/src/main/java/org/teiid/client/metadata (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/metadata)

Copied: trunk/client/src/main/java/org/teiid/client/metadata/MetadataResult.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/client/MetadataResult.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/metadata/MetadataResult.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/metadata/MetadataResult.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,67 @@
+/*
+ * 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.client.metadata;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Map;
+
+import com.metamatrix.core.util.ExternalizeUtil;
+
+public class MetadataResult implements Externalizable {
+	private static final long serialVersionUID = -1520482281079030324L;
+	private Map[] columnMetadata;
+	private Map[] parameterMetadata;
+	
+	public MetadataResult() {
+	}
+	
+	public MetadataResult(Map[] columnMetadata, Map[] parameterMetadata) {
+		super();
+		this.columnMetadata = columnMetadata;
+		this.parameterMetadata = parameterMetadata;
+	}
+	public Map[] getColumnMetadata() {
+		return columnMetadata;
+	}
+	
+	public Map[] getParameterMetadata() {
+		return parameterMetadata;
+	}
+	
+	@Override
+	public void readExternal(ObjectInput in) throws IOException,
+			ClassNotFoundException {
+		columnMetadata = ExternalizeUtil.readArray(in, Map.class);
+		parameterMetadata = ExternalizeUtil.readArray(in, Map.class);
+	}
+	
+	@Override
+	public void writeExternal(ObjectOutput out) throws IOException {
+		ExternalizeUtil.writeArray(out, columnMetadata);
+		ExternalizeUtil.writeArray(out, parameterMetadata);
+	}
+	
+}

Copied: trunk/client/src/main/java/org/teiid/client/metadata/ParameterInfo.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/message/ParameterInfo.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/metadata/ParameterInfo.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/metadata/ParameterInfo.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,89 @@
+/*
+ * 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.client.metadata;
+
+import java.io.*;
+import java.io.Externalizable;
+
+/**
+ * Desccribes some parameter info to return when executing a CallableStatement -
+ * this is used to avoid sending SPParameter, which contains references to metadata
+ * objects and stuff we don't want to send.  
+ */
+public class ParameterInfo implements Externalizable {
+
+    static final long serialVersionUID = -683851729051138932L;
+    
+    private int type;           // used outbound
+    private int numColumns;     // if type is a result set - used outbound
+
+	/** Constant identifying an IN parameter */
+	public static final int IN = 1;
+
+	/** Constant identifying an OUT parameter */
+	public static final int OUT = 2;
+
+	/** Constant identifying an INOUT parameter */
+	public static final int INOUT = 3;
+
+	/** Constant identifying a RETURN parameter */
+	public static final int RETURN_VALUE = 4;
+
+	/** Constant identifying a RESULT SET parameter */
+	public static final int RESULT_SET = 5;
+
+    // needed for Externalizable
+    public ParameterInfo() {
+    }
+
+    /**
+     * Create outbound parameter info
+     * @param type
+     * @param numColumns
+     */
+    public ParameterInfo(int type, int numColumns) {
+        this.type = type;
+        this.numColumns = numColumns;
+    }
+    
+    public int getType() {
+        return this.type;
+    }
+    
+    public int getNumColumns() {
+        return this.numColumns;
+    }
+    
+    public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeInt(type);
+        out.writeInt(numColumns);
+    }
+
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        type = in.readInt();
+        numColumns = in.readInt();
+    }
+    
+    
+
+}

Modified: trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataConstants.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/metadata/ResultsMetadataConstants.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataConstants.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.dqp.metadata;
+package org.teiid.client.metadata;
 
 /**
  * This constants in this class indicate the column positions of different

Modified: trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/metadata/ResultsMetadataDefaults.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/metadata/ResultsMetadataDefaults.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.dqp.metadata;
+package org.teiid.client.metadata;
 
 import java.util.HashMap;
 import java.util.Map;

Copied: trunk/client/src/main/java/org/teiid/client/security (from rev 1978, trunk/client/src/main/java/com/metamatrix/platform/security/api)

Modified: trunk/client/src/main/java/org/teiid/client/security/ILogon.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/security/ILogon.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,14 +20,13 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.platform.security.api;
+package org.teiid.client.security;
 import java.util.Properties;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
+import org.teiid.client.util.ResultsFuture;
+
 import com.metamatrix.api.exception.ComponentNotFoundException;
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.dqp.client.ResultsFuture;
 
 /**
  * Generic logon interface.

Copied: trunk/client/src/main/java/org/teiid/client/security/InvalidSessionException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/InvalidSessionException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/security/InvalidSessionException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/security/InvalidSessionException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,81 @@
+/*
+ * 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.client.security;
+
+public class InvalidSessionException extends MetaMatrixSecurityException {
+
+
+    /**
+     * No-Arg Constructor
+     */
+    public InvalidSessionException(  ) {
+        super( );
+    }
+    /**
+     * Constructs an instance of the exception with the specified detail message. A detail
+     * message is a String that describes this particular exception.
+     * @param the detail message
+     */
+    public InvalidSessionException(String message) {
+    	super(message);
+    }
+    /**
+     * Constructs an instance of the exception with no detail message but with a
+     * single exception.
+     * @param e the exception that is encapsulated by this exception
+     */
+    public InvalidSessionException(Throwable e) {
+        super(e);
+    }
+    /**
+     * Constructs an instance of the exception with the specified detail message
+     * and a single exception. A detail message is a String that describes this
+     * particular exception.
+     * @param message the detail message
+     * @param e the exception that is encapsulated by this exception
+     */
+    public InvalidSessionException( Throwable e, String message ) {
+        super(e, message);
+    }
+    /**
+     * Construct an instance with an error code and message specified.
+     *
+     * @param message The error message
+     * @param code    The error code 
+     */
+    public InvalidSessionException( String code, String message ) {
+        super( code, message );
+    }
+    /**
+     * Construct an instance with a linked exception, and an error code and
+     * message, specified.
+     *
+     * @param e       An exception to chain to this exception
+     * @param message The error message
+     * @param code    The error code 
+     */
+    public InvalidSessionException( Throwable e, String code, String message ) {
+        super(e, code, message );
+    }
+}
+

Copied: trunk/client/src/main/java/org/teiid/client/security/LogonException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/api/exception/security/LogonException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/security/LogonException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/security/LogonException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,83 @@
+/*
+ * 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.client.security;
+
+
+/**
+ * This exception is thrown when an attempt to log in to obtain a session has failed.
+ * Possible reasons include but are not limited to:
+ * <p>
+ * <li>The limit on the number of sessions for the user has been reached, and a new session for the user could not be established;</li>
+ * <li>An account for the user does not exist, has been frozen or has been removed; and</li>
+ * <li>The credentials that were supplied did not authenticate the user.</li> 
+ */
+public class LogonException extends MetaMatrixSecurityException {
+
+    /**
+     * No-Arg Constructor
+     */
+    public LogonException(  ) {
+        super( );
+    }
+    /**
+     * Construct an instance with the message specified.
+     *
+     * @param message A message describing the exception
+     */
+    public LogonException( String message ) {
+        super( message );
+    }
+
+    /**
+     * Construct an instance with the message and error code specified.
+     *
+     * @param message A message describing the exception
+     * @param code The error code
+     */
+    public LogonException( String code, String message ) {
+        super( code, message );
+    }
+
+    /**
+     * Construct an instance from a message and an exception to chain to this one.
+     *
+     * @param code A code denoting the exception
+     * @param e An exception to nest within this one
+     */
+    public LogonException( Throwable e, String message ) {
+        super( e, message );
+    }
+
+    /**
+     * Construct an instance from a message and a code and an exception to
+     * chain to this one.
+     *
+     * @param e An exception to nest within this one
+     * @param message A message describing the exception
+     * @param code A code denoting the exception
+     */
+    public LogonException( Throwable e, String code, String message ) {
+        super( e, code, message );
+    }
+}
+

Modified: trunk/client/src/main/java/org/teiid/client/security/LogonResult.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/security/LogonResult.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.platform.security.api;
+package org.teiid.client.security;
 
 import java.io.Serializable;
 import java.util.TimeZone;

Copied: trunk/client/src/main/java/org/teiid/client/security/MetaMatrixSecurityException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/admin/api/exception/security/MetaMatrixSecurityException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/security/MetaMatrixSecurityException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/security/MetaMatrixSecurityException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,83 @@
+/*
+ * 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.client.security;
+
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+
+public class MetaMatrixSecurityException extends MetaMatrixProcessingException {
+
+    /**
+     * No-Arg Constructor
+     */
+    public MetaMatrixSecurityException(  ) {
+        super( );
+    }
+
+    /**
+     * Construct an instance with a linked exception, and an error code and
+     * message, specified.
+     *
+     * @param e       An exception to chain to this exception
+     * @param message The error message
+     * @param code    The error code 
+     */
+    public MetaMatrixSecurityException( Throwable e, String code, String message ) {
+        super( e, code, message );
+    }
+    /**
+     * Construct an instance with an error code and message specified.
+     *
+     * @param message The error message
+     * @param code    The error code 
+     */
+    public MetaMatrixSecurityException( String code, String message ) {
+        super( code, message );
+    }
+    /**
+     * Constructs an instance of the exception with the specified detail message
+     * and a single exception. A detail message is a String that describes this
+     * particular exception.
+     * @param message the detail message
+     * @param e the exception that is encapsulated by this exception
+     */
+    public MetaMatrixSecurityException( Throwable e, String message ) {
+        super(e, message);
+    }
+    /**
+     * Constructs an instance of the exception with no detail message but with a
+     * single exception.
+     * @param e the exception that is encapsulated by this exception
+     */
+    public MetaMatrixSecurityException(Throwable e) {
+        super(e);
+    }
+    /**
+     * Constructs an instance of the exception with the specified detail message. A detail
+     * message is a String that describes this particular exception.
+     * @param the detail message
+     */
+    public MetaMatrixSecurityException(String message) {
+    	super(message);
+    }
+}
+

Modified: trunk/client/src/main/java/org/teiid/client/security/SessionToken.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/SessionToken.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/security/SessionToken.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.platform.security.api;
+package org.teiid.client.security;
 
 import java.io.Serializable;
 import java.util.UUID;

Added: trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,82 @@
+/*
+ * 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.client.util;
+
+import java.lang.reflect.Method;
+
+import org.teiid.adminapi.AdminComponentException;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminProcessingException;
+import org.teiid.client.xa.XATransactionException;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+import com.metamatrix.core.MetaMatrixRuntimeException;
+
+public class ExceptionUtil {
+	
+    @SuppressWarnings("unchecked")
+	public static <T extends Throwable> T getExceptionOfType(Throwable ex, Class<T> cls) {
+        while (ex != null) {
+            if (cls.isAssignableFrom(ex.getClass())) {
+                return (T)ex;
+            } 
+            if (ex.getCause() == ex) {
+            	break;
+            }
+            ex = ex.getCause();
+        }
+        return null;
+    }
+	
+	public static Throwable convertException(Method method, Throwable exception) {
+		boolean canThrowXATransactionException = false;
+		boolean canThrowComponentException = false;
+		boolean canThrowAdminException = false;
+        Class<?>[] exceptionClasses = method.getExceptionTypes();
+        for (int i = 0; i < exceptionClasses.length; i++) {
+			if (exception.getClass().isAssignableFrom(exceptionClasses[i])) {
+				return exception;
+			}
+			canThrowComponentException |= MetaMatrixComponentException.class.isAssignableFrom(exceptionClasses[i]);
+			canThrowAdminException |= AdminException.class.isAssignableFrom(exceptionClasses[i]);
+			canThrowXATransactionException |= XATransactionException.class.isAssignableFrom(exceptionClasses[i]);
+        }
+        if (canThrowComponentException) {
+        	return new MetaMatrixComponentException(exception);
+        }
+        if (canThrowAdminException) {
+			if (exception instanceof MetaMatrixProcessingException) {
+				return new AdminProcessingException(exception);
+			}
+        	return new AdminComponentException(exception);
+		}
+        if (canThrowXATransactionException) {
+        	return new XATransactionException(exception);
+        }
+        if (RuntimeException.class.isAssignableFrom(exception.getClass())) {
+        	return exception;
+        }
+        return new MetaMatrixRuntimeException(exception);
+	}
+}

Copied: trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/dqp/client/ResultsFuture.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,148 @@
+/*
+ * 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.client.util;
+
+import java.util.LinkedList;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+
+
+/**
+ * Implements a call back based future that can also have
+ * completion listeners.
+ */
+public class ResultsFuture<T> implements Future<T> {
+	
+	public static ResultsFuture<Void> NULL_FUTURE = new ResultsFuture<Void>();
+	
+	static {
+		NULL_FUTURE.getResultsReceiver().receiveResults(null);
+	}
+	
+	public interface CompletionListener<T> {
+		void onCompletion(ResultsFuture<T> future);
+	}
+	
+	private LinkedList<CompletionListener<T>> listeners = new LinkedList<CompletionListener<T>>();
+	
+	private T result;
+	private Throwable exception;
+	private boolean done;
+	private ResultsReceiver<T> resultsReceiver = new ResultsReceiver<T> () {
+		public void exceptionOccurred(Throwable e) {
+			synchronized (ResultsFuture.this) {
+				if (done) {
+					throw new IllegalStateException("Already sent results"); //$NON-NLS-1$
+				}
+				exception = e;
+				done = true;
+				ResultsFuture.this.notifyAll();
+			}
+			done();
+		}
+		public void receiveResults(T results) {
+			synchronized (ResultsFuture.this) {
+				if (done) {
+					throw new IllegalStateException("Already sent results"); //$NON-NLS-1$
+				}
+				result = results;
+				done = true;
+				ResultsFuture.this.notifyAll();
+			}
+			done();
+		}
+	}; 
+	
+	public ResultsFuture() {
+		
+	}
+	
+	public ResultsReceiver<T> getResultsReceiver() {
+		return resultsReceiver; 
+	}
+	
+	public boolean cancel(boolean mayInterruptIfRunning) {
+		return false;
+	}
+
+	public synchronized T get() throws InterruptedException, ExecutionException {
+		while (!this.done) {
+			this.wait();
+		}
+		return convertResult();
+	}
+	
+	protected T convertResult() throws ExecutionException {
+		if (exception != null) {
+			throw new ExecutionException(exception);
+		}
+		return result;
+	}
+
+	public synchronized T get(long timeout, TimeUnit unit) throws InterruptedException,
+			ExecutionException, TimeoutException {
+		long millis = unit.toMillis(timeout);
+		long start = System.currentTimeMillis();
+		while (!this.done) {
+			long waitTill = start + millis - System.currentTimeMillis();
+			if (waitTill <= 0) {
+				throw new TimeoutException();
+			}
+			this.wait(waitTill);
+		}
+		return convertResult();
+	}
+
+	public boolean isCancelled() {
+		return false;
+	}
+
+	public synchronized boolean isDone() {
+		return done;
+	}
+	
+	private void done() {
+		synchronized (this.listeners) {
+			for (CompletionListener<T> completionListener : this.listeners) {
+				completionListener.onCompletion(this);
+			}
+			this.listeners.clear();
+		}
+	}
+	
+	public void addCompletionListener(CompletionListener<T> listener) {
+		synchronized (this) {
+			if (done) {
+				listener.onCompletion(this);
+				return;
+			}
+			synchronized (this.listeners) {
+				this.listeners.add(listener);
+			}
+		}
+	}
+	
+}

Added: trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,31 @@
+/*
+ * 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.client.util;
+
+public interface ResultsReceiver<T> {
+	
+	void receiveResults(T results);
+	
+	void exceptionOccurred(Throwable e);
+	
+}

Copied: trunk/client/src/main/java/org/teiid/client/xa (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/xa)

Modified: trunk/client/src/main/java/org/teiid/client/xa/XATransactionException.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/xa/XATransactionException.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/xa/XATransactionException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.xa;
+package org.teiid.client.xa;
 
 import javax.transaction.xa.XAException;
 

Modified: trunk/client/src/main/java/org/teiid/client/xa/XidImpl.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/xa/XidImpl.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/client/xa/XidImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.xa;
+package org.teiid.client.xa;
 
 import java.io.Externalizable;
 import java.io.IOException;

Copied: trunk/client/src/main/java/org/teiid/net (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/api)

Copied: trunk/client/src/main/java/org/teiid/net/CommunicationException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/exception/CommunicationException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/CommunicationException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/CommunicationException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,61 @@
+/*
+ * 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 com.metamatrix.core.MetaMatrixCoreException;
+
+/**
+ * An error occurred in communication between client and server.  This 
+ * error may or may not be recoverable.  Generally the communication 
+ * transport should be able to tell the difference and recover if possible.
+ */
+public class CommunicationException extends MetaMatrixCoreException {
+    /**
+     * No-Arg Constructor
+     */
+    public CommunicationException(  ) {
+        super( );
+    }
+
+    /**
+     * @param message
+     */
+    public CommunicationException(String message) {
+        super(message);
+    }
+
+    /**
+     * @param e
+     */
+    public CommunicationException(Throwable e) {
+        super(e);
+    }
+
+    /**
+     * @param e
+     * @param message
+     */
+    public CommunicationException(Throwable e, String message) {
+        super(e, message);
+    }
+}

Copied: trunk/client/src/main/java/org/teiid/net/ConnectionException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/exception/ConnectionException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/ConnectionException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/ConnectionException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,61 @@
+/*
+ * 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 com.metamatrix.core.MetaMatrixCoreException;
+
+/**
+ * This exception indicates that an error has occurred during connection.  There
+ * are many possible reasons for this, but the most likely is a problem with
+ * connection parameters.  
+ */
+public class ConnectionException extends MetaMatrixCoreException {
+    /**
+     * No-Arg Constructor
+     */
+    public ConnectionException(  ) {
+        super( );
+    }
+
+    /**
+     * @param message
+     */
+    public ConnectionException(String message) {
+        super(message);
+    }
+
+    /**
+     * @param e
+     */
+    public ConnectionException(Throwable e) {
+        super(e);
+    }
+
+    /**
+     * @param e
+     * @param message
+     */
+    public ConnectionException(Throwable e, String message) {
+        super(e, message);
+    }
+}

Copied: trunk/client/src/main/java/org/teiid/net/HostInfo.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/api/HostInfo.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/HostInfo.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/HostInfo.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,102 @@
+/*
+ * 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.net.InetAddress;
+import java.net.UnknownHostException;
+
+import com.metamatrix.common.util.NetUtils;
+import com.metamatrix.core.util.ArgCheck;
+import com.metamatrix.core.util.HashCodeUtil;
+
+/**
+ * Defines the hostname/port or {@link InetAddress} to connect to a host.
+ * @since 4.2
+ */
+public class HostInfo {
+    // Host Name and Port Number
+    private String hostName;
+    private int portNumber = 0;
+    private InetAddress inetAddress;
+
+    public InetAddress getInetAddress() throws UnknownHostException {
+    	if (inetAddress != null) {
+    		return inetAddress;
+    	}
+    	return NetUtils.resolveHostByName(hostName);
+    }
+    
+    public HostInfo (String host, int port) {
+    	ArgCheck.isNotNull(host);
+		this.hostName = host.toLowerCase();
+    	this.portNumber = port;
+    	
+    	//only cache inetaddresses if they represent the ip. 
+    	try {
+			InetAddress addr = NetUtils.resolveHostByName(hostName);
+			if (addr.getHostAddress().equalsIgnoreCase(hostName)) {
+				this.inetAddress = addr;
+			}
+		} catch (UnknownHostException e) {
+		}
+    }
+    
+    public String getHostName() {
+        return hostName;
+    }
+
+    public int getPortNumber() {
+        return portNumber;
+    }
+    
+	public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(hostName).append(":").append(portNumber); //$NON-NLS-1$
+        return sb.toString();
+    }
+    
+    /** 
+     * @see java.lang.Object#equals(java.lang.Object)
+     * @since 4.2
+     */
+    public boolean equals(Object obj) {
+    	if (obj == this) {
+    		return true;
+    	}
+    	if (!(obj instanceof HostInfo)) {
+    		return false;
+    	}
+        HostInfo hostInfo = (HostInfo) obj;
+        return hostName.equals(hostInfo.getHostName()) && portNumber == hostInfo.getPortNumber();
+    }
+
+    /** 
+     * @see java.lang.Object#hashCode()
+     * @since 4.2
+     */
+    public int hashCode() {
+        int hc = HashCodeUtil.hashCode(0, hostName);
+        return HashCodeUtil.hashCode(hc, portNumber);
+    }
+
+}

Deleted: trunk/client/src/main/java/org/teiid/net/Message.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/Message.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/net/Message.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,68 +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 com.metamatrix.common.comm.api;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Serializable;
-
-
-public class Message implements Externalizable {
-	public static final long serialVersionUID = 1063704220782714098L;
-	private Serializable contents;
-	private Serializable messageKey;
-
-	public String toString() {
-		return "MessageHolder: contents=" + contents; //$NON-NLS-1$
-	}
-
-	public void setContents(Serializable contents) {
-		this.contents = contents;
-	}
-
-	public Serializable getContents() {
-		return contents;
-	}
-
-	public void readExternal(ObjectInput in) throws IOException,
-			ClassNotFoundException {
-		this.contents = (Serializable) in.readObject();
-		this.messageKey = (Serializable) in.readObject();
-	}
-
-	public void writeExternal(ObjectOutput out) throws IOException {
-		out.writeObject(this.contents);
-		out.writeObject(messageKey);
-	}
-
-	public Serializable getMessageKey() {
-		return messageKey;
-	}
-
-	public void setMessageKey(Serializable messageKey) {
-		this.messageKey = messageKey;
-	}
-
-}

Copied: trunk/client/src/main/java/org/teiid/net/NetPlugin.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/CommonCommPlugin.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/NetPlugin.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/NetPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,34 @@
+/*
+ * 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 com.metamatrix.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$
+}

Deleted: trunk/client/src/main/java/org/teiid/net/ResultsReceiver.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ResultsReceiver.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/net/ResultsReceiver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,31 +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 com.metamatrix.common.comm.api;
-
-public interface ResultsReceiver<T> {
-	
-	void receiveResults(T results);
-	
-	void exceptionOccurred(Throwable e);
-	
-}

Modified: trunk/client/src/main/java/org/teiid/net/ServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/net/ServerConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,10 +20,9 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.api;
+package org.teiid.net;
 
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.platform.security.api.LogonResult;
+import org.teiid.client.security.LogonResult;
 
 public interface ServerConnection {
 	

Modified: trunk/client/src/main/java/org/teiid/net/ServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/main/java/org/teiid/net/ServerConnectionFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,12 +20,10 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.api;
+package org.teiid.net;
 
 import java.util.Properties;
 
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
 
 public interface ServerConnectionFactory {
 	

Copied: trunk/client/src/main/java/org/teiid/net/TeiidURL.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/api/MMURL.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/TeiidURL.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/TeiidURL.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,321 @@
+/*
+ * 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.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
+
+
+/**
+ * Class defines the URL in the Teiid.
+ * 
+ * @since 4.2
+ */
+public class TeiidURL {
+
+    public static interface JDBC {
+	    // constant indicating Virtual database name
+	    public static final String VDB_NAME = "VirtualDatabaseName"; //$NON-NLS-1$
+	    // constant indicating Virtual database version
+	    public static final String VDB_VERSION = "VirtualDatabaseVersion"; //$NON-NLS-1$
+	    // constant for vdb version part of serverURL
+	    public static final String VERSION = "version"; //$NON-NLS-1$
+	}
+
+	public static interface CONNECTION {
+		public static final String CLIENT_IP_ADDRESS = "clientIpAddress"; //$NON-NLS-1$
+		public static final String CLIENT_HOSTNAME = "clientHostName"; //$NON-NLS-1$
+		/**
+		 * If true, will automatically select a new server instance after a communication exception.
+		 * @since 5.6
+		 */
+		public static final String AUTO_FAILOVER = "autoFailover";  //$NON-NLS-1$
+		
+		/**
+		 * A plugable discovery strategy for the client.  Defaults to using the AdminApi. 
+		 */
+		public static final String DISCOVERY_STRATEGY = "discoveryStategy"; //$NON-NLS-1$
+		
+		public static final String SERVER_URL = "serverURL"; //$NON-NLS-1$
+		/**
+		 * Non-secure Protocol.
+		 */        
+		public static final String NON_SECURE_PROTOCOL = "mm"; //$NON-NLS-1$
+		/**
+		 * Secure Protocol.
+		 */
+		public static final String SECURE_PROTOCOL = "mms"; //$NON-NLS-1$
+		// name of the application which is obtaining connection
+		public static final String APP_NAME = "ApplicationName"; //$NON-NLS-1$
+		// constant for username part of url
+		public static final String USER_NAME = "user"; //$NON-NLS-1$
+		// constant for password part of url
+		public static final String PASSWORD = "password"; //$NON-NLS-1$
+		
+		public static final String ADMIN = "admin"; //$NON-NLS-1$
+	}
+
+	public static final String DOT_DELIMITER = "."; //$NON-NLS-1$
+    public static final String DOUBLE_SLASH_DELIMITER = "//"; //$NON-NLS-1$
+    public static final String COMMA_DELIMITER = ","; //$NON-NLS-1$
+
+    public static final String COLON_DELIMITER = ":"; //$NON-NLS-1$
+    public static final String BACKSLASH_DELIMITER = "\\"; //$NON-NLS-1$
+    public static final String DEFAULT_PROTOCOL= TeiidURL.CONNECTION.NON_SECURE_PROTOCOL + "://"; //$NON-NLS-1$
+    public static final String SECURE_PROTOCOL= TeiidURL.CONNECTION.SECURE_PROTOCOL + "://"; //$NON-NLS-1$
+
+    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$
+
+
+    
+    /*
+     * appserver URL
+     */
+    private String appServerURL;
+    /*
+     * List of <code> HostData </code> in a cluster
+     */
+    private List<HostInfo> hosts = new ArrayList<HostInfo>();
+
+    private boolean usingSSL = false;
+    
+    /**
+     * Create an MMURL from the server URL.  For use by the server-side.
+     * @param serverURL   Expected format: mm[s]://server1:port1[,server2:port2]
+     * @since 4.2
+     */
+    public TeiidURL(String serverURL) {
+        appServerURL = serverURL;
+        if (!hasValidURLProtocol(serverURL)) {
+            throw new IllegalArgumentException(INVALID_FORMAT_SERVER);
+        }
+        usingSSL = isSecureProtocol(appServerURL);
+		parseURL(serverURL, INVALID_FORMAT_SERVER);
+    }
+    
+    public TeiidURL(String host, int port, boolean secure) {
+        usingSSL = secure;
+		hosts.add(new HostInfo(host, port));
+    }
+    
+    /**
+     * Validates that a server URL is in the correct format.
+     * @param serverURL  Expected format: mm[s]://server1:port1[,server2:port2]
+     * @since 4.2
+     */
+    public static boolean isValidServerURL(String serverURL) {
+        boolean valid = true;
+        try {
+            new TeiidURL(serverURL);            
+        } catch (Exception e) {
+            valid = false;
+        }
+        
+        return valid;
+    }
+
+    /**
+     * @param appServerURL2
+     * @return
+     */
+    private boolean isSecureProtocol(String url) { 
+        return url.toLowerCase().startsWith(SECURE_PROTOCOL);
+    }
+    
+    private boolean hasValidURLProtocol(String url) {
+        return url != null && (url.startsWith(DEFAULT_PROTOCOL) || url.startsWith(SECURE_PROTOCOL));        
+    }
+    
+    public List<HostInfo> getHostInfo() {
+        return hosts;
+    }
+    
+    /**
+     * Get a list of hosts
+     *  
+     * @return string of host seperated by commas
+     * @since 4.2
+     */
+    public String getHosts() {
+        StringBuffer hostList = new StringBuffer("");  //$NON-NLS-1$
+        if( hosts != null) {
+            Iterator<HostInfo> iterator = hosts.iterator();
+            while (iterator.hasNext()) {
+                HostInfo element = iterator.next();
+                hostList.append(element.getHostName());
+                if( iterator.hasNext()) { 
+                    hostList.append(COMMA_DELIMITER); 
+                }
+            }
+        }
+        return hostList.toString();
+    }
+    
+    /**
+     * Get a list of ports  
+     * 
+     * @return string of ports seperated by commas
+     * @since 4.2
+     */
+    public String getPorts() {
+        StringBuffer portList = new StringBuffer("");  //$NON-NLS-1$
+        if( hosts != null) {
+            Iterator<HostInfo> iterator = hosts.iterator();
+            while (iterator.hasNext()) {
+                HostInfo element = iterator.next();
+                portList.append(element.getPortNumber());
+                if( iterator.hasNext()) { 
+                    portList.append(COMMA_DELIMITER); 
+                }
+            }
+        }
+        return portList.toString();
+    }
+
+    private void parseURL(String url, String exceptionMessage) {
+
+        //      Parse property string
+        int urlProtocolIndex = url.indexOf(DOUBLE_SLASH_DELIMITER);
+        String serverURL;
+        if (urlProtocolIndex > 0) {
+            serverURL = url.substring(urlProtocolIndex + 2);
+            if(serverURL == null || serverURL.equals("")) { //$NON-NLS-1$
+                throw new IllegalArgumentException(exceptionMessage);
+            }
+			parseServerURL(serverURL, exceptionMessage);
+        } else {
+            throw new IllegalArgumentException(exceptionMessage);
+        }
+    }
+
+    /**
+     * @param url
+     * @throws UnknownHostException 
+     * @since 4.2
+     */
+    private void parseServerURL(String serverURL, String exceptionMessage) {
+        StringTokenizer st;
+        StringTokenizer st2;
+
+        st = new StringTokenizer(serverURL, COMMA_DELIMITER); 
+        if (!st.hasMoreTokens()) {
+            throw new IllegalArgumentException(exceptionMessage);
+        }
+        while (st.hasMoreTokens()) {
+            st2 = new StringTokenizer(st.nextToken(), COLON_DELIMITER);
+            try {
+                String host = st2.nextToken().trim();
+                String port = st2.nextToken().trim();
+                if (host.equals("")) { //$NON-NLS-1$
+                    throw new IllegalArgumentException("hostname can't be empty"); //$NON-NLS-1$
+                }
+                int portNumber;
+                try {
+                    portNumber = Integer.parseInt(port);
+                } catch (NumberFormatException nfe) {
+                    throw new IllegalArgumentException("port must be numeric:" + port); //$NON-NLS-1$
+                }
+                if (portNumber < 0 || portNumber > 0xFFFF) {
+                    throw new IllegalArgumentException("port out of range:" + portNumber); //$NON-NLS-1$
+                }
+                HostInfo hostInfo = new HostInfo(host, portNumber);
+                hosts.add(hostInfo);
+            } catch (NoSuchElementException nsee) {
+                throw new IllegalArgumentException(exceptionMessage);
+            } catch (NullPointerException ne) {
+                throw new IllegalArgumentException(exceptionMessage);
+            }
+        }
+    }
+
+    /**
+     * Get the Application Server URL
+     * 
+     * @return String for connection to the Server
+     * @since 4.2
+     */
+    public String getAppServerURL() {
+        if (appServerURL == null) {
+            StringBuffer sb = new StringBuffer();
+            if (usingSSL) {
+                sb.append(SECURE_PROTOCOL);
+            } else {
+                sb.append(DEFAULT_PROTOCOL);
+            }
+            Iterator<HostInfo> iter = hosts.iterator();
+            while (iter.hasNext()) {
+                HostInfo host = iter.next();
+                sb.append(host.getHostName());
+                sb.append(COLON_DELIMITER); 
+                sb.append(host.getPortNumber());
+                if (iter.hasNext()) {
+                    sb.append(COMMA_DELIMITER);
+                }
+            }
+            appServerURL = sb.toString();
+        }
+        return appServerURL;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     * @since 4.2
+     */
+    public String toString() {
+        return getAppServerURL(); 
+    }
+
+    /** 
+     * @see java.lang.Object#equals(java.lang.Object)
+     * @since 4.2
+     */
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } 
+        if (!(obj instanceof TeiidURL)) {
+            return false;
+        } 
+        TeiidURL url = (TeiidURL)obj;
+        return (appServerURL.equals(url.getAppServerURL()));
+    }
+    
+    /** 
+     * @see java.lang.Object#hashCode()
+     * @since 4.2
+     */
+    public int hashCode() {
+        return appServerURL.hashCode();
+    }
+
+	public boolean isUsingSSL() {
+		return usingSSL;
+	}
+
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,104 @@
+/*
+ * 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.socket;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.ProcessObject;
+import org.teiid.client.security.LogonResult;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+
+
+/**
+ * Will discover hosts based upon an anon admin api call.
+ */
+public class AdminApiServerDiscovery extends UrlServerDiscovery {
+	
+	/**
+	 * If the FIREWALL_HOST property is set, then this host name will be used instead of the process
+	 * names returned by the AdminApi
+	 */
+	public static final String USE_URL_HOST = "AdminApiServerDiscovery.useUrlHost"; //$NON-NLS-1$
+	
+	public static final int DISCOVERY_TIMEOUT = 120000;
+	
+	static class ClusterInfo {
+		volatile long lastDiscoveryTime;
+		volatile List<HostInfo> knownHosts = new ArrayList<HostInfo>();
+	}
+	
+	private static Map<String, ClusterInfo> clusterInfo = Collections.synchronizedMap(new HashMap<String, ClusterInfo>());
+	
+	private boolean useUrlHost;
+	
+	@Override
+	public void init(TeiidURL url, Properties p) {
+		super.init(url, p);
+		//TODO: this could be on a per cluster basis
+		useUrlHost = Boolean.valueOf(p.getProperty(USE_URL_HOST)).booleanValue();
+	}
+	
+	@Override
+	public List<HostInfo> getKnownHosts(LogonResult result,
+			SocketServerInstance instance) {
+		if (result == null) {
+			return super.getKnownHosts(result, instance);
+		}
+		ClusterInfo info = clusterInfo.get(result.getClusterName());
+		if (info == null) {
+			info = new ClusterInfo();
+		}
+		synchronized (info) {
+			if (instance != null 
+					&& (info.lastDiscoveryTime < System.currentTimeMillis() - DISCOVERY_TIMEOUT || info.knownHosts.isEmpty())) {
+				Admin serverAdmin = instance.getService(Admin.class);
+				try {
+					Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
+					info.knownHosts.clear();
+					for (ProcessObject processObject : processes) {
+						if (!processObject.isEnabled() || !processObject.isRunning()) {
+							continue;
+						}
+						info.knownHosts.add(new HostInfo(useUrlHost?instance.getHostInfo().getHostName():processObject.getInetAddress().getHostName(), processObject.getPort()));
+					}
+					info.lastDiscoveryTime = System.currentTimeMillis();
+				} catch (AdminException e) {
+					//ignore - will get an update on the next successful connection
+				}
+			}
+			if (info.knownHosts.size() == 0) {
+				return super.getKnownHosts(result, instance);
+			}
+			return new ArrayList<HostInfo>(info.knownHosts);
+		}
+	}
+}


Property changes on: trunk/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: trunk/client/src/main/java/org/teiid/net/socket/Handshake.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/Handshake.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/Handshake.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/Handshake.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,83 @@
+/*
+ * 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.socket;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.metamatrix.common.util.ApplicationInfo;
+
+/**
+ * Represents the information needed in a socket connection handshake  
+ */
+public class Handshake implements Externalizable {
+    
+	private static final long serialVersionUID = 7839271224736355515L;
+    
+    private String version = ApplicationInfo.getInstance().getMajorReleaseNumber();
+    private byte[] publicKey;
+    
+    /** 
+     * @return Returns the version.
+     */
+    public String getVersion() {
+        return this.version;
+    }
+    
+    /** 
+     * @param version The version to set.
+     */
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    /** 
+     * @return Returns the key.
+     */
+    public byte[] getPublicKey() {
+        return this.publicKey;
+    }
+    
+    /** 
+     * @param key The key to set.
+     */
+    public void setPublicKey(byte[] key) {
+        this.publicKey = key;
+    }
+    
+    @Override
+    public void readExternal(ObjectInput in) throws IOException,
+    		ClassNotFoundException {
+    	version = (String)in.readObject();
+    	publicKey = (byte[])in.readObject();
+    }
+    
+    @Override
+    public void writeExternal(ObjectOutput out) throws IOException {
+    	out.writeObject(version);
+    	out.writeObject(publicKey);
+    }
+    
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/Message.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/Message.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/Message.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,68 @@
+/*
+ * 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.socket;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+
+
+public class Message implements Externalizable {
+	public static final long serialVersionUID = 1063704220782714098L;
+	private Serializable contents;
+	private Serializable messageKey;
+
+	public String toString() {
+		return "MessageHolder: contents=" + contents; //$NON-NLS-1$
+	}
+
+	public void setContents(Serializable contents) {
+		this.contents = contents;
+	}
+
+	public Serializable getContents() {
+		return contents;
+	}
+
+	public void readExternal(ObjectInput in) throws IOException,
+			ClassNotFoundException {
+		this.contents = (Serializable) in.readObject();
+		this.messageKey = (Serializable) in.readObject();
+	}
+
+	public void writeExternal(ObjectOutput out) throws IOException {
+		out.writeObject(this.contents);
+		out.writeObject(messageKey);
+	}
+
+	public Serializable getMessageKey() {
+		return messageKey;
+	}
+
+	public void setMessageKey(Serializable messageKey) {
+		this.messageKey = messageKey;
+	}
+
+}

Copied: trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/ObjectChannel.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,41 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.util.concurrent.Future;
+
+public interface ObjectChannel {
+	
+	Object read() throws IOException, ClassNotFoundException;
+	
+	SocketAddress getRemoteAddress();
+		
+	Future<?> write(Object msg);
+	
+	boolean isOpen();
+	
+	void close();
+
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,38 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+
+import org.teiid.net.CommunicationException;
+
+
+public interface ObjectChannelFactory {
+
+	ObjectChannel createObjectChannel(SocketAddress address, boolean ssl) throws IOException,
+			CommunicationException;
+	
+	int getSoTimeout();
+	
+}
\ No newline at end of file

Added: trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,224 @@
+/*
+ * 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.socket;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketTimeoutException;
+import java.security.GeneralSecurityException;
+import java.util.Properties;
+import java.util.concurrent.Future;
+import java.util.logging.Logger;
+
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.socket.SocketUtil.SSLSocketFactory;
+import org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream;
+import org.teiid.netty.handler.codec.serialization.ObjectEncoderOutputStream;
+
+import com.metamatrix.common.util.PropertiesUtils;
+
+public final class OioOjbectChannelFactory implements ObjectChannelFactory {
+	
+	private final static int STREAM_BUFFER_SIZE = 1<<15;
+	private final static int MAX_OBJECT_SIZE = 1 << 25;
+	
+	private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+	
+	final static class OioObjectChannel implements ObjectChannel {
+		private final Socket socket;
+		private ObjectOutputStream outputStream;
+		private ObjectInputStream inputStream;
+		private Object readLock = new Object();
+
+		private OioObjectChannel(Socket socket) throws IOException {
+			log.fine("creating new OioObjectChannel"); //$NON-NLS-1$
+			this.socket = socket;
+            BufferedOutputStream bos = new BufferedOutputStream( socket.getOutputStream(), STREAM_BUFFER_SIZE);
+            outputStream = new ObjectEncoderOutputStream( new DataOutputStream(bos), 512);
+            //The output stream must be flushed on creation in order to write some initialization data
+            //through the buffered stream to the input stream on the other side
+            outputStream.flush();
+            final ClassLoader cl = this.getClass().getClassLoader();
+            BufferedInputStream bis = new BufferedInputStream(socket.getInputStream(), STREAM_BUFFER_SIZE);
+            inputStream = new ObjectDecoderInputStream(new DataInputStream(bis), cl, MAX_OBJECT_SIZE);
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public void close() {
+			log.finer("closing socket"); //$NON-NLS-1$
+			try {
+		        outputStream.flush();
+		    } catch (IOException e) {
+		        // ignore
+		    }
+		    try {
+		        outputStream.close();
+		    } catch (IOException e) {
+		        // ignore
+		    }
+		    try {
+		        inputStream.close();
+		    } catch (IOException e) {
+		        // ignore
+		    }
+		    try {
+		        socket.close();
+		    } catch (IOException e) {
+		        // ignore
+		    }
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public SocketAddress getRemoteAddress() {
+			return socket.getRemoteSocketAddress();
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public boolean isOpen() {
+			return !socket.isClosed();
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public Object read() throws IOException, ClassNotFoundException {
+			log.finer("reading message from socket"); //$NON-NLS-1$
+			synchronized (readLock) {
+				try {
+					return inputStream.readObject();
+				} catch (SocketTimeoutException e) {
+					throw e;
+		        } catch (IOException e) {
+		            close();
+		            throw e;
+				}
+			}
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public synchronized Future<?> write(Object msg) {
+			log.finer("writing message to socket"); //$NON-NLS-1$
+		    ResultsFuture<Void> result = new ResultsFuture<Void>();
+		    try {
+		        outputStream.writeObject(msg);
+		        outputStream.flush();     
+		        outputStream.reset();
+		    	result.getResultsReceiver().receiveResults(null);
+		    } catch (IOException e) {
+		        close();
+		    	result.getResultsReceiver().exceptionOccurred(e);
+		    }
+		    return result;
+		}
+	}
+
+	private Properties props;
+	private int receiveBufferSize = 0;
+	private int sendBufferSize = 0;
+	private boolean conserveBandwidth;
+	private int soTimeout = 3000;
+	private volatile SSLSocketFactory sslSocketFactory;
+
+	public OioOjbectChannelFactory(Properties props) {
+		this.props = props;
+		PropertiesUtils.setBeanProperties(this, props, "org.teiid.sockets"); //$NON-NLS-1$
+	}
+
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public ObjectChannel createObjectChannel(SocketAddress address, boolean ssl) throws IOException,
+			CommunicationException {
+		final Socket socket;
+		if (ssl) {
+			if (this.sslSocketFactory == null) {
+				try {
+					sslSocketFactory = SocketUtil.getSSLSocketFactory(props);
+				} catch (GeneralSecurityException e) {
+					throw new CommunicationException(e);
+				}
+			}
+			socket = sslSocketFactory.getSocket();
+		} else {
+			socket = new Socket();
+		}
+		if (receiveBufferSize > 0) {
+			socket.setReceiveBufferSize(receiveBufferSize);
+		}
+		if (sendBufferSize > 0) {
+			socket.setSendBufferSize(sendBufferSize);
+		}
+	    socket.setTcpNoDelay(!conserveBandwidth); // enable Nagle's algorithm to conserve bandwidth
+	    socket.connect(address);
+	    socket.setSoTimeout(soTimeout);
+	    return new OioObjectChannel(socket);
+	}
+	
+	public int getSendBufferSize() {
+		return sendBufferSize;
+	}
+
+	public void setSendBufferSize(int sendBufferSize) {
+		this.sendBufferSize = sendBufferSize;
+	}
+
+	public int getReceiveBufferSize() {
+		return receiveBufferSize;
+	}
+
+	public void setReceiveBufferSize(int receiveBufferSize) {
+		this.receiveBufferSize = receiveBufferSize;
+	}
+
+	public boolean isConserveBandwidth() {
+		return conserveBandwidth;
+	}
+
+	public void setConserveBandwidth(boolean conserveBandwidth) {
+		this.conserveBandwidth = conserveBandwidth;
+	}
+	
+	public void setSoTimeout(int soTimeout) {
+		this.soTimeout = soTimeout;
+	}
+
+	public int getSoTimeout() {
+		return soTimeout;
+	}
+}
\ No newline at end of file


Property changes on: trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,71 @@
+/*
+ * 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.socket;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.teiid.client.security.LogonResult;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+
+
+
+/**
+ * Customizable ServerDiscovery interface
+ */
+public interface ServerDiscovery {
+	
+	/**
+	 * Initialize the {@link ServerDiscovery}
+	 * @param url
+	 * @param p
+	 */
+	void init(TeiidURL url, Properties p);
+	
+	/**
+	 * Get the currently known hosts. 
+	 * @param result, the current {@link LogonResult} - may be null if unauthenticated 
+	 * @param instance, the currently connected instance - may be null if not connected
+	 * @return
+	 */
+	List<HostInfo> getKnownHosts(LogonResult result, SocketServerInstance instance);
+	
+	/**
+	 * Indicates that a connection was made successfully to the given host.
+	 * @param info
+	 */
+	void connectionSuccessful(HostInfo info);
+	
+	/**
+	 * Indicates that a connection could not be made to the given host.
+	 * @param info
+	 */
+	void markInstanceAsBad(HostInfo info);
+	
+	/**
+	 * Shutdown this {@link ServerDiscovery}
+	 */
+	void shutdown();
+		
+}


Property changes on: trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,67 @@
+/*
+ * 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.socket;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.metamatrix.core.util.ArgCheck;
+import com.metamatrix.core.util.ExternalizeUtil;
+
+public final class ServiceInvocationStruct implements Externalizable {
+	private static final long serialVersionUID = 1207674062670068350L;
+	public String targetClass;
+	public String methodName;
+	public Object[] args;
+	
+	public ServiceInvocationStruct() {
+		
+	}
+
+	public ServiceInvocationStruct(Object[] args, String methodName,
+			Class<?> targetClass) {
+		ArgCheck.isNotNull(methodName);
+		ArgCheck.isNotNull(targetClass);
+		this.args = args;
+		this.methodName = methodName;
+		this.targetClass = targetClass.getName();
+	}
+
+	public void readExternal(ObjectInput in) throws IOException,
+			ClassNotFoundException {
+		this.targetClass = (String)in.readObject();
+		this.methodName = (String)in.readObject();
+		this.args = ExternalizeUtil.readArray(in, Object.class);
+	}
+
+	public void writeExternal(ObjectOutput out) throws IOException {
+		out.writeObject(targetClass);
+		out.writeObject(methodName);
+		ExternalizeUtil.writeArray(out, args);
+	}
+}
\ No newline at end of file

Copied: trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/exception/SingleInstanceCommunicationException.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,63 @@
+/*
+ * 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.socket;
+
+import org.teiid.net.CommunicationException;
+
+
+/**
+ * An error occurred in communication between client and server.  This 
+ * error may or may not be recoverable.  Generally the communication 
+ * transport should be able to tell the difference and recover if possible.
+ */
+public class SingleInstanceCommunicationException extends CommunicationException {
+    /**
+     * No-Arg Constructor
+     */
+    public SingleInstanceCommunicationException(  ) {
+        super( );
+    }
+
+    /**
+     * @param message
+     */
+    public SingleInstanceCommunicationException(String message) {
+        super(message);
+    }
+
+
+    /**
+     * @param e
+     */
+    public SingleInstanceCommunicationException(Throwable e) {
+        super(e);
+    }
+
+    /**
+     * @param e
+     * @param message
+     */
+    public SingleInstanceCommunicationException(Throwable e, String message) {
+        super(e, message);
+    }
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,321 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.util.ExceptionUtil;
+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;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+
+/**
+ * Represents a client connection that maintains session state and allows for service fail over.
+ * Implements a sticky random selection policy.
+ */
+public class SocketServerConnection implements ServerConnection {
+	
+	private static final int RETRY_COUNT = 3;
+
+	private SocketServerInstanceFactory connectionFactory;
+    private ServerDiscovery serverDiscovery;
+    private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+
+	private boolean secure;
+    private Properties connProps;
+	
+	private SocketServerInstance serverInstance;
+    private volatile LogonResult logonResult;
+    private ILogon logon;
+    private Timer pingTimer;
+    private boolean closed;
+	private boolean failOver;
+    
+	public SocketServerConnection(
+			SocketServerInstanceFactory connectionFactory, boolean secure,
+			ServerDiscovery serverDiscovery, Properties connProps,
+			Timer pingTimer) throws CommunicationException, ConnectionException {
+		this.connectionFactory = connectionFactory;
+		this.serverDiscovery = serverDiscovery;
+		this.connProps = connProps;
+		this.secure = secure;
+		this.logon = this.getService(ILogon.class);
+		this.failOver = Boolean.valueOf(connProps.getProperty(TeiidURL.CONNECTION.AUTO_FAILOVER)).booleanValue();
+		
+        authenticate(); 
+        
+        this.pingTimer = pingTimer;
+        schedulePing();
+	}
+
+	private void schedulePing() {
+		if (this.pingTimer != null) {
+        	this.pingTimer.schedule(new TimerTask() {
+    			@Override
+    			public void run() {
+    				try {
+    					if (isOpen()) {
+    						logon.ping();
+    						return;
+    					} 
+    				} catch (InvalidSessionException e) {
+    					shutdown(false);
+    				} catch (MetaMatrixComponentException e) {
+    					close();
+    				} 
+    				this.cancel();
+    			}
+        	}, PING_INTERVAL, PING_INTERVAL);
+        }
+	}
+	
+	/**
+	 * Implements a sticky random selection policy
+	 * TODO: make this customizable
+	 * TODO: put more information on hostinfo as to process response time, last successful connect, etc.
+	 */
+	public synchronized SocketServerInstance selectServerInstance()
+			throws CommunicationException {
+		if (closed) {
+			throw new CommunicationException(NetPlugin.Util.getString("SocketServerConnection.closed")); //$NON-NLS-1$ 
+		}
+		if (this.serverInstance != null) {
+			if (this.serverInstance.isOpen()) {
+				return this.serverInstance;
+			}
+		}
+		List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance));
+		closeServerInstance();
+		List<HostInfo> hostCopy = new ArrayList<HostInfo>(hostKeys);
+		int knownHosts = hostKeys.size();
+		while (hostKeys.size() > 0) {
+			HostInfo hostInfo = hostKeys.remove((int) (Math.random() * hostKeys.size()));
+
+			Exception ex = null;
+			try {
+				SocketServerInstance instance = connectionFactory.getServerInstance(hostInfo, secure);
+				this.serverInstance = instance;
+				if (this.logonResult != null) {
+					ILogon newLogon = instance.getService(ILogon.class);
+					newLogon.assertIdentity(logonResult.getSessionToken());
+				}
+				this.serverDiscovery.connectionSuccessful(hostInfo);
+				return this.serverInstance;
+			} catch (IOException e) {
+				ex = e;
+			} catch (InvalidSessionException e) {
+				shutdown(false);
+				throw new CommunicationException(e,NetPlugin.Util.getString("SocketServerInstance.Connection_Error.Connect_Failed", hostInfo.getHostName(), String.valueOf(hostInfo.getPortNumber()), e.getMessage())); //$NON-NLS-1$
+			} catch (SingleInstanceCommunicationException e) { 
+				ex = e;
+			} catch (MetaMatrixComponentException e) {
+				ex = e;
+			} 	
+			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,NetPlugin.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$
+	}
+	
+	public synchronized void authenticate() throws ConnectionException, CommunicationException {
+		this.logonResult = null;
+        // Log on to server
+        try {
+            this.logonResult = logon.logon(connProps);
+            if (this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance).size() > 1) {
+            	//if there are multiple instances, allow for load-balancing
+            	closeServerInstance();
+            }
+            return;
+        } catch (LogonException e) {
+            // Propagate the original message as it contains the message we want
+            // to give to the user
+            throw new ConnectionException(e, e.getMessage());
+        } catch (MetaMatrixComponentException e) {
+        	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$
+        } 	
+	}
+	
+	class ServerConnectionInvocationHandler implements InvocationHandler {
+		
+		private Class<?> targetClass;
+		private Object target;
+		
+		public ServerConnectionInvocationHandler(Class<?> targetClass) {
+			this.targetClass = targetClass;
+		}
+		
+		private synchronized Object getTarget() throws CommunicationException {
+			if (this.target == null) {
+				this.target = selectServerInstance().getService(targetClass);
+			}
+			return this.target;
+		}
+				
+		public Object invoke(Object proxy, Method method, Object[] args)
+				throws Throwable {
+			Throwable exception = null;
+            for (int i = 0; i < RETRY_COUNT; i++) {
+		        try {
+	                return method.invoke(getTarget(), args);
+	            } catch (InvocationTargetException t) {
+	            	exception = t.getTargetException();
+	            } catch (Throwable t) {
+	            	exception = t;
+	            }
+	            if (exception instanceof SingleInstanceCommunicationException
+						|| exception.getCause() instanceof SingleInstanceCommunicationException) {
+	            	if (!failOver || !isOpen()) {
+	            		break;
+	            	}
+	            	invalidateTarget();
+	            } else {
+	            	break;
+	            }
+	            //TODO: look for invalid session exception
+			}
+	        throw ExceptionUtil.convertException(method, exception);
+		}
+		
+		private synchronized void invalidateTarget() {
+			this.target = null;
+		}
+	    
+	}
+
+	public <T> T getService(Class<T> iface) {
+		return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new ServerConnectionInvocationHandler(iface)));
+	}
+	public synchronized void close() {
+		shutdown(true);
+	}
+	private synchronized void shutdown(boolean logoff) {
+		if (this.closed) {
+			return;
+		}
+		
+		if (logoff) {
+			try {
+				//make a best effort to send the logoff
+				Future<?> writeFuture = this.logon.logoff();
+				writeFuture.get(5000, TimeUnit.MILLISECONDS);
+			} catch (InvalidSessionException e) {
+				//ignore
+			} catch (InterruptedException e) {
+				//ignore
+			} catch (ExecutionException e) {
+				//ignore
+			} catch (TimeoutException e) {
+				//ignore
+			} catch (MetaMatrixComponentException e) {
+				//ignore
+			}
+		}
+		
+		closeServerInstance();
+
+		this.closed = true;
+		this.serverDiscovery.shutdown();
+	}
+
+	public synchronized boolean isOpen() {
+		if (this.closed) {
+			return false;
+		}
+		try {
+			return selectServerInstance().isOpen();
+		} catch (CommunicationException e) {
+			return false;
+		}
+	}
+
+	public LogonResult getLogonResult() {
+		return logonResult;
+	}
+	
+	synchronized void closeServerInstance() {
+		if (this.serverInstance != null) {
+			this.serverInstance.shutdown();
+			this.serverInstance = null;
+		}
+	}
+	
+	public boolean isSameInstance(ServerConnection otherService) throws CommunicationException {
+		if (!(otherService instanceof SocketServerConnection)) {
+			return false;
+		}
+		SocketAddress address = selectServerInstance().getRemoteAddress();
+		if (address == null) {
+			return false;
+		}
+		return address.equals(((SocketServerConnection)otherService).selectServerInstance().getRemoteAddress());
+	}
+	
+	public void selectNewServerInstance(Object service) {
+		closeServerInstance();
+		ServerConnectionInvocationHandler handler = (ServerConnectionInvocationHandler)Proxy.getInvocationHandler(service);
+		handler.invalidateTarget();
+	}
+	
+	public void setFailOver(boolean failOver) {
+		this.failOver = failOver;
+	}
+}
\ No newline at end of file

Added: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,291 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.teiid.client.security.ILogon;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.ServerConnectionFactory;
+
+import com.metamatrix.common.util.NetUtils;
+import com.metamatrix.common.util.PropertiesUtils;
+import com.metamatrix.core.MetaMatrixCoreException;
+import com.metamatrix.core.util.ReflectionHelper;
+
+/**
+ * Responsible for creating socket based connections
+ * 
+ * The comm approach is object based and layered.  Connections manage failover and identity.  
+ * ServerInstances represent the service layer to a particular cluster member.  ObjectChannels
+ * abstract the underlying IO.
+ * 
+ */
+public class SocketServerConnectionFactory implements ServerConnectionFactory, SocketServerInstanceFactory {
+
+	private static final String URL = "URL"; //$NON-NLS-1$
+	
+	private static SocketServerConnectionFactory INSTANCE;
+	private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+
+	private final class ShutdownHandler implements InvocationHandler {
+		private final CachedInstance key;
+
+		private ShutdownHandler(CachedInstance key) {
+			this.key = key;
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public Object invoke(Object arg0, Method arg1, Object[] arg2)
+				throws Throwable {
+			if (arg1.getName().equals("shutdown")) { //$NON-NLS-1$
+				CachedInstance purge = null;
+				if (!key.actual.isOpen()) {
+					return null; //nothing to do
+				}
+				synchronized (instancePool) {
+					instancePool.put(key, key);
+					if (instancePool.size() > maxCachedInstances) {
+						Iterator<CachedInstance> iter = instancePool.keySet().iterator();
+						purge = iter.next();
+						iter.remove();
+					}
+				}
+				if (purge != null) {
+					purge.actual.shutdown();
+				}
+				return null;
+			}
+			try {
+				return arg1.invoke(key.actual, arg2);
+			} catch (InvocationTargetException e) {
+				throw e.getTargetException();
+			}
+		}
+	}
+
+	private static class CachedInstance {
+		HostInfo info;
+		Integer instance;
+		boolean ssl;
+		SocketServerInstance actual;
+		SocketServerInstance proxy;
+		
+		public CachedInstance(HostInfo info, boolean ssl) {
+			this.info = info;
+			this.ssl = ssl;
+		}
+
+		@Override
+		public int hashCode() {
+			return info.hashCode();
+		}
+		
+		@Override
+		public boolean equals(Object obj) {
+			if (this == obj) {
+				return true;
+			}
+			if (!(obj instanceof CachedInstance)) {
+				return false;
+			}
+			CachedInstance other = (CachedInstance) obj;
+			if (!info.equals(other.info) || ssl != other.ssl) {
+				return false;
+			}
+			if (instance == null || other.instance == null) {
+				return true;
+			} 
+			return instance.equals(other.instance);
+		}
+	}
+	
+    private ObjectChannelFactory channelFactory;
+	private Timer pingTimer;
+	
+	//instance pooling
+	private AtomicInteger instanceCount = new AtomicInteger();
+	private Map<CachedInstance, CachedInstance> instancePool = new LinkedHashMap<CachedInstance, CachedInstance>();
+
+	//config properties
+	private long synchronousTtl = 120000l;
+	private int maxCachedInstances=16;
+
+	public static synchronized SocketServerConnectionFactory getInstance() {
+		if (INSTANCE == null) {
+			INSTANCE = new SocketServerConnectionFactory();
+			Properties props = System.getProperties();
+			InputStream is = SocketServerConnectionFactory.class.getResourceAsStream("/teiid-client-settings.properties"); //$NON-NLS-1$
+			if (is != null) {
+				props = new Properties(props);
+				try {
+					props.load(is);
+				} catch (IOException e) {
+					
+				} finally {
+					try {
+						is.close();
+					} catch (IOException e) {
+					}
+				}
+			}
+			INSTANCE.initialize(props);
+		}
+		return INSTANCE;
+	}
+	
+	public SocketServerConnectionFactory() {
+		
+	}
+	
+	public void initialize(Properties info) {
+		PropertiesUtils.setBeanProperties(this, info, "org.teiid.sockets"); //$NON-NLS-1$
+		this.pingTimer = new Timer("SocketPing", true); //$NON-NLS-1$
+		this.channelFactory = new OioOjbectChannelFactory(info);
+	}
+			
+	public SocketServerInstance getServerInstance(HostInfo info, boolean ssl) throws CommunicationException, IOException {
+		CachedInstance key = null;
+		CachedInstance instance = null;
+		boolean useCache = this.maxCachedInstances > 0; 
+		if (useCache) {
+			key = new CachedInstance(info, ssl);
+			synchronized (instancePool) {
+				instance = instancePool.remove(key);
+			}
+			if (instance != null) {
+				ILogon logon = instance.actual.getService(ILogon.class);
+				boolean valid = false;
+				try {
+					Future<?> success = logon.ping();
+					success.get(this.channelFactory.getSoTimeout(), TimeUnit.MICROSECONDS);
+					valid = true;
+				} catch (Exception e) {
+					log.log(Level.FINE, "Error performing ping, will select another instance", e); //$NON-NLS-1$
+				}
+				if (valid) {
+					return instance.proxy;
+				}
+				instance.actual.shutdown();
+				//technically we only want to remove instances with the same inetaddress 
+				while (true) {
+					CachedInstance invalid = null;
+					synchronized (instancePool) {
+						invalid = instancePool.remove(key);
+					}
+					if (invalid == null) {
+						break;
+					}
+					invalid.actual.shutdown();
+				}
+			}
+		}
+		SocketServerInstanceImpl ssii = new SocketServerInstanceImpl(info, ssl, getSynchronousTtl());
+		ssii.connect(this.channelFactory);
+		if (useCache) {
+			key.actual = ssii;
+			key.instance = instanceCount.getAndIncrement();
+			//create a proxied socketserverinstance that will pool itself on shutdown
+			key.proxy = (SocketServerInstance)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {SocketServerInstance.class}, new ShutdownHandler(key));
+			return key.proxy;
+		}
+		return ssii;
+	}
+	
+	/**
+	 * @param connectionProperties will be updated with additional information before logon
+	 */
+	public SocketServerConnection getConnection(Properties connectionProperties) throws CommunicationException, ConnectionException {
+		
+		updateConnectionProperties(connectionProperties);
+		
+		TeiidURL url = new TeiidURL(connectionProperties.getProperty(TeiidURL.CONNECTION.SERVER_URL));
+		
+		String discoveryStrategyName = connectionProperties.getProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, URL);
+
+		ServerDiscovery discovery;
+
+		if (URL.equalsIgnoreCase(discoveryStrategyName)) {
+			discovery = new UrlServerDiscovery();
+		} else {
+			try {
+				discovery = (ServerDiscovery)ReflectionHelper.create(discoveryStrategyName, null, this.getClass().getClassLoader());
+			} catch (MetaMatrixCoreException e) {
+				throw new ConnectionException(e);
+			}
+		}
+		
+		discovery.init(url, connectionProperties);
+		
+		return new SocketServerConnection(this, url.isUsingSSL(), discovery, connectionProperties, pingTimer);
+	}
+
+	static void updateConnectionProperties(Properties connectionProperties) {
+		try {
+			InetAddress addr = NetUtils.getInstance().getInetAddress();
+			connectionProperties.put(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS, addr.getHostAddress());
+			connectionProperties.put(TeiidURL.CONNECTION.CLIENT_HOSTNAME, addr.getCanonicalHostName());
+        } catch (UnknownHostException err1) {
+        	connectionProperties.put(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS, "UnknownClientAddress"); //$NON-NLS-1$
+        }
+	}
+
+	public long getSynchronousTtl() {
+		return synchronousTtl;
+	}
+
+	public void setSynchronousTtl(long synchronousTTL) {
+		this.synchronousTtl = synchronousTTL;
+	}
+
+	public int getMaxCachedInstances() {
+		return maxCachedInstances;
+	}
+	
+	public void setMaxCachedInstances(int maxCachedInstances) {
+		this.maxCachedInstances = maxCachedInstances;
+	}
+
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,45 @@
+/*
+ * 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.socket;
+
+import java.net.SocketAddress;
+
+import org.teiid.net.HostInfo;
+
+import com.metamatrix.common.util.crypto.Cryptor;
+
+public interface SocketServerInstance {
+
+	<T> T getService(Class<T> iface);
+
+	void shutdown();
+
+	SocketAddress getRemoteAddress();
+	
+	HostInfo getHostInfo();
+	
+	boolean isOpen();
+	
+	Cryptor getCryptor();
+
+}
\ No newline at end of file

Added: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,35 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+
+import org.teiid.net.CommunicationException;
+import org.teiid.net.HostInfo;
+
+
+public interface SocketServerInstanceFactory {
+	
+	SocketServerInstance getServerInstance(HostInfo info, boolean ssl) throws CommunicationException, IOException;
+
+}
\ No newline at end of file

Added: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,376 @@
+/*
+ * 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.socket;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketTimeoutException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.teiid.client.DQP;
+import org.teiid.client.util.ExceptionUtil;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.util.ResultsReceiver;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.NetPlugin;
+
+import com.metamatrix.api.exception.ExceptionHolder;
+import com.metamatrix.common.util.ApplicationInfo;
+import com.metamatrix.common.util.crypto.CryptoException;
+import com.metamatrix.common.util.crypto.Cryptor;
+import com.metamatrix.common.util.crypto.DhKeyGenerator;
+import com.metamatrix.common.util.crypto.NullCryptor;
+
+/**
+ * Client view of a socket server connection that exposes remote services
+ * On construction this class will create a channel and exchange a handshake.
+ * That handshake will establish a {@link Cryptor} to be used for secure traffic.
+ */
+public class SocketServerInstanceImpl implements SocketServerInstance {
+	
+	static final int HANDSHAKE_RETRIES = 10;
+    private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+
+	private AtomicInteger MESSAGE_ID = new AtomicInteger();
+    private Map<Serializable, ResultsReceiver<Object>> asynchronousListeners = new ConcurrentHashMap<Serializable, ResultsReceiver<Object>>();
+
+	private HostInfo hostInfo;
+	private boolean ssl;
+    private long synchTimeout;
+
+    private ObjectChannel socketChannel;
+    private Cryptor cryptor;
+    
+    private boolean hasReader;
+    
+    public SocketServerInstanceImpl() {
+    	
+    }
+
+    public SocketServerInstanceImpl(final HostInfo host, boolean ssl, long synchTimeout) {
+        this.hostInfo = host;
+        this.ssl = ssl;
+        this.synchTimeout = synchTimeout;
+    }
+    
+    public synchronized void connect(ObjectChannelFactory channelFactory) throws CommunicationException, IOException {
+        InetSocketAddress address = new InetSocketAddress(hostInfo.getInetAddress(), hostInfo.getPortNumber());
+        this.socketChannel = channelFactory.createObjectChannel(address, ssl);
+        try {
+        	doHandshake();
+        } catch (CommunicationException e) {
+        	this.socketChannel.close();
+        	throw e;
+        } catch (IOException e) {
+        	this.socketChannel.close();
+        	throw e;
+        }
+    }
+    
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+    public HostInfo getHostInfo() {
+    	return this.hostInfo;
+    }
+    
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+    public SocketAddress getRemoteAddress() {
+    	return this.socketChannel.getRemoteAddress();
+    }
+    
+    static String getVersionInfo() {
+        return ApplicationInfo.getInstance().getMajorReleaseNumber();
+    }
+    
+    private void doHandshake() throws IOException, CommunicationException {
+    	Handshake handshake = null;
+    	for (int i = 0; i < HANDSHAKE_RETRIES; i++) {
+	        try {
+				Object obj = this.socketChannel.read();
+				
+				if (!(obj instanceof Handshake)) {
+					throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstanceImpl.handshake_error"));  //$NON-NLS-1$
+				}
+				handshake = (Handshake)obj;
+				break;
+			} catch (ClassNotFoundException e1) {
+				throw new CommunicationException(e1);
+			} catch (SocketTimeoutException e) {
+				if (i == HANDSHAKE_RETRIES - 1) {
+					throw e;
+				}
+			}
+    	}
+
+        try {
+            if (!getVersionInfo().equals(handshake.getVersion())) {
+                throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstanceImpl.version_mismatch", getVersionInfo(), handshake.getVersion())); //$NON-NLS-1$
+            }
+            
+            handshake.setVersion(getVersionInfo());
+            
+            byte[] serverPublicKey = handshake.getPublicKey();
+            
+            if (serverPublicKey != null) {
+            	DhKeyGenerator keyGen = new DhKeyGenerator();
+            	byte[] publicKey = keyGen.createPublicKey();
+                this.cryptor = keyGen.getSymmetricCryptor(serverPublicKey);
+                handshake.setPublicKey(publicKey);
+            } else {
+                this.cryptor = new NullCryptor();
+            }
+            
+            this.socketChannel.write(handshake);
+        } catch (CryptoException err) {
+        	throw new CommunicationException(err);
+        }
+    }
+
+    public boolean isOpen() {
+        return socketChannel.isOpen();
+    }
+
+    protected void send(Message message, ResultsReceiver<Object> listener, Serializable messageKey)
+        throws CommunicationException, InterruptedException {
+	    if (listener != null) {
+	        asynchronousListeners.put(messageKey, listener);
+	    }
+	    message.setMessageKey(messageKey);
+	    boolean success = false;
+	    try {
+	        Future<?> writeFuture = socketChannel.write(message);
+	        writeFuture.get(); //client writes are blocking to ensure proper failure handling
+	        success = true;
+	    } catch (ExecutionException e) {
+        	throw new SingleInstanceCommunicationException(e);
+	    } finally {
+	    	if (!success) {
+	    		asynchronousListeners.remove(messageKey);	    		
+	    	}
+	    }
+    }
+
+    /**
+     * Send an exception to all clients that are currently waiting for a
+     * response.
+     */
+	private void exceptionOccurred(Throwable e) {
+    	if (e instanceof CommunicationException) {
+	        if (e.getCause() instanceof InvalidClassException) {
+	            log.log(Level.SEVERE, "Unknown class or incorrect class version:", e); //$NON-NLS-1$ 
+	        } else {
+	            log.log(Level.FINE, "Unable to read: socket was already closed.", e); //$NON-NLS-1$ 
+	        }
+    	} else if (e instanceof EOFException) {
+            log.log(Level.FINE, "Unable to read: socket was already closed.", e); //$NON-NLS-1$ 
+    	} else {
+            log.log(Level.WARNING, "Unable to read: unexpected exception", e); //$NON-NLS-1$ 
+    	}
+    			
+        if (!(e instanceof SingleInstanceCommunicationException)) {
+        	e = new SingleInstanceCommunicationException(e);
+        }
+
+        Set<Map.Entry<Serializable, ResultsReceiver<Object>>> entries = this.asynchronousListeners.entrySet();
+        for (Iterator<Map.Entry<Serializable, ResultsReceiver<Object>>> iterator = entries.iterator(); iterator.hasNext();) {
+			Map.Entry<Serializable, ResultsReceiver<Object>> entry = iterator.next();
+			iterator.remove();
+			entry.getValue().exceptionOccurred(e);
+		}
+    }
+
+	private void receivedMessage(Object packet) {
+		log.log(Level.FINE, "reading packet"); //$NON-NLS-1$ 
+        if (packet instanceof Message) {
+        	Message messagePacket = (Message)packet;
+        	Serializable messageKey = messagePacket.getMessageKey();
+            log.log(Level.FINE, "read asynch message:" + messageKey); //$NON-NLS-1$ 
+            ResultsReceiver<Object> listener = asynchronousListeners.remove(messageKey);
+            if (listener != null) {
+                listener.receiveResults(messagePacket.getContents());
+            }
+        } else {
+        	log.log(Level.FINE, "packet ignored:" + packet); //$NON-NLS-1$ 
+        }
+    }
+    
+    public void shutdown() {
+    	socketChannel.close();
+    }
+
+    /** 
+     * @return Returns the cryptor.
+     */
+    public Cryptor getCryptor() {
+        return this.cryptor;
+    }
+    
+    void read(long timeout, TimeUnit unit, ResultsFuture<?> future) throws TimeoutException, InterruptedException {
+    	long timeoutMillis = (int)Math.min(unit.toMillis(timeout), Integer.MAX_VALUE);
+		long start = System.currentTimeMillis();
+		while (!future.isDone()) {
+			boolean reading = false;
+			synchronized (this) {
+				if (!hasReader) {
+					hasReader = true;
+					reading = true;
+				} else if (!future.isDone()) {
+					this.wait(Math.max(1, timeoutMillis));
+				}
+			} 
+			if (reading) {
+				try {
+					if (!future.isDone()) {
+						receivedMessage(socketChannel.read());
+					}
+				} catch (SocketTimeoutException e) {
+				} catch (Exception e) {
+					exceptionOccurred(e);
+				} finally {
+					synchronized (this) {
+						hasReader = false;
+						this.notifyAll();
+					}
+				}
+			}
+			if (!future.isDone()) {
+				long now = System.currentTimeMillis();
+				timeoutMillis -= now - start;
+				start = now;
+				if (timeoutMillis <= 0) {
+					throw new TimeoutException();
+				}
+			}
+		}
+    }
+
+	@SuppressWarnings("unchecked")
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public <T> T getService(Class<T> iface) {
+		return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new RemoteInvocationHandler(iface));
+	}
+	
+	public class RemoteInvocationHandler implements InvocationHandler {
+
+		private boolean secure;
+		private Class<?> targetClass;
+		
+		public RemoteInvocationHandler(Class<?> targetClass) {
+			this.targetClass = targetClass;
+			this.secure = !DQP.class.isAssignableFrom(targetClass);
+		}
+
+		//## JDBC4.0-begin ##
+		@Override
+		//## JDBC4.0-end ##
+		public Object invoke(Object proxy, Method method, Object[] args)
+				throws Throwable {
+			Throwable t = null;
+			try {
+				Message message = new Message();
+				message.setContents(new ServiceInvocationStruct(args, method.getName(),
+						targetClass));
+				if (secure) {
+					message.setContents(getCryptor().sealObject(message.getContents()));
+				}
+				ResultsFuture<Object> results = new ResultsFuture<Object>() {
+					@Override
+					protected Object convertResult() throws ExecutionException {
+						try {
+							Object result = getCryptor().unsealObject((Serializable) super.convertResult());
+							if (result instanceof ExceptionHolder) {
+								throw new ExecutionException(((ExceptionHolder)result).getException());
+							}
+							if (result instanceof Throwable) {
+								throw new ExecutionException((Throwable)result);
+							}
+							return result;
+						} catch (CryptoException e) {
+							throw new ExecutionException(e);
+						}
+					}
+					
+					@Override
+					public Object get() throws InterruptedException, ExecutionException {
+						try {
+							return this.get(SocketServerConnectionFactory.getInstance().getSynchronousTtl(), TimeUnit.MILLISECONDS);
+						} catch (TimeoutException e) {
+							throw new ExecutionException(e);
+						} 
+					}
+					
+					/**
+					 * get calls are overridden to provide a thread in which to perform
+					 * the actual reads. 
+					 */
+					@Override
+					public Object get(long timeout, TimeUnit unit)
+							throws InterruptedException, ExecutionException,
+							TimeoutException {
+						read(timeout, unit, this);
+						return super.get(timeout, unit);
+					}
+				};
+				final ResultsReceiver<Object> receiver = results.getResultsReceiver();
+	
+				send(message, receiver, Integer.valueOf(MESSAGE_ID.getAndIncrement()));
+				if (ResultsFuture.class.isAssignableFrom(method.getReturnType())) {
+					return results;
+				}
+				return results.get(synchTimeout, TimeUnit.MILLISECONDS);
+			} catch (ExecutionException e) {
+				t = e.getCause();
+			} catch (TimeoutException e) {
+				t = new SingleInstanceCommunicationException(e);
+			} catch (Throwable e) {
+				t = e;
+			}
+			throw ExceptionUtil.convertException(method, t);
+		}
+
+	}
+
+}
\ No newline at end of file

Copied: trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/SocketUtil.java)
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,228 @@
+/*
+ * 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.socket;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.Socket;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.Arrays;
+import java.util.Properties;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
+import org.teiid.net.NetPlugin;
+
+import com.metamatrix.core.util.Assertion;
+
+
+/** 
+ * This class provides some utility methods to create ssl sockets using the
+ * keystores and trust stores. these are the properties required for the making the 
+ * ssl connection
+ */
+public class SocketUtil {
+    
+    static final String TRUSTSTORE_PASSWORD = "org.teiid.ssl.trustStorePassword"; //$NON-NLS-1$
+    public static final String TRUSTSTORE_FILENAME = "org.teiid.ssl.trustStore"; //$NON-NLS-1$
+    static final String KEYSTORE_ALGORITHM = "org.teiid.ssl.algorithm"; //$NON-NLS-1$
+    static final String PROTOCOL = "org.teiid.ssl.protocol"; //$NON-NLS-1$
+    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$
+    
+    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 class SSLSocketFactory {
+    	private boolean isAnon;
+    	private javax.net.ssl.SSLSocketFactory factory;
+    	
+    	public SSLSocketFactory(SSLContext context, boolean isAnon) {
+			this.factory = context.getSocketFactory();
+			this.isAnon = isAnon;
+		}
+
+		public synchronized Socket getSocket() throws IOException {
+    		SSLSocket result = (SSLSocket)factory.createSocket();
+    		result.setUseClientMode(true);
+    		if (isAnon) {
+    			addCipherSuite(result, ANON_CIPHER_SUITE);
+    		}
+    		return result;
+    	}
+    }
+    
+    public static SSLSocketFactory getSSLSocketFactory(Properties props) throws IOException, GeneralSecurityException{
+        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 keystoreAlgorithm = props.getProperty(KEYSTORE_ALGORITHM); 
+        String truststore = props.getProperty(TRUSTSTORE_FILENAME, keystore); 
+        String truststorePassword = props.getProperty(TRUSTSTORE_PASSWORD, keystorePassword); 
+        
+        boolean anon = NONE.equalsIgnoreCase(truststore);
+        
+        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) {
+            // 2 way SSL
+            result = getClientSSLContext(keystore, keystorePassword, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
+        } else  if(truststore != null) {
+            // One way SSL with custom properties defined
+            result = getClientSSLContext(null, null, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
+        } else {
+        	//## JDBC4.0-begin ##
+        	result = SSLContext.getDefault();
+        	//## JDBC4.0-end ##
+        	/*## JDBC3.0-JDK1.5-begin ##
+			result = SSLContext.getInstance("Default"); 
+ 	  	      ## JDBC3.0-JDK1.5-end ##*/
+        }
+        return new SSLSocketFactory(result, anon);
+    }
+    
+    /**
+     * create socket factory for the client socket.  
+     * @throws GeneralSecurityException 
+     */
+    static SSLContext getClientSSLContext(String keystore,
+                                            String password,
+                                            String truststore,
+                                            String truststorePassword,
+                                            String algorithm,
+                                            String keystoreType,
+                                            String protocol) throws IOException, GeneralSecurityException {
+        return getSSLContext(keystore, password, truststore, truststorePassword, algorithm, keystoreType, protocol);
+    }
+    
+    public static void addCipherSuite(SSLSocket engine, String cipherSuite) {
+        Assertion.assertTrue(Arrays.asList(engine.getSupportedCipherSuites()).contains(cipherSuite));
+
+        String[] suites = engine.getEnabledCipherSuites();
+
+        String[] newSuites = new String[suites.length + 1];
+        System.arraycopy(suites, 0, newSuites, 0, suites.length);
+        
+        newSuites[suites.length] = cipherSuite;
+        
+        engine.setEnabledCipherSuites(newSuites);
+    }
+
+    public static SSLContext getAnonSSLContext() throws IOException, GeneralSecurityException {
+        return getSSLContext(null, null, null, null, null, null, ANON_PROTOCOL);
+    }
+    
+    public static SSLContext getSSLContext(String keystore,
+                                            String password,
+                                            String truststore,
+                                            String truststorePassword,
+                                            String algorithm,
+                                            String keystoreType,
+                                            String protocol) throws IOException, GeneralSecurityException {
+        
+    	if (algorithm == null) {
+    		algorithm = KeyManagerFactory.getDefaultAlgorithm();
+    	}
+        // Configure the Keystore Manager
+        KeyManager[] keyManagers = null;
+        if (keystore != null) {
+            KeyStore ks = loadKeyStore(keystore, password, keystoreType);
+            if (ks != null) {
+                KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm);
+                kmf.init(ks, password.toCharArray());
+                keyManagers = kmf.getKeyManagers();
+            }
+        }
+        
+        // Configure the Trust Store Manager
+        TrustManager[] trustManagers = null;
+        if (truststore != null) {
+            KeyStore ks = loadKeyStore(truststore, truststorePassword, keystoreType);
+            if (ks != null) {
+                TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
+                tmf.init(ks);
+                trustManagers = tmf.getTrustManagers();
+            }
+        } 
+
+        // Configure the SSL
+        SSLContext sslc = SSLContext.getInstance(protocol);
+        sslc.init(keyManagers, trustManagers, null);
+        return sslc;
+    }
+    
+    /**
+     * Load any defined keystore file, by first looking in the classpath
+     * then looking in the file system path.
+     *   
+     * @param name - name of the keystore
+     * @param password - password to load the keystore
+     * @param type - type of the keystore
+     * @return loaded keystore 
+     */
+    public static KeyStore loadKeyStore(String name, String password, String type) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException {
+        
+        // Check in the classpath
+        InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
+        if (stream == null) {
+            try {
+                stream = new FileInputStream(name);
+            } catch (FileNotFoundException e) {
+                IOException exception = new IOException(NetPlugin.Util.getString("SocketHelper.keystore_not_found", name)); //$NON-NLS-1$
+                exception.initCause(e);
+                throw exception;
+            }
+        }
+                
+        KeyStore ks = KeyStore.getInstance(type);        
+        
+        ks.load(stream, password != null ? password.toCharArray() : null);
+        return ks;
+    }
+
+}

Added: trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java	                        (rev 0)
+++ trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,83 @@
+/*
+ * 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.socket;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.teiid.client.security.LogonResult;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+
+
+/**
+ * Simple URL discovery strategy
+ */
+public class UrlServerDiscovery implements ServerDiscovery {
+
+	private TeiidURL url;
+	
+	public UrlServerDiscovery() {
+	}
+	
+	public UrlServerDiscovery(TeiidURL url) {
+		this.url = url;
+	}
+	
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public List<HostInfo> getKnownHosts(LogonResult result,
+			SocketServerInstance instance) {
+		return url.getHostInfo();
+	}
+
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public void init(TeiidURL url, Properties p) {
+		this.url = url;
+	}
+	
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public void connectionSuccessful(HostInfo info) {
+		
+	}
+
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public void markInstanceAsBad(HostInfo info) {
+		
+	}
+		
+	//## JDBC4.0-begin ##
+	@Override
+	//## JDBC4.0-end ##
+	public void shutdown() {
+		
+	}
+	
+}


Property changes on: trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: trunk/client/src/main/resources/org/teiid/net/i18n.properties (from rev 1978, trunk/client/src/main/resources/com/metamatrix/common/comm/i18n.properties)
===================================================================
--- trunk/client/src/main/resources/org/teiid/net/i18n.properties	                        (rev 0)
+++ trunk/client/src/main/resources/org/teiid/net/i18n.properties	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,134 @@
+#
+# 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.
+

Deleted: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/TestSocketUtil.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/TestSocketUtil.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/TestSocketUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -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 com.metamatrix.common.comm.platform.socket;
-
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import com.metamatrix.core.util.UnitTestUtil;
-
-public class TestSocketUtil extends TestCase {
-	
-    public void testNoPassword() throws Exception {
-        SocketUtil.loadKeyStore(UnitTestUtil.getTestDataFile("metamatrix.keystore").getAbsolutePath(), null, "JKS"); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-    
-    public void testMissingKeyStore() throws Exception {
-        try {
-        	SocketUtil.loadKeyStore("metamatrix.keystorefoo", null, "JKS"); //$NON-NLS-1$ //$NON-NLS-2$
-            fail("expected exception"); //$NON-NLS-1$
-        } catch (IOException ex) {
-            assertEquals("Key store 'metamatrix.keystorefoo' was not found.", ex.getMessage()); //$NON-NLS-1$
-        }
-    }
-
-
-}

Copied: trunk/client/src/test/java/org/teiid/client (from rev 1978, trunk/client/src/test/java/com/metamatrix/dqp/client)

Copied: trunk/client/src/test/java/org/teiid/client/TestBatchSerializer.java (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/batch/TestBatchSerializer.java)
===================================================================
--- trunk/client/src/test/java/org/teiid/client/TestBatchSerializer.java	                        (rev 0)
+++ trunk/client/src/test/java/org/teiid/client/TestBatchSerializer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,202 @@
+/*
+ * 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.client;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.client.BatchSerializer;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.common.types.DataTypeManager;
+
+
+/** 
+ * @since 4.2
+ */
+public class TestBatchSerializer extends TestCase {
+
+    private static void assertEqual(List[] expectedBatch, List[] batch) {
+        if (expectedBatch == null) {
+            assertNull(batch);
+            return;
+        }
+        assertEquals(expectedBatch.length, batch.length);
+        if (expectedBatch.length > 0) {
+            int columns = expectedBatch[0].size();
+            for (int row = 0; row < expectedBatch.length; row++) {
+                for (int col = 0; col < columns; col++) {
+                    assertEquals(expectedBatch[row].get(col), batch[row].get(col));
+                }
+            }
+        }
+    }
+    
+    private static void helpTestSerialization(String[] types, List[] batch) throws IOException, ClassNotFoundException {
+        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream(byteStream);
+        BatchSerializer.writeBatch(out, types, batch);
+        out.flush();
+        
+        byte[] bytes = byteStream.toByteArray();
+        
+        ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytes);
+        ObjectInputStream in = new ObjectInputStream(bytesIn);
+        List[] newBatch = BatchSerializer.readBatch(in, types);
+        out.close();
+        in.close();
+
+        assertEqual(batch, newBatch);
+    }
+    
+    private static final String[] sampleBatchTypes = {DataTypeManager.DefaultDataTypes.BIG_DECIMAL,
+                                                      DataTypeManager.DefaultDataTypes.BIG_INTEGER,
+                                                      DataTypeManager.DefaultDataTypes.BOOLEAN,
+                                                      DataTypeManager.DefaultDataTypes.BYTE,
+                                                      DataTypeManager.DefaultDataTypes.CHAR,
+                                                      DataTypeManager.DefaultDataTypes.DATE,
+                                                      DataTypeManager.DefaultDataTypes.DOUBLE,
+                                                      DataTypeManager.DefaultDataTypes.FLOAT,
+                                                      DataTypeManager.DefaultDataTypes.INTEGER,
+                                                      DataTypeManager.DefaultDataTypes.LONG,
+                                                      DataTypeManager.DefaultDataTypes.SHORT,
+                                                      DataTypeManager.DefaultDataTypes.STRING,
+                                                      DataTypeManager.DefaultDataTypes.TIME,
+                                                      DataTypeManager.DefaultDataTypes.TIMESTAMP
+                                                     };
+    private static String sampleString(int length) {
+        char[] chars = new char[length];
+        for (int i = 0; i < length; i++) {
+            chars[i] = (char)i;
+        }
+        return new String(chars);
+    }
+    
+    private static List[] sampleBatch(int rows) {
+        List[] batch = new List[rows];
+        
+        for (int i = 0; i < rows; i++) {
+            long currentTime = System.currentTimeMillis();
+            Object[] data = { new BigDecimal("" + i), //$NON-NLS-1$
+                              new BigInteger(Integer.toString(i)),
+                              (i%2 == 0) ? Boolean.FALSE: Boolean.TRUE,
+                              new Byte((byte)i),
+                              new Character((char)i),
+                              new Date(currentTime),
+                              new Double(i),
+                              new Float(i),
+                              new Integer(i),
+                              new Long(i),
+                              new Short((short)i),
+                              sampleString(i),
+                              new Time(currentTime),
+                              new Timestamp(currentTime)
+                            };
+            batch[i] = Arrays.asList(data);
+        }
+        return batch;
+    }
+    
+    private static List[] sampleBatchWithNulls(int rows) {
+        List[] batch = new List[rows];
+        
+        for (int i = 0; i < rows; i++) {
+            long currentTime = System.currentTimeMillis();
+            int mod = i%14;
+            Object[] data = { (mod == 0) ? null : new BigDecimal("" + i), //$NON-NLS-1$
+                              (mod == 1) ? null : new BigInteger(Integer.toString(i)),
+                              (mod == 2) ? null : ((i%2 == 0) ? Boolean.FALSE: Boolean.TRUE),
+                              (mod == 3) ? null : new Byte((byte)i),
+                              (mod == 4) ? null : new Character((char)i),
+                              (mod == 5) ? null : new Date(currentTime),
+                              (mod == 6) ? null : new Double(i),
+                              (mod == 7) ? null : new Float(i),
+                              (mod == 8) ? null : new Integer(i),
+                              (mod == 9) ? null : new Long(i),
+                              (mod == 10) ? null : new Short((short)i),
+                              (mod == 11) ? null : sampleString(i),
+                              (mod == 12) ? null : new Time(currentTime),
+                              (mod == 13) ? null : new Timestamp(currentTime)
+                            };
+            batch[i] = Arrays.asList(data);
+        }
+        return batch;
+    }
+    
+    public void testSerializeBasicTypes() throws Exception {
+        // The number 8 is important here because boolean isNull information is packed into bytes,
+        // so we want to make sure the boundary cases are handled correctly
+        helpTestSerialization(sampleBatchTypes, sampleBatch(1)); // Less than 8 rows
+        helpTestSerialization(sampleBatchTypes, sampleBatch(8)); // Exactly 8 rows
+        helpTestSerialization(sampleBatchTypes, sampleBatch(17)); // More than 8 rows, but not a multiple of 8
+        helpTestSerialization(sampleBatchTypes, sampleBatch(120)); // A multiple of 8 rows
+        helpTestSerialization(sampleBatchTypes, sampleBatch(833)); // A bunch of rows. This should also test large strings
+    }
+    
+    public void testSerializeBasicTypes_NoTypeHints() throws Exception {
+        helpTestSerialization(null, sampleBatch(1));
+        helpTestSerialization(null, sampleBatch(8));
+        helpTestSerialization(null, sampleBatch(17));
+        helpTestSerialization(null, sampleBatch(120));
+        helpTestSerialization(null, sampleBatch(833));
+    }
+    
+    public void testSerializeBasicTypesWithNulls() throws Exception {
+        helpTestSerialization(sampleBatchTypes, sampleBatchWithNulls(1));
+        helpTestSerialization(sampleBatchTypes, sampleBatchWithNulls(8));
+        helpTestSerialization(sampleBatchTypes, sampleBatchWithNulls(17));
+        helpTestSerialization(sampleBatchTypes, sampleBatchWithNulls(120));
+        helpTestSerialization(sampleBatchTypes, sampleBatchWithNulls(833));
+    }
+    
+    public void testSerializeLargeStrings() throws Exception {
+        List row = Arrays.asList(new Object[] {sampleString(66666)});
+        helpTestSerialization(new String[] {DataTypeManager.DefaultDataTypes.STRING}, new List[] {row});
+    }
+    
+    public void testSerializeNoData() throws Exception {
+        helpTestSerialization(sampleBatchTypes, null);
+        helpTestSerialization(null, null);
+        helpTestSerialization(sampleBatchTypes, new List[0]);
+        helpTestSerialization(null, new List[0]);
+    }
+    
+    public void testSerializeDatatypeMismatch() throws Exception {
+        try {
+            helpTestSerialization(new String[] {DataTypeManager.DefaultDataTypes.DOUBLE}, new List[] {Arrays.asList(new Object[] {"Hello!"})}); //$NON-NLS-1$
+        } catch (IOException e) {
+            assertEquals("The modeled datatype double for column 0 doesn't match the runtime type \"java.lang.String\". Please ensure that the column's modeled datatype matches the expected data.", e.getMessage()); //$NON-NLS-1$
+        }
+    }
+}

Added: trunk/client/src/test/java/org/teiid/client/TestRequestMessage.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/TestRequestMessage.java	                        (rev 0)
+++ trunk/client/src/test/java/org/teiid/client/TestRequestMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,106 @@
+/*
+ * 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.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.StatementType;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.api.exception.MetaMatrixProcessingException;
+import com.metamatrix.core.util.UnitTestUtil;
+
+public class TestRequestMessage extends TestCase {
+
+    /**
+     * Constructor for TestRequestMessage.
+     * @param name
+     */
+    public TestRequestMessage(String name) {
+        super(name);
+    }
+
+    public static RequestMessage example() {
+        RequestMessage message = new RequestMessage();
+        message.setStatementType(StatementType.CALLABLE);
+        message.setFetchSize(100);
+        List params = new ArrayList();
+        params.add(new Integer(100));
+        params.add(new Integer(200));
+        params.add(new Integer(300));
+        params.add(new Integer(400));
+        message.setParameterValues(params);
+
+        message.setPartialResults(true);
+        message.setStyleSheet("myStyleSheet"); //$NON-NLS-1$
+        message.setExecutionPayload("myExecutionPayload"); //$NON-NLS-1$
+        try {
+			message.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_ON);
+		} catch (MetaMatrixProcessingException e) {
+			throw new RuntimeException(e);
+		} 
+
+        message.setValidationMode(true);
+        message.setXMLFormat("xMLFormat"); //$NON-NLS-1$
+        message.setShowPlan(true);
+        message.setRowLimit(1313);
+        return message;
+    }
+
+    public void testSerialize() throws Exception {
+        RequestMessage copy = UnitTestUtil.helpSerialize(example());
+
+        assertTrue(copy.isCallableStatement());
+        assertEquals(100, copy.getFetchSize());
+        assertNotNull(copy.getParameterValues());
+        assertEquals(4, copy.getParameterValues().size());
+        assertEquals(new Integer(100), copy.getParameterValues().get(0));
+        assertEquals(new Integer(200), copy.getParameterValues().get(1));
+        assertEquals(new Integer(300), copy.getParameterValues().get(2));
+        assertEquals(new Integer(400), copy.getParameterValues().get(3));
+
+        assertFalse(copy.isPreparedStatement());
+        assertEquals("myStyleSheet", copy.getStyleSheet()); //$NON-NLS-1$
+        assertEquals("myExecutionPayload", copy.getExecutionPayload()); //$NON-NLS-1$
+        assertEquals(RequestMessage.TXN_WRAP_ON, copy.getTxnAutoWrapMode());
+        assertTrue(copy.getValidationMode());
+        assertEquals("xMLFormat", copy.getXMLFormat()); //$NON-NLS-1$
+        assertTrue(copy.getShowPlan());
+        assertEquals(1313, copy.getRowLimit());
+        
+    }
+    
+    public void testInvalidTxnAutoWrap() {
+		RequestMessage rm = new RequestMessage();
+		try {
+			rm.setTxnAutoWrapMode("foo"); //$NON-NLS-1$
+			fail("exception expected"); //$NON-NLS-1$
+		} catch (MetaMatrixProcessingException e) {
+			assertEquals("'FOO' is an invalid transaction autowrap mode.", e.getMessage()); //$NON-NLS-1$
+		}
+	}
+
+}


Property changes on: trunk/client/src/test/java/org/teiid/client/TestRequestMessage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/client/src/test/java/org/teiid/client/TestResultsFuture.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/dqp/client/TestResultsFuture.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/TestResultsFuture.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,45 +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 com.metamatrix.dqp.client;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import junit.framework.TestCase;
-
-public class TestResultsFuture extends TestCase {
-
-	public void testGet() throws Exception {
-		ResultsFuture<Object> future = new ResultsFuture<Object>();
-		try {
-			future.get(-1, TimeUnit.MILLISECONDS);
-			fail("expected timeout exception"); //$NON-NLS-1$
-		} catch (TimeoutException e) {
-			
-		}
-		future.getResultsReceiver().receiveResults(new Object());
-		
-		assertNotNull(future.get(-1, TimeUnit.MILLISECONDS));
-	}
-	
-}

Copied: trunk/client/src/test/java/org/teiid/client/lob (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/lob)

Modified: trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/lob/TestByteLobChunk.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunk.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,10 +20,12 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.lob;
+package org.teiid.client.lob;
 
 import java.util.Arrays;
 
+import org.teiid.client.lob.LobChunk;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.core.util.UnitTestUtil;

Deleted: trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunkStream.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/lob/TestByteLobChunkStream.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/lob/TestByteLobChunkStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,66 +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 com.metamatrix.common.lob;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import com.metamatrix.core.util.UnitTestUtil;
-
-
-public class TestByteLobChunkStream extends TestCase {
-
-
-    public void testGetChunk() throws Exception {
-        File f = UnitTestUtil.getTestDataFile("legal_notice.xml"); //$NON-NLS-1$
-        ByteLobChunkStream stream = new ByteLobChunkStream(new FileInputStream(f), 10);
-        
-        StringBuffer sb = new StringBuffer();
-        LobChunk chunk = null;
-        do{
-            chunk = stream.getNextChunk();
-            sb.append(new String(chunk.getBytes()));
-        }while(!chunk.isLast());
-        stream.close();
-        
-        assertEquals(readFile(f), sb.toString());            
-    }
-    
-    private String readFile(File f) throws IOException{
-        StringBuffer sb = new StringBuffer();
-        
-        FileReader reader = new FileReader(f);
-        int chr = reader.read();
-        while(chr != -1) {
-            sb.append((char)chr);
-            chr = reader.read();
-        }
-        reader.close();
-        return sb.toString();
-    }
-
-}

Modified: trunk/client/src/test/java/org/teiid/client/lob/TestLobChunkInputStream.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/lob/TestLobChunkInputStream.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/lob/TestLobChunkInputStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,66 +20,40 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.lob;
+package org.teiid.client.lob;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
 import java.io.IOException;
-import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Iterator;
 
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.lob.LobChunkInputStream;
+import org.teiid.client.lob.LobChunkProducer;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.core.util.ObjectConverterUtil;
-import com.metamatrix.core.util.UnitTestUtil;
 
 public class TestLobChunkInputStream extends TestCase {
 
     public void testReadByteArray() throws Exception {
-        File f = UnitTestUtil.getTestDataFile("legal_notice.xml"); //$NON-NLS-1$
-        ByteLobChunkStream chunkProducer = new ByteLobChunkStream(new FileInputStream(f), 10);
-        
+    	LobChunkProducer chunkProducer = new LobChunkProducer() {
+			
+    		Iterator<LobChunk> chuncks = Arrays.asList(new LobChunk("hello ".getBytes(), false), new LobChunk("world".getBytes(), true)).iterator(); //$NON-NLS-1$ //$NON-NLS-2$ 
+    		
+			@Override
+			public LobChunk getNextChunk() throws IOException {
+				return chuncks.next();
+			}
+			
+			@Override
+			public void close() throws IOException {
+				
+			}
+		};
         LobChunkInputStream stream = new LobChunkInputStream(chunkProducer);
         
-        String fileContents = readFile(stream);
-        assertEquals(readFile(f), fileContents);
+        assertEquals("hello world", ObjectConverterUtil.convertToString(stream)); //$NON-NLS-1$
     }
     
-    /*
-     * Test method for 'com.metamatrix.common.lob.LobChunkReader.getCharacterContents()'
-     */
-    public void testGetCharacterContents() throws Exception {
-        File f = UnitTestUtil.getTestDataFile("legal_notice.xml"); //$NON-NLS-1$
-        ByteLobChunkStream chunkProducer = new ByteLobChunkStream(new FileInputStream(f), 10);
-        
-        LobChunkInputStream reader = new LobChunkInputStream(chunkProducer);
-        
-        String fileContents = new String(ObjectConverterUtil.convertToByteArray(reader));
-        assertEquals(readFile(new FileInputStream(f)), fileContents);
-    }
-            
-    private String readFile(InputStream reader) throws IOException{
-        StringBuffer sb = new StringBuffer();
-        
-        int chr = reader.read();
-        while(chr != -1) {
-            sb.append((char)chr);
-            chr = reader.read();
-        }
-        reader.close();
-        return sb.toString();
-    }    
-    
-    private String readFile(File f) throws IOException{
-        StringBuffer sb = new StringBuffer();
-        
-        FileReader reader = new FileReader(f);
-        int chr = reader.read();
-        while(chr != -1) {
-            sb.append((char)chr);
-            chr = reader.read();
-        }
-        reader.close();
-        return sb.toString();
-    }    
 }

Deleted: trunk/client/src/test/java/org/teiid/client/lob/TestReaderInputStream.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/lob/TestReaderInputStream.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/lob/TestReaderInputStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,70 +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 com.metamatrix.common.lob;
-
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.StringReader;
-import java.nio.charset.Charset;
-
-import junit.framework.TestCase;
-
-import com.metamatrix.common.util.ReaderInputStream;
-import com.metamatrix.core.util.UnitTestUtil;
-
-public class TestReaderInputStream extends TestCase {
-	
-	public void testUTF8() throws Exception {
-		FileInputStream fis = new FileInputStream(UnitTestUtil.getTestDataFile("legal_notice.xml")); //$NON-NLS-1$
-		ReaderInputStream ris = new ReaderInputStream(new FileReader(UnitTestUtil.getTestDataFile("legal_notice.xml")), Charset.forName("UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$
-		
-		int value;
-		while (true) {
-			value = fis.read();
-			assertEquals(value, ris.read());
-			if (value == -1) {
-				break;
-			}
-		}
-	}
-	
-	//the encoding strategy is roughly equivalent to utf-16
-	public void testUTF16() throws Exception {
-		String actual = "!?abc"; //$NON-NLS-1$
-		ReaderInputStream ris = new ReaderInputStream(new StringReader(actual), Charset.forName("UTF-16"), 1); //$NON-NLS-1$
-		byte[] result = new byte[(actual.length()) * 2 + 2];
-		ris.read(result);
-		String resultString = new String(result, "UTF-16"); //$NON-NLS-1$
-		assertEquals(resultString, actual);
-	}
-	
-	public void testASCII() throws Exception  {
-		String actual = "!?abc"; //$NON-NLS-1$
-		ReaderInputStream ris = new ReaderInputStream(new StringReader(actual), Charset.forName("US-ASCII"), 1); //$NON-NLS-1$
-		byte[] result = new byte[actual.length()];
-		ris.read(result);
-		String resultString = new String(result, "US-ASCII"); //$NON-NLS-1$
-		assertEquals(resultString, actual);		
-	}
-
-}

Added: trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java	                        (rev 0)
+++ trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -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.client.util;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.teiid.client.util.ResultsFuture;
+
+import junit.framework.TestCase;
+
+public class TestResultsFuture extends TestCase {
+
+	public void testGet() throws Exception {
+		ResultsFuture<Object> future = new ResultsFuture<Object>();
+		try {
+			future.get(-1, TimeUnit.MILLISECONDS);
+			fail("expected timeout exception"); //$NON-NLS-1$
+		} catch (TimeoutException e) {
+			
+		}
+		future.getResultsReceiver().receiveResults(new Object());
+		
+		assertNotNull(future.get(-1, TimeUnit.MILLISECONDS));
+	}
+	
+}

Copied: trunk/client/src/test/java/org/teiid/client/xa (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/xa)

Modified: trunk/client/src/test/java/org/teiid/client/xa/TestMMXid.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/xa/TestMMXid.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/client/xa/TestMMXid.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,8 +20,10 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.xa;
+package org.teiid.client.xa;
 
+import org.teiid.client.xa.XidImpl;
+
 import junit.framework.TestCase;
 
 public class TestMMXid extends TestCase {

Copied: trunk/client/src/test/java/org/teiid/net/TestMMURL.java (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/util/TestMMURL.java)
===================================================================
--- trunk/client/src/test/java/org/teiid/net/TestMMURL.java	                        (rev 0)
+++ trunk/client/src/test/java/org/teiid/net/TestMMURL.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,262 @@
+/*
+ * 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/socket (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client)

Modified: trunk/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.platform.socket.client;
+package org.teiid.net.socket;
 
 import java.net.InetAddress;
 import java.util.ArrayList;
@@ -32,10 +32,11 @@
 import org.mockito.Mockito;
 import org.teiid.adminapi.Admin;
 import org.teiid.adminapi.ProcessObject;
+import org.teiid.client.security.LogonResult;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.socket.SocketServerInstance;
 
-import com.metamatrix.common.api.HostInfo;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.platform.security.api.LogonResult;
 
 public class TestAdminApiServerDiscovery extends TestCase {
 
@@ -43,7 +44,7 @@
 		AdminApiServerDiscovery discovery = new AdminApiServerDiscovery();
 		Properties p = new Properties();
 		p.setProperty(AdminApiServerDiscovery.USE_URL_HOST, Boolean.TRUE.toString());
-		MMURL mmurl = new MMURL("foo", 1, false); //$NON-NLS-1$
+		TeiidURL mmurl = new TeiidURL("foo", 1, false); //$NON-NLS-1$
 		discovery.init(mmurl, p);
 		HostInfo knownHost = mmurl.getHostInfo().get(0);
 		//we will start off using the url host

Modified: trunk/client/src/test/java/org/teiid/net/socket/TestServiceInvocationStruct.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestServiceInvocationStruct.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestServiceInvocationStruct.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,10 +20,12 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.platform.socket.client;
+package org.teiid.net.socket;
 
 import java.util.Arrays;
 
+import org.teiid.net.socket.ServiceInvocationStruct;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.core.util.UnitTestUtil;

Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -23,7 +23,7 @@
 /**
  * 
  */
-package com.metamatrix.common.comm.platform.socket.client;
+package org.teiid.net.socket;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -32,20 +32,23 @@
 import junit.framework.TestCase;
 
 import org.mockito.Mockito;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.socket.SocketServerConnection;
+import org.teiid.net.socket.SocketServerConnectionFactory;
+import org.teiid.net.socket.SocketServerInstance;
+import org.teiid.net.socket.SocketServerInstanceFactory;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.common.api.HostInfo;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.exception.SingleInstanceCommunicationException;
 import com.metamatrix.common.util.crypto.NullCryptor;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
 
 /**
  * <code>TestCase</case> for <code>SocketServerConnection</code>
@@ -119,8 +122,8 @@
 		
 		SocketServerConnectionFactory.updateConnectionProperties(p);
        
-		assertTrue(p.containsKey(MMURL.CONNECTION.CLIENT_HOSTNAME));
-		assertTrue(p.containsKey(MMURL.CONNECTION.CLIENT_IP_ADDRESS));
+		assertTrue(p.containsKey(TeiidURL.CONNECTION.CLIENT_HOSTNAME));
+		assertTrue(p.containsKey(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS));
 	}
 	
 	public void testLogonFailsWithMultipleHosts() throws Exception {
@@ -134,7 +137,7 @@
 				throw new SingleInstanceCommunicationException();
 			}
 		};
-		ServerDiscovery discovery = new UrlServerDiscovery(new MMURL("mm://host1:1,host2:2")); //$NON-NLS-1$
+		ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL("mm://host1:1,host2:2")); //$NON-NLS-1$
 		try {
 			new SocketServerConnection(instanceFactory, false, discovery, p, null);
 			fail("exception expected"); //$NON-NLS-1$
@@ -188,7 +191,7 @@
 	private SocketServerConnection createConnection(final Throwable t, HostInfo hostInfo)
 			throws CommunicationException, ConnectionException {
 		Properties p = new Properties();
-		ServerDiscovery discovery = new UrlServerDiscovery(new MMURL(hostInfo.getHostName(), hostInfo.getPortNumber(), false));
+		ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL(hostInfo.getHostName(), hostInfo.getPortNumber(), false));
 		SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
 			//## JDBC4.0-begin ##
 			@Override

Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerInstanceImpl.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.platform.socket.client;
+package org.teiid.net.socket;
 
 import static org.junit.Assert.*;
 
@@ -35,14 +35,14 @@
 import java.util.concurrent.TimeoutException;
 
 import org.junit.Test;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.socket.ObjectChannelFactory;
+import org.teiid.net.socket.SocketServerInstanceImpl;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.api.HostInfo;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.platform.socket.Handshake;
-import com.metamatrix.common.comm.platform.socket.ObjectChannel;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.platform.security.api.ILogon;
 
 public class TestSocketServerInstanceImpl {
 	

Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServiceRegistry.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServiceRegistry.java	2010-03-19 17:32:08 UTC (rev 1978)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketServiceRegistry.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -20,7 +20,7 @@
  * 02110-1301 USA.
  */
 
-package com.metamatrix.common.comm.platform.socket.client;
+package org.teiid.net.socket;
 
 import java.lang.reflect.Method;
 
@@ -28,13 +28,13 @@
 
 import org.teiid.adminapi.Admin;
 import org.teiid.adminapi.AdminException;
+import org.teiid.client.DQP;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.util.ExceptionUtil;
+import org.teiid.client.xa.XATransactionException;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.xa.XATransactionException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.platform.security.api.ILogon;
 
 public class TestSocketServiceRegistry extends TestCase {
 

Copied: trunk/client/src/test/java/org/teiid/net/socket/TestSocketUtil.java (from rev 1978, trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/TestSocketUtil.java)
===================================================================
--- trunk/client/src/test/java/org/teiid/net/socket/TestSocketUtil.java	                        (rev 0)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,49 @@
+/*
+ * 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.socket;
+
+import java.io.IOException;
+
+import org.teiid.net.socket.SocketUtil;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.core.util.UnitTestUtil;
+
+public class TestSocketUtil extends TestCase {
+	
+    public void testNoPassword() throws Exception {
+        SocketUtil.loadKeyStore(UnitTestUtil.getTestDataFile("metamatrix.keystore").getAbsolutePath(), null, "JKS"); //$NON-NLS-1$ //$NON-NLS-2$
+    }
+    
+    public void testMissingKeyStore() throws Exception {
+        try {
+        	SocketUtil.loadKeyStore("metamatrix.keystorefoo", null, "JKS"); //$NON-NLS-1$ //$NON-NLS-2$
+            fail("expected exception"); //$NON-NLS-1$
+        } catch (IOException ex) {
+            assertEquals("Key store 'metamatrix.keystorefoo' was not found.", ex.getMessage()); //$NON-NLS-1$
+        }
+    }
+
+
+}


Property changes on: trunk/client/src/test/java/org/teiid/net/socket/TestSocketUtil.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/client/src/test/resources/legal_notice.xml
===================================================================
--- trunk/client/src/test/resources/legal_notice.xml	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client/src/test/resources/legal_notice.xml	2010-03-20 03:06:44 UTC (rev 1981)
@@ -1,58 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<!--
-
-    JBoss, Home of Professional Open Source.
-    Copyright (C) 2008 Red Hat, 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.	
-    
-    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.
-
--->
-<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-
-<legalnotice id="Legal_Notice">
-    <title>Legal Notice</title>
-    <para>
-        <address>
-            <street>1801 Varsity Drive</street>
-            <city>Raleigh</city>, <state>NC</state><postcode>27606-2072</postcode><country>USA</country>
-            <phone>Phone: +1 919 754 3700</phone>
-            <phone>Phone: 888 733 4281</phone>
-            <fax>Fax: +1 919 754 3701</fax>
-            <pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state><postcode>27709</postcode><country>USA</country>
-        </address>
-    </para>
-    <para>
-        Copyright <trademark class="copyright"/> 2008 by Red Hat, Inc.  This copyrighted material is made available to
-        anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the
-        GNU <ulink url="http://www.gnu.org/licenses/lgpl-2.1.html">Lesser General Public License</ulink>, as published
-        by the Free Software Foundation.
-    </para>
-    <para>
-        Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.
-    </para>
-    <para>
-        All other trademarks referenced herein are the property of their respective owners.
-    </para>
-    <para>
-        The GPG fingerprint of the security at redhat.com key is:
-    </para>
-    <para>
-        CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
-    </para>
-</legalnotice>

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/BaseDataSource.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/BaseDataSource.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/BaseDataSource.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,11 +32,12 @@
 import javax.sql.XAConnection;
 import javax.sql.XADataSource;
 
+import org.teiid.client.RequestMessage;
+import org.teiid.net.TeiidURL;
 
 
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.dqp.message.RequestMessage;
 
+
 /**
  * The Teiid JDBC DataSource implementation class of {@link javax.sql.DataSource} and
  * {@link javax.sql.XADataSource}.
@@ -100,17 +101,17 @@
 	public static final String DEFAULT_APP_NAME = "JDBC"; //$NON-NLS-1$
 	
     // constant indicating Virtual database name
-    public static final String VDB_NAME = MMURL.JDBC.VDB_NAME; 
+    public static final String VDB_NAME = TeiidURL.JDBC.VDB_NAME; 
     // constant indicating Virtual database version
-    public static final String VDB_VERSION = MMURL.JDBC.VDB_VERSION; 
+    public static final String VDB_VERSION = TeiidURL.JDBC.VDB_VERSION; 
     // constant for vdb version part of serverURL
-    public static final String VERSION = MMURL.JDBC.VERSION; 
+    public static final String VERSION = TeiidURL.JDBC.VERSION; 
     // name of the application which is obtaining connection
-    public static final String APP_NAME = MMURL.CONNECTION.APP_NAME; 
+    public static final String APP_NAME = TeiidURL.CONNECTION.APP_NAME; 
     // constant for username part of url
-    public static final String USER_NAME = MMURL.CONNECTION.USER_NAME; 
+    public static final String USER_NAME = TeiidURL.CONNECTION.USER_NAME; 
     // constant for password part of url
-    public static final String PASSWORD = MMURL.CONNECTION.PASSWORD; 
+    public static final String PASSWORD = TeiidURL.CONNECTION.PASSWORD; 
     
     protected static final int DEFAULT_TIMEOUT = 0;
     protected static final int DEFAULT_LOG_LEVEL = 0;

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/CallableStatementImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -48,11 +48,12 @@
 import java.util.Calendar;
 import java.util.Map;
 
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.ResultsMode;
+import org.teiid.client.RequestMessage.StatementType;
+
 import com.metamatrix.common.util.SqlUtil;
 import com.metamatrix.common.util.TimestampWithTimezone;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.RequestMessage.ResultsMode;
-import com.metamatrix.dqp.message.RequestMessage.StatementType;
 
 /**
  * <p> This class inherits Statement methods, which deal with SQL statements in

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/ConnectionImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/ConnectionImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -57,17 +57,18 @@
 
 import javax.transaction.xa.Xid;
 
+import org.teiid.client.DQP;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.ServerConnection;
+import org.teiid.net.socket.SocketServerConnection;
 
 
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnection;
+
 import com.metamatrix.common.util.SqlUtil;
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
 
 public class ConnectionImpl extends WrapperImpl implements Connection {
 	private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
@@ -195,7 +196,7 @@
                 String key = (String)enumeration.nextElement();
                 Object anObj = info.get(key);
                 // Log each property except for password and token.
-                if (!MMURL.CONNECTION.PASSWORD.equalsIgnoreCase(key)) { 
+                if (!TeiidURL.CONNECTION.PASSWORD.equalsIgnoreCase(key)) { 
                     logger.fine(key+"="+anObj); //$NON-NLS-1$
                 }
             }

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -37,14 +37,15 @@
 import java.util.Map;
 import java.util.logging.Logger;
 
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.metadata.ResultsMetadataConstants;
+import org.teiid.client.metadata.ResultsMetadataDefaults;
+
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
 import com.metamatrix.common.util.SqlUtil;
 import com.metamatrix.core.CoreConstants;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ResultsMessage;
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
-import com.metamatrix.dqp.metadata.ResultsMetadataDefaults;
 
 public class DatabaseMetaDataImpl extends WrapperImpl implements DatabaseMetaData {
 	private static final String DATA_TYPES = "DataTypes"; //$NON-NLS-1$

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -26,11 +26,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.metadata.ResultsMetadataConstants;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.core.util.StringUtil;
-import com.metamatrix.dqp.client.MetadataResult;
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
 
 /**
  * This metadata provider starts with just column names and types (provided in the response)

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,9 +31,10 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.ServerConnection;
+
 import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.core.MetaMatrixCoreException;
 import com.metamatrix.core.MetaMatrixRuntimeException;

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/ExecutionProperties.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/ExecutionProperties.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/ExecutionProperties.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -22,7 +22,7 @@
 
 package org.teiid.jdbc;
 
-import com.metamatrix.dqp.message.RequestMessage;
+import org.teiid.client.RequestMessage;
 
 /**
  * MetaMatrix-specific execution properties.  These execution properties can 

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/JDBCURL.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/JDBCURL.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/JDBCURL.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,10 +29,11 @@
 import java.util.Map;
 import java.util.Properties;
 
+import org.teiid.net.TeiidURL;
 
 
 
-import com.metamatrix.common.api.MMURL;
+
 
 
 /** 
@@ -59,8 +60,8 @@
         ExecutionProperties.PROP_XML_FORMAT,
         ExecutionProperties.PROP_XML_VALIDATION,
         ExecutionProperties.DISABLE_LOCAL_TRANSACTIONS,
-        MMURL.CONNECTION.AUTO_FAILOVER,
-        MMURL.CONNECTION.DISCOVERY_STRATEGY
+        TeiidURL.CONNECTION.AUTO_FAILOVER,
+        TeiidURL.CONNECTION.DISCOVERY_STRATEGY
     };
     
     private String vdbName;
@@ -268,7 +269,7 @@
     }
     
     public String getTransparentFailover() {
-        return properties.getProperty(MMURL.CONNECTION.AUTO_FAILOVER);
+        return properties.getProperty(TeiidURL.CONNECTION.AUTO_FAILOVER);
     }
     
     public String getDisableLocalTransactions() {

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -51,8 +51,13 @@
 import javax.sql.rowset.serial.SerialBlob;
 import javax.sql.rowset.serial.SerialClob;
 
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.ResultsMode;
+import org.teiid.client.RequestMessage.StatementType;
+import org.teiid.client.metadata.MetadataResult;
 
 
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
@@ -60,10 +65,6 @@
 import com.metamatrix.common.util.TimestampWithTimezone;
 import com.metamatrix.core.util.ArgCheck;
 import com.metamatrix.core.util.ObjectConverterUtil;
-import com.metamatrix.dqp.client.MetadataResult;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.RequestMessage.ResultsMode;
-import com.metamatrix.dqp.message.RequestMessage.StatementType;
 
 /**
  * <p> Instances of PreparedStatement contain a SQL statement that has already been

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -51,12 +51,15 @@
 import java.util.concurrent.TimeoutException;
 import java.util.logging.Logger;
 
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.lob.LobChunkInputStream;
+import org.teiid.client.lob.StreamingLobChunckProducer;
+import org.teiid.client.util.ResultsFuture;
 import org.teiid.jdbc.BatchResults.Batch;
 import org.teiid.jdbc.BatchResults.BatchFetcher;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.common.lob.LobChunkInputStream;
 import com.metamatrix.common.types.BlobImpl;
 import com.metamatrix.common.types.BlobType;
 import com.metamatrix.common.types.ClobImpl;
@@ -67,9 +70,6 @@
 import com.metamatrix.common.types.XMLType;
 import com.metamatrix.common.util.SqlUtil;
 import com.metamatrix.common.util.TimestampWithTimezone;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.dqp.client.StreamingLobChunckProducer;
-import com.metamatrix.dqp.message.ResultsMessage;
 
 /**
  * <p>

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,8 +25,9 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 
+import org.teiid.client.metadata.ResultsMetadataConstants;
+
 import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
 
 /**
  */

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/SocketProfile.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/SocketProfile.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,11 +31,12 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.ServerConnection;
+import org.teiid.net.socket.SocketServerConnectionFactory;
+
 import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.core.MetaMatrixCoreException;
 
@@ -122,7 +123,7 @@
         try {
             JDBCURL jdbcURL = new JDBCURL(url);
             info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName());
-            info.setProperty(MMURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL());
+            info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL());
             Properties optionalParams = jdbcURL.getProperties();
             JDBCURL.normalizeProperties(info);
             Enumeration keys = optionalParams.keys();

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/StatementImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/StatementImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -47,6 +47,11 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.teiid.client.DQP;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.RequestMessage.ResultsMode;
+import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.jdbc.plan.Annotation;
 import org.teiid.jdbc.plan.Annotation;
 import org.teiid.jdbc.plan.PlanNode;
@@ -57,11 +62,6 @@
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.util.SqlUtil;
 import com.metamatrix.core.util.ObjectConverterUtil;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.message.ParameterInfo;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
-import com.metamatrix.dqp.message.RequestMessage.ResultsMode;
 
 public class StatementImpl extends WrapperImpl implements TeiidStatement {
 	private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDataSource.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,7 +25,8 @@
 import java.sql.Connection;
 import java.util.Properties;
 
-import com.metamatrix.common.api.MMURL;
+import org.teiid.net.TeiidURL;
+
 
 /**
  * The Teiid JDBC DataSource implementation class of {@link javax.sql.DataSource} and
@@ -105,11 +106,11 @@
         Properties props = super.buildProperties(userName, password);
         
         if (this.getAutoFailover() != null) {
-            props.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, this.getAutoFailover());
+            props.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, this.getAutoFailover());
         }
         
         if (this.getDiscoveryStrategy() != null) {
-        	props.setProperty(MMURL.CONNECTION.DISCOVERY_STRATEGY, this.getDiscoveryStrategy());
+        	props.setProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, this.getDiscoveryStrategy());
         }
 
         return props;
@@ -118,7 +119,7 @@
     private Properties buildServerProperties(final String userName, final String password) {               
         Properties props = buildProperties(userName, password);
         
-        props.setProperty(MMURL.CONNECTION.SERVER_URL,this.buildServerURL());
+        props.setProperty(TeiidURL.CONNECTION.SERVER_URL,this.buildServerURL());
 
         return props;
     }    
@@ -126,34 +127,34 @@
     protected String buildServerURL() {
     	if ( this.alternateServers == null ) {
     		// Format:  "mm://server:port"
-    		return new MMURL(this.serverName, this.portNumber, this.secure).getAppServerURL();
+    		return new TeiidURL(this.serverName, this.portNumber, this.secure).getAppServerURL();
     	} 
 
     	// Format: "mm://server1:port,server2:port,..."
 		String serverURL = ""; //$NON-NLS-1$
 		
-		serverURL = "" + ( this.secure ? MMURL.SECURE_PROTOCOL : MMURL.DEFAULT_PROTOCOL ); //$NON-NLS-1$
+		serverURL = "" + ( this.secure ? TeiidURL.SECURE_PROTOCOL : TeiidURL.DEFAULT_PROTOCOL ); //$NON-NLS-1$
 		serverURL += "" + this.serverName; //$NON-NLS-1$
 		if ( this.portNumber != 0 ) 
-			serverURL += MMURL.COLON_DELIMITER  + this.portNumber;
+			serverURL += TeiidURL.COLON_DELIMITER  + this.portNumber;
 		if ( this.alternateServers.length() > 0 ) {
-        	String[] as = this.alternateServers.split( MMURL.COMMA_DELIMITER);
+        	String[] as = this.alternateServers.split( TeiidURL.COMMA_DELIMITER);
         	
         	for ( int i = 0; i < as.length; i++ ) {
-        		String[] server = as[i].split( MMURL.COLON_DELIMITER );
+        		String[] server = as[i].split( TeiidURL.COLON_DELIMITER );
 
         		if ( server.length > 0 ) {
-        			serverURL += MMURL.COMMA_DELIMITER + server[0];
+        			serverURL += TeiidURL.COMMA_DELIMITER + server[0];
         			if ( server.length > 1 ) {
-        				serverURL += MMURL.COLON_DELIMITER + server[1];
+        				serverURL += TeiidURL.COLON_DELIMITER + server[1];
         			} else {
-        				serverURL += MMURL.COLON_DELIMITER + this.portNumber;
+        				serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
         			}
         		}
         	}
 		}
 		
-		return new MMURL(serverURL).getAppServerURL();
+		return new TeiidURL(serverURL).getAppServerURL();
     }
 
     protected String buildURL() {
@@ -407,14 +408,14 @@
     	if ( alternateServers == null || alternateServers.trim().length() < 1 )
     		return null;
     	
-    	String[] as = alternateServers.split( MMURL.COMMA_DELIMITER);
+    	String[] as = alternateServers.split( TeiidURL.COMMA_DELIMITER);
     	String sReason = null;
     	String reason = ""; //$NON-NLS-1$
     	int reasonCount = 0;
     	final String newline = System.getProperty("line.separator"); //$NON-NLS-1$
     	
     	for ( int i = 0; i < as.length; i++ ) {
-    		String[] server = as[i].split( MMURL.COLON_DELIMITER );
+    		String[] server = as[i].split( TeiidURL.COLON_DELIMITER );
 
     		if ( server.length < 1 || server.length > 2 ) {
     			// ie "server:31000:an invalid value"

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidSQLException.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidSQLException.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/TeiidSQLException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,13 +29,14 @@
 import java.net.UnknownHostException;
 import java.sql.SQLException;
 
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
+
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.api.exception.query.ProcedureErrorInstructionException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
 import com.metamatrix.core.MetaMatrixCoreException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/WarningUtil.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/WarningUtil.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/WarningUtil.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,9 +25,10 @@
 import java.sql.SQLWarning;
 import java.util.List;
 
+import org.teiid.client.SourceWarning;
 
-import com.metamatrix.dqp.exception.SourceWarning;
 
+
 /**
  * Utilities for creating SQLWarnings.  
  */

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/XAResourceImpl.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/XAResourceImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/XAResourceImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,10 +29,11 @@
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
+
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
+import org.teiid.net.CommunicationException;
 
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
 
 /**
  * Implementation of XAResource.

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -41,16 +41,16 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Matchers;
+import org.teiid.client.DQP;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.util.ResultsFuture;
 import org.teiid.jdbc.ResultSetImpl;
 import org.teiid.jdbc.StatementImpl;
 
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
 import com.metamatrix.common.util.TimestampWithTimezone;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
 import com.metamatrix.query.unittest.TimestampUtil;
 
 public class TestAllResultsImpl {

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMCallableStatement.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMCallableStatement.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMCallableStatement.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,16 +33,16 @@
 import junit.framework.TestCase;
 
 import org.mockito.Mockito;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.metadata.ParameterInfo;
+import org.teiid.client.security.LogonResult;
 import org.teiid.jdbc.CallableStatementImpl;
 import org.teiid.jdbc.ConnectionImpl;
 import org.teiid.jdbc.ResultSetImpl;
+import org.teiid.net.ServerConnection;
 
-import com.metamatrix.common.comm.api.ServerConnection;
 import com.metamatrix.common.types.MMJDBCSQLTypeInfo;
-import com.metamatrix.dqp.message.ParameterInfo;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
-import com.metamatrix.platform.security.api.LogonResult;
 
 public class TestMMCallableStatement extends TestCase {
 	

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMConnection.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,16 +32,16 @@
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
+import org.teiid.client.DQP;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
 import org.teiid.jdbc.BaseDataSource;
 import org.teiid.jdbc.ConnectionImpl;
+import org.teiid.net.ServerConnection;
 
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
 
 public class TestMMConnection extends TestCase {
 

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMDriver.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMDriver.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMDriver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,11 +25,12 @@
 import java.sql.DriverPropertyInfo;
 import java.util.Properties;
 
+import org.teiid.net.TeiidURL;
 
 
+
 import junit.framework.TestCase;
 
-import com.metamatrix.common.api.MMURL;
 
 public class TestMMDriver extends TestCase {
     TeiidDriver drv = new TeiidDriver();
@@ -93,7 +94,7 @@
         Properties p = new Properties();
         SocketProfile.parseURL("jdbc:metamatrix:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
-        assertTrue(p.getProperty(MMURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
         assertEquals(3, p.size());        
     }
 
@@ -102,7 +103,7 @@
         SocketProfile.parseURL("jdbc:metamatrix:BQT at mms://slwxp157: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(MMURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals(BaseDataSource.DEFAULT_APP_NAME));
         assertEquals(5, p.size());
@@ -115,7 +116,7 @@
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("YES")); //$NON-NLS-1$
-        assertTrue(p.getProperty(MMURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("4")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals("Client")); //$NON-NLS-1$
         assertEquals(7, p.size());        

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMJDBCURL.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMJDBCURL.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMJDBCURL.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,10 +28,10 @@
 import org.teiid.jdbc.BaseDataSource;
 import org.teiid.jdbc.ExecutionProperties;
 import org.teiid.jdbc.JDBCURL;
+import org.teiid.net.TeiidURL;
 
 import junit.framework.TestCase;
 
-import com.metamatrix.common.api.MMURL;
 
 
 /** 
@@ -57,7 +57,7 @@
         expectedProperties.setProperty("logLevel", "1"); //$NON-NLS-1$ //$NON-NLS-2$
         expectedProperties.setProperty("configFile", "testdata/bqt/dqp_stmt_e2e.xmi"); //$NON-NLS-1$ //$NON-NLS-2$
         expectedProperties.setProperty(ExecutionProperties.DISABLE_LOCAL_TRANSACTIONS, "true"); //$NON-NLS-1$
-        expectedProperties.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, "false"); //$NON-NLS-1$
+        expectedProperties.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, "false"); //$NON-NLS-1$
         JDBCURL url = new JDBCURL(URL); 
         assertEquals("bqt", url.getVDBName()); //$NON-NLS-1$
         assertEquals("mm://localhost:12345", url.getConnectionURL()); //$NON-NLS-1$

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMPreparedStatement.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMPreparedStatement.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMPreparedStatement.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -35,17 +35,17 @@
 import org.junit.Test;
 import org.mockito.Matchers;
 import org.mockito.Mockito;
+import org.teiid.client.DQP;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.RequestMessage.ResultsMode;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.util.ResultsFuture;
 import org.teiid.jdbc.ConnectionImpl;
 import org.teiid.jdbc.PreparedStatementImpl;
 import org.teiid.jdbc.TeiidSQLException;
+import org.teiid.net.ServerConnection;
 
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
-import com.metamatrix.dqp.message.RequestMessage.ResultsMode;
-import com.metamatrix.platform.security.api.LogonResult;
 
 /**
  * Test case to validate general operations on an <code>MMPreparedStatement

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMResultSet.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMResultSet.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMResultSet.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -38,10 +38,10 @@
 import java.util.concurrent.TimeoutException;
 
 import org.junit.Test;
+import org.teiid.client.DQP;
+import org.teiid.client.ResultsMessage;
 
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.message.ResultsMessage;
 
 public class TestMMResultSet {
 

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMSQLException.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMSQLException.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMSQLException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,14 +32,14 @@
 import java.sql.SQLException;
 
 import org.teiid.jdbc.TeiidSQLException;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
 
 import junit.framework.TestCase;
 
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.api.exception.query.ProcedureErrorInstructionException;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
 import com.metamatrix.core.MetaMatrixCoreException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMStatement.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMStatement.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMStatement.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,14 +31,14 @@
 
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.teiid.client.DQP;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.util.ResultsFuture;
 import org.teiid.jdbc.ConnectionImpl;
 import org.teiid.jdbc.TeiidSQLException;
 import org.teiid.jdbc.StatementImpl;
 
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
 
 public class TestMMStatement {
 

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMXAConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMXAConnection.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestMMXAConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,13 +27,13 @@
 
 import javax.transaction.xa.XAResource;
 
+import org.teiid.client.xa.XidImpl;
 import org.teiid.jdbc.ConnectionImpl;
 import org.teiid.jdbc.StatementImpl;
 import org.teiid.jdbc.XAConnectionImpl;
 
 import junit.framework.TestCase;
 
-import com.metamatrix.common.xa.XidImpl;
 
 
 public class TestMMXAConnection extends TestCase {

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,8 +29,8 @@
 import java.util.Properties;
 
 import org.junit.Test;
+import org.teiid.net.TeiidURL;
 
-import com.metamatrix.common.api.MMURL;
 
 public class TestSocketProfile {
     public String localhost = "localhost"; //$NON-NLS-1$
@@ -91,7 +91,7 @@
         Properties p = new Properties();
         SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
-        assertTrue(p.getProperty(MMURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
         assertEquals(3, p.size());        
     }
 
@@ -100,7 +100,7 @@
         SocketProfile.parseURL("jdbc:teiid:BQT at mms://slwxp157: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(MMURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals(BaseDataSource.DEFAULT_APP_NAME));
         assertEquals(5, p.size());
@@ -113,7 +113,7 @@
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("YES")); //$NON-NLS-1$
-        assertTrue(p.getProperty(MMURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302")); //$NON-NLS-1$
+        assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("4")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.APP_NAME).equals("Client")); //$NON-NLS-1$
         assertEquals(7, p.size());        

Added: trunk/common-core/src/test/java/com/metamatrix/common/util/TestReaderInputStream.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/util/TestReaderInputStream.java	                        (rev 0)
+++ trunk/common-core/src/test/java/com/metamatrix/common/util/TestReaderInputStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,70 @@
+/*
+ * 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 com.metamatrix.common.util;
+
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.StringReader;
+import java.nio.charset.Charset;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.common.util.ReaderInputStream;
+import com.metamatrix.core.util.UnitTestUtil;
+
+public class TestReaderInputStream extends TestCase {
+	
+	public void testUTF8() throws Exception {
+		FileInputStream fis = new FileInputStream(UnitTestUtil.getTestDataFile("legal_notice.xml")); //$NON-NLS-1$
+		ReaderInputStream ris = new ReaderInputStream(new FileReader(UnitTestUtil.getTestDataFile("legal_notice.xml")), Charset.forName("UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$
+		
+		int value;
+		while (true) {
+			value = fis.read();
+			assertEquals(value, ris.read());
+			if (value == -1) {
+				break;
+			}
+		}
+	}
+	
+	//the encoding strategy is roughly equivalent to utf-16
+	public void testUTF16() throws Exception {
+		String actual = "!?abc"; //$NON-NLS-1$
+		ReaderInputStream ris = new ReaderInputStream(new StringReader(actual), Charset.forName("UTF-16"), 1); //$NON-NLS-1$
+		byte[] result = new byte[(actual.length()) * 2 + 2];
+		ris.read(result);
+		String resultString = new String(result, "UTF-16"); //$NON-NLS-1$
+		assertEquals(resultString, actual);
+	}
+	
+	public void testASCII() throws Exception  {
+		String actual = "!?abc"; //$NON-NLS-1$
+		ReaderInputStream ris = new ReaderInputStream(new StringReader(actual), Charset.forName("US-ASCII"), 1); //$NON-NLS-1$
+		byte[] result = new byte[actual.length()];
+		ris.read(result);
+		String resultString = new String(result, "US-ASCII"); //$NON-NLS-1$
+		assertEquals(resultString, actual);		
+	}
+
+}

Copied: trunk/common-core/src/test/resources/legal_notice.xml (from rev 1978, trunk/client/src/test/resources/legal_notice.xml)
===================================================================
--- trunk/common-core/src/test/resources/legal_notice.xml	                        (rev 0)
+++ trunk/common-core/src/test/resources/legal_notice.xml	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!--
+
+    JBoss, Home of Professional Open Source.
+    Copyright (C) 2008 Red Hat, 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.	
+    
+    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.
+
+-->
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<legalnotice id="Legal_Notice">
+    <title>Legal Notice</title>
+    <para>
+        <address>
+            <street>1801 Varsity Drive</street>
+            <city>Raleigh</city>, <state>NC</state><postcode>27606-2072</postcode><country>USA</country>
+            <phone>Phone: +1 919 754 3700</phone>
+            <phone>Phone: 888 733 4281</phone>
+            <fax>Fax: +1 919 754 3701</fax>
+            <pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state><postcode>27709</postcode><country>USA</country>
+        </address>
+    </para>
+    <para>
+        Copyright <trademark class="copyright"/> 2008 by Red Hat, Inc.  This copyrighted material is made available to
+        anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the
+        GNU <ulink url="http://www.gnu.org/licenses/lgpl-2.1.html">Lesser General Public License</ulink>, as published
+        by the Free Software Foundation.
+    </para>
+    <para>
+        Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.
+    </para>
+    <para>
+        All other trademarks referenced herein are the property of their respective owners.
+    </para>
+    <para>
+        The GPG fingerprint of the security at redhat.com key is:
+    </para>
+    <para>
+        CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
+    </para>
+</legalnotice>

Modified: trunk/engine/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/api/exception/security/SessionServiceException.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -22,8 +22,9 @@
 
 package com.metamatrix.api.exception.security;
 
-import com.metamatrix.admin.api.exception.security.MetaMatrixSecurityException;
+import org.teiid.client.security.MetaMatrixSecurityException;
 
+
 public class SessionServiceException extends MetaMatrixSecurityException {
     /**
      * No-Arg Constructor

Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBatch.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBatch.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBatch.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,8 +28,9 @@
 import java.io.ObjectOutput;
 import java.util.List;
 
-import com.metamatrix.common.batch.BatchSerializer;
+import org.teiid.client.BatchSerializer;
 
+
 /**
  * Represents a set of indexed tuples.  The {@link #getBeginRow beginning row}
  * is the first row contained in this batch; if it equals "1" then it is the

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,6 +27,7 @@
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.teiid.client.RequestMessage;
 import org.teiid.dqp.internal.process.DQPWorkContext;
 
 import com.metamatrix.common.buffer.BufferManager;

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicResultsMessage.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicResultsMessage.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicResultsMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,7 +28,8 @@
 import java.io.ObjectOutput;
 import java.util.List;
 
-import com.metamatrix.common.batch.BatchSerializer;
+import org.teiid.client.BatchSerializer;
+
 import com.metamatrix.core.util.ExternalizeUtil;
 
 public class AtomicResultsMessage implements Externalizable {

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/SessionService.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,10 +28,10 @@
 import javax.security.auth.login.LoginException;
 
 import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.client.security.InvalidSessionException;
 import org.teiid.dqp.internal.process.DQPCore;
 import org.teiid.security.Credentials;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 import com.metamatrix.api.exception.security.SessionServiceException;
 
 /**

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,9 +30,9 @@
 
 import org.teiid.adminapi.AdminException;
 import org.teiid.adminapi.Transaction;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
 
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
 
 /**
  */

Modified: trunk/engine/src/main/java/com/metamatrix/query/metadata/StoredProcedureInfo.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/metadata/StoredProcedureInfo.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/metadata/StoredProcedureInfo.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -26,7 +26,8 @@
 import java.util.List;
 import java.util.ArrayList;
 
-import com.metamatrix.dqp.message.ParameterInfo;
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.sql.lang.SPParameter;
 /**

Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLPlan.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLPlan.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -42,6 +42,7 @@
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
+import org.teiid.client.lob.LobChunk;
 import org.xml.sax.Attributes;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.ErrorHandler;
@@ -58,7 +59,6 @@
 import com.metamatrix.common.buffer.BufferManager;
 import com.metamatrix.common.buffer.FileStore;
 import com.metamatrix.common.buffer.TupleBatch;
-import com.metamatrix.common.lob.LobChunk;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.types.DataTypeManager;

Modified: trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/resolver/command/ExecResolver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,11 +30,12 @@
 import java.util.List;
 import java.util.Map;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.QueryPlugin;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.mapping.relational.QueryNode;

Modified: trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/resolver/command/SimpleQueryResolver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,12 +33,13 @@
 import java.util.List;
 import java.util.Set;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.api.exception.query.UnresolvedSymbolDescription;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.QueryPlugin;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.metadata.QueryMetadataInterface;

Modified: trunk/engine/src/main/java/com/metamatrix/query/resolver/util/BindVariableVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/resolver/util/BindVariableVisitor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/resolver/util/BindVariableVisitor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -26,12 +26,13 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.api.exception.query.QueryParserException;
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.core.util.ArgCheck;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.QueryPlugin;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.parser.QueryParser;

Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/SPParameter.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/SPParameter.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/SPParameter.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,9 +28,10 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.QueryPlugin;
 import com.metamatrix.query.eval.Evaluator;
 import com.metamatrix.query.sql.symbol.ElementSymbol;

Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/StoredProcedure.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/StoredProcedure.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/StoredProcedure.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,7 +31,8 @@
 import java.util.Map;
 import java.util.TreeMap;
 
-import com.metamatrix.dqp.message.ParameterInfo;
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.query.QueryPlugin;
 import com.metamatrix.query.sql.LanguageVisitor;
 import com.metamatrix.query.sql.symbol.ElementSymbol;

Copied: trunk/engine/src/main/java/org/teiid/adminapi/impl/AdminPlugin.java (from rev 1978, trunk/client/src/main/java/com/metamatrix/admin/AdminPlugin.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/adminapi/impl/AdminPlugin.java	                        (rev 0)
+++ trunk/engine/src/main/java/org/teiid/adminapi/impl/AdminPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,38 @@
+/*
+ * 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.adminapi.impl;
+
+import java.util.ResourceBundle;
+import com.metamatrix.core.BundleUtil;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class AdminPlugin {
+
+    public static final String PLUGIN_ID = AdminPlugin.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/adminapi/impl/PropertyDefinitionMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/adminapi/impl/PropertyDefinitionMetadata.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,7 +28,6 @@
 
 import org.teiid.adminapi.PropertyDefinition;
 
-import com.metamatrix.admin.AdminPlugin;
 
 
 public class PropertyDefinitionMetadata extends AdminObjectImpl implements PropertyDefinition {

Modified: trunk/engine/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/adminapi/impl/SessionMetadata.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,8 +30,8 @@
 import org.jboss.managed.api.annotation.ManagementProperty;
 import org.jboss.metatype.api.annotations.MetaMapping;
 import org.teiid.adminapi.Session;
+import org.teiid.client.security.SessionToken;
 
-import com.metamatrix.platform.security.api.SessionToken;
 
 
 /**

Modified: trunk/engine/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/adminapi/impl/TransactionMetadata.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,7 +28,6 @@
 import org.jboss.metatype.api.annotations.MetaMapping;
 import org.teiid.adminapi.Transaction;
 
-import com.metamatrix.admin.AdminPlugin;
 
 @MetaMapping(TransactionMetadataMapper.class)
 public class TransactionMetadata extends AdminObjectImpl implements Transaction {

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -26,6 +26,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.language.AggregateFunction;
 import org.teiid.connector.language.AndOr;
@@ -65,7 +66,6 @@
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.metadata.TempMetadataID;
 import com.metamatrix.query.sql.lang.BatchedUpdateCommand;

Added: trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java	                        (rev 0)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/ByteLobChunkStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,85 @@
+/*
+ * 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.internal.process;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PushbackInputStream;
+
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.lob.LobChunkProducer;
+
+import com.metamatrix.core.CorePlugin;
+
+/**
+ * A wrapper class, given a InputStream object can convert a underlying 
+ * stream into sequence of ByteLobChunk objects of given chunk size. 
+ */
+public class ByteLobChunkStream  implements LobChunkProducer {
+    private PushbackInputStream stream;
+    private int chunkSize;
+    private boolean closed;
+    
+    public ByteLobChunkStream(InputStream stream, int chunkSize) {
+        this.stream = new PushbackInputStream(stream);
+        this.chunkSize = chunkSize;
+    }
+    
+    /**  
+     * @see com.metamatrix.common.lob.ByteLobChunkProducer#getNextChunk(int)
+     */
+    public LobChunk getNextChunk() throws IOException{
+
+        if (this.closed) {
+            throw new IllegalStateException(CorePlugin.Util.getString("stream_closed")); //$NON-NLS-1$
+        }
+                
+        // read contents from the stream
+        byte[] cbuf = new byte[this.chunkSize];
+        int read = this.stream.read(cbuf);
+        if (read == -1) {
+            return new LobChunk(new byte[0], true);
+        }
+        boolean isLast = false;
+        if (read != this.chunkSize) {
+            byte[] buf = new byte[read];
+            System.arraycopy(cbuf, 0, buf, 0, read);
+            cbuf = buf;
+        }
+        int next = this.stream.read();
+        if (next == -1) {
+        	isLast = true;
+        } else {
+        	this.stream.unread(next);
+        }
+        return new LobChunk(cbuf, isLast);
+    }
+
+    /** 
+     * @see com.metamatrix.common.lob.ByteLobChunkProducer#close()
+     */
+    public void close() throws IOException {
+        this.closed = true;
+        this.stream.close();
+    }        
+}
\ No newline at end of file

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -22,8 +22,8 @@
 package org.teiid.dqp.internal.process;
 
 import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.client.RequestMessage;
 
-import com.metamatrix.dqp.message.RequestMessage;
 
 public class DQPConfiguration{
 	

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -44,6 +44,15 @@
 import org.teiid.adminapi.AdminException;
 import org.teiid.adminapi.impl.RequestMetadata;
 import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
+import org.teiid.client.DQP;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.util.ResultsReceiver;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
 import org.teiid.dqp.internal.cache.DQPContextCache;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.logging.api.CommandLogMessage;
@@ -52,24 +61,15 @@
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.buffer.BufferManager;
-import com.metamatrix.common.comm.api.ResultsReceiver;
-import com.metamatrix.common.lob.LobChunk;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.types.Streamable;
-import com.metamatrix.common.xa.XATransactionException;
-import com.metamatrix.common.xa.XidImpl;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.core.util.Assertion;
 import com.metamatrix.dqp.DQPPlugin;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.MetadataResult;
-import com.metamatrix.dqp.client.ResultsFuture;
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
 import com.metamatrix.dqp.service.BufferService;
 import com.metamatrix.dqp.service.TransactionContext;
 import com.metamatrix.dqp.service.TransactionService;

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -38,10 +38,10 @@
 import org.teiid.adminapi.DataPolicy;
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.security.SessionToken;
 import org.teiid.security.SecurityHelper;
 
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.platform.security.api.SessionToken;
 
 public class DQPWorkContext implements Serializable {
 	

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,6 +33,7 @@
 
 import org.teiid.adminapi.impl.ModelMetaData;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.RequestMessage;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.language.SQLReservedWords;
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
@@ -67,7 +68,6 @@
 import com.metamatrix.dqp.DQPPlugin;
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
 import com.metamatrix.dqp.service.BufferService;
 import com.metamatrix.query.processor.CollectionTupleSource;
 import com.metamatrix.query.processor.ProcessorDataManager;

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,6 +25,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.teiid.client.SourceWarning;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorWork;
 
@@ -32,7 +33,6 @@
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.buffer.TupleSource;
 import com.metamatrix.core.util.Assertion;
-import com.metamatrix.dqp.exception.SourceWarning;
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.AtomicResultsMessage;
 

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,10 +28,10 @@
 
 import javax.resource.spi.work.Work;
 
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.util.ResultsReceiver;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.comm.api.ResultsReceiver;
-import com.metamatrix.common.lob.ByteLobChunkStream;
-import com.metamatrix.common.lob.LobChunk;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.types.BlobType;
 import com.metamatrix.common.types.ClobType;

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,6 +29,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.metadata.ResultsMetadataConstants;
+import org.teiid.client.metadata.ResultsMetadataDefaults;
 import org.teiid.connector.language.SQLReservedWords;
 import org.teiid.dqp.internal.process.DQPCore.ClientState;
 import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
@@ -41,10 +44,7 @@
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.common.types.XMLType;
-import com.metamatrix.dqp.client.MetadataResult;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
-import com.metamatrix.dqp.metadata.ResultsMetadataDefaults;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.metadata.SupportConstants;

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,6 +28,9 @@
 import java.util.Properties;
 import java.util.Set;
 
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.ResultsMode;
+import org.teiid.client.xa.XATransactionException;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.dqp.internal.process.multisource.MultiSourceCapabilitiesFinder;
 import org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper;
@@ -45,14 +48,11 @@
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.common.xa.XATransactionException;
 import com.metamatrix.core.id.IDGenerator;
 import com.metamatrix.core.id.IntegerIDFactory;
 import com.metamatrix.core.util.Assertion;
 import com.metamatrix.dqp.DQPPlugin;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.RequestMessage.ResultsMode;
 import com.metamatrix.dqp.service.TransactionContext;
 import com.metamatrix.dqp.service.TransactionService;
 import com.metamatrix.dqp.service.TransactionContext.Scope;

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-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,6 +31,13 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.SourceWarning;
+import org.teiid.client.lob.LobChunk;
+import org.teiid.client.metadata.ParameterInfo;
+import org.teiid.client.util.ResultsReceiver;
+import org.teiid.client.xa.XATransactionException;
 import org.teiid.connector.api.DataNotAvailableException;
 import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
 import org.teiid.logging.api.CommandLogMessage.Event;
@@ -41,21 +48,14 @@
 import com.metamatrix.common.buffer.BlockedException;
 import com.metamatrix.common.buffer.TupleBatch;
 import com.metamatrix.common.buffer.TupleBuffer;
-import com.metamatrix.common.comm.api.ResultsReceiver;
-import com.metamatrix.common.lob.LobChunk;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.common.xa.XATransactionException;
 import com.metamatrix.core.MetaMatrixCoreException;
 import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.dqp.DQPPlugin;
-import com.metamatrix.dqp.exception.SourceWarning;
 import com.metamatrix.dqp.message.AtomicRequestID;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
 import com.metamatrix.dqp.service.TransactionContext;
 import com.metamatrix.dqp.service.TransactionService;
 import com.metamatrix.dqp.service.TransactionContext.Scope;

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -46,9 +46,9 @@
 import org.teiid.adminapi.AdminException;
 import org.teiid.adminapi.AdminProcessingException;
 import org.teiid.adminapi.impl.TransactionMetadata;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
 
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
 import com.metamatrix.core.util.Assertion;
 import com.metamatrix.dqp.DQPPlugin;
 import com.metamatrix.dqp.service.TransactionContext;

Deleted: trunk/engine/src/main/java/org/teiid/security/SecurityPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/security/SecurityPlugin.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/main/java/org/teiid/security/SecurityPlugin.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -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.security;
-
-import java.util.ResourceBundle;
-import com.metamatrix.core.BundleUtil;
-
-/**
- * PlatformPlugin
- * <p>Used here in <code>platform</code> to have access to the new
- * logging framework for <code>LogManager</code>.</p>
- */
-public class SecurityPlugin { // extends Plugin {
-
-    /**
-     * The plug-in identifier of this plugin
-     * (value <code>"com.metamatrix.platform"</code>).
-     */
-    public static final String PLUGIN_ID = "org.teiid.security" ; //$NON-NLS-1$
-
-	public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
-	                                                     PLUGIN_ID + ".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-}

Added: trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties	                        (rev 0)
+++ trunk/engine/src/main/resources/org/teiid/adminapi/impl/i18n.properties	2010-03-20 03:06:44 UTC (rev 1981)
@@ -0,0 +1,285 @@
+#
+# 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.
+#
+
+AdminMethodRoleResolver.Unknown_method=Unknown method name: {0}
+AdminMethodRoleResolver.No_roles_defined_for_method=Method name [{0}] has no roles defined.
+AdminMethodRoleResolver.Invalid_role_defined_for_method=Method name [{0}] has an invalid role [{1}].
+
+AdminMethodEncryptResolver.Invalid_properties_file=Exception while reading methodencrypt.properties.
+
+AdminOptions.Unknown_option=Unknown Option value: {0}
+AbstractAdminObject.0=Admin object Identifier string can not be null.
+AbstractAdminObject.1=Admin object Identifier string should contain at least one identifier; can not be zero length.
+
+MMAdminObject.Unsupported_Admin_Object=Unable to load AdminObjects of Class {0}.
+
+
+MMConnectionPool.MMConnectionPool=MMConnectionPool:\n Identifier:\ 
+MMConnectionPool.Type=\n Type:\ 
+MMConnectionPool.Active=\n Active:\ 
+MMConnectionPool.Properties=\n Properties:\ 
+
+
+MMConnectorBinding.unknown=Unknown
+MMConnectorBinding.open=Open
+MMConnectorBinding.closed=Closed
+MMConnectorBinding.failed=Failed
+MMConnectorBinding.initializationFailed=Initialization Failed
+MMConnectorBinding.notInitialized=Not Initialized
+MMConnectorBinding.notRegistered=Not Registered
+MMConnectorBinding.dataSourceUnavailable=DataSourceUnavailable
+
+MMConnectorBinding.MMConnectorBinding=MMConnectorBinding: \n Identifier:\ 
+MMConnectorBinding.Description=\n Description:\ 
+MMConnectorBinding.Created=\n Created:\ 
+MMConnectorBinding.Created_By=\n Created By:\ 
+MMConnectorBinding.Updated=\n Updated:\ 
+MMConnectorBinding.Updated_By=\n Updated By:\ 
+MMConnectorBinding.State=\n State:\ 
+MMConnectorBinding.State_Changed=\n State Changed:\ 
+MMConnectorBinding.IsDeployed=\n Is Deployed:\ 
+MMConnectorBinding.IsRegistered=\n Is Running:\ 
+MMConnectorBinding.Properties=\n Properties:\ 
+
+MMConnectorType.MMConnectorType=MMConnectorType: \n Identifier:\ 
+MMConnectorType.Created=\n Created:\ 
+MMConnectorType.Created_By=\n Created By:\ 
+MMConnectorType.Updated=\n Updated:\ 
+MMConnectorType.Updated_By=\n Updated By:\ 
+
+MMExtensionModule.MMExtensionModule=MMExtensionModule: \n Identifier:\ 
+MMExtensionModule.moduleType=\n Module Type:\ 
+MMExtensionModule.description=\n Decription:\ 
+
+
+MMModel.MMModel=MMModel:\n Identifier:\ 
+MMModel.type=\n Type:\ 
+MMModel.physical=\n Physical:\ 
+MMModel.visible=\n Visible:\ 
+MMModel.connector_bindings=\n Connector Bindings:\ 
+MMModel.modelURI=\n URI:\ 
+MMModel.properties=\n Properties:\ 
+MMModel.created=\n Created:\ 
+MMModel.created_by=\n Created By:\ 
+MMModel.updated=\n Updated:\ 
+MMModel.updated_by=\n Updated By:\ 
+
+
+MMObject.0=Unable to create an ID object with a null full name.
+MMObject.1=Unable to create an ID object with a zero-length name.
+
+
+
+MMProcess.MMProcess=MMProcess:\n Identifier:\ 
+MMProcess.Properties=\n Properties:\ 
+MMProcess.Created=\n Created:\ 
+MMProcess.CreatedBy=\n Created By:\ 
+MMProcess.Updated=\n Updated:\ 
+MMProcess.UpdatedBy=\n Updated By:\ 
+MMProcess.TotalMemory=\n Total Memory:\ 
+MMProcess.FreeMemory=\n Free Memory:\ 
+MMProcess.ThreadCount=\n Thread Count:\ 
+MMProcess.ProcessName=\n Process Name:\ 
+MMProcess.HostName=\n Host Name:\ 
+MMProcess.Port=\n Port:\ 
+MMProcess.InetAddress=\n InetAddress:\ 
+MMProcess.IsDeployed=\n Is Deployed:\ 
+MMProcess.IsRunning=\n Is Running:\ 
+MMProcess.Sockets=\n Sockets:\ 
+MMProcess.MaxSockets=\n Max Sockets:\ 
+MMProcess.StartTime=\n StartTime:\ 
+MMProcess.ObjectsRead=\n Objects Read:\ 
+MMProcess.ObjectsWritten=\n Objects Written:\ 
+MMProcess.QueueWorkerPool=\n Queue Worker Pool:\ 
+
+
+MMPropertyDefinition.MMPropertyDefinition=MMPropertyDefinition:\n Identifier:\ 
+MMPropertyDefinition.Display_name=\n Display name:\ 
+MMPropertyDefinition.Description=\n Description:\ 
+MMPropertyDefinition.Value=\n Value:\ 
+MMPropertyDefinition.Property_type=\n Property type:\ 
+MMPropertyDefinition.Property_type_class_name=\n Property type class name:\ 
+MMPropertyDefinition.Default_value=\n Default value:\ 
+MMPropertyDefinition.Minimum_multiplicity=\n Minimum multiplicity:\ 
+MMPropertyDefinition.Maximum_multiplicity=\n Maximum multiplicity:\ 
+MMPropertyDefinition.Constrained_to_allow_values=\n Constrained to allow values:\ 
+MMPropertyDefinition.Allowed_values=\n Allowed values:\ 
+MMPropertyDefinition.Value_delimiter=\n Value delimiter:\ 
+MMPropertyDefinition.Required=\n Required:\ 
+MMPropertyDefinition.Expert=\n Expert:\ 
+MMPropertyDefinition.Hidden=\n Hidden:\ 
+MMPropertyDefinition.Masked=\n Masked:\ 
+MMPropertyDefinition.Modifiable=\n Modifiable:\ 
+MMPropertyDefinition.Preferred=\n Preferred:\ 
+MMPropertyDefinition.RequiresRestart=\n Requires restart:\ 
+
+
+
+MMQueueWorkerPool.MMQueueWorkerPool=QueueWorkerPool:\n Identifier:\ 
+MMQueueWorkerPool.queued=\n queued:\ 
+MMQueueWorkerPool.highestQueued=\n highestQueued:\ 
+MMQueueWorkerPool.totalSubmitted=\n totalSubmitted:\ 
+MMQueueWorkerPool.totalCompleted=\n totalCompleted:\ 
+MMQueueWorkerPool.threads=\n threads:\ 
+MMQueueWorkerPool.highestThreads=\n highestThreads:\ 
+
+
+MMRequest.MMRequest=MMRequest:\n Identifier:\ 
+MMRequest.requestID=\n requestID:\ 
+MMRequest.userName=\n userName:\ 
+MMRequest.nodeID=\n nodeID:\ 
+MMRequest.sessionID=\n sessionID:\ 
+MMRequest.created=\n created:\ 
+MMRequest.processing=\n processing:\ 
+MMRequest.transactionID=\n transactionID:\ 
+MMRequest.command=\n command:\ 
+
+
+MMResource.MMResource=MMResource: \n Identifier:\ 
+MMResource.Type=\n Type:\ 
+MMResource.Created=\n Created:\ 
+MMResource.Created_By=\n Created By:\ 
+MMResource.Updated=\n Updated:\ 
+MMResource.Updated_By=\n Updated By:\ 
+MMResource.Properties=\n Properties:\ 
+MMResource.ConnectionPoolIdentifier=\n Assigned To:\ 
+
+MMSession.MMSession=MMSession:\n Identifier:\ 
+MMSession.User_Name=\n User Name:\ 
+MMSession.Application=\n Application:\ 
+MMSession.ID=\n ID:\ 
+MMSession.Logged_In_At=\n Logged In At:\ 
+MMSession.VDB_Name=\n VDB Name:\ 
+MMSession.VDB_Version=\n VDB Version:\ 
+MMSession.Product=\n Product:\ 
+MMSession.Last_Ping_Time=\n Last Ping Time:\ 
+MMSession.State=\n State:\ 
+MMSession.IPAddress=\n IPAddress:\ 
+MMSession.HostName=\n HostName:\ 
+
+
+MMSourceRequest.MMSourceRequest=MMSourceRequest:\n Identifier:\ 
+
+
+MMSystem.MMSystem=MMSystem:\n Identifier:\ 
+MMSystem.properties=\n properties:\ 
+MMSystem.isStarted=\n Is Started:\ 
+MMSystem.startTime=\n Start Time:\ 
+
+
+MMVDB.MMVDB=MMVDB:\n Identifier:\ 
+MMVDB.vdbVersion=\n\ VDB Version:\ 
+MMVDB.status=\n\ Status:\ 
+MMVDB.model=\n\ Model:\ 
+MMVDB.models=\n\ Models:\ 
+MMVDB.versionedDate=\n\ Versioned Date:\ 
+MMVDB.versionedBy=\n\ Versioned By:\ 
+MMVDB.properties=\n\ properties:\ 
+
+TransactionImpl.identifier=Transaction:\n Identifier:\ 
+TransactionImpl.associatedSession=\n\ Associated Session:\ 
+TransactionImpl.scope=\n\ Scope:\ 
+TransactionImpl.status=\n\ Status:\ 
+TransactionImpl.xid=\n\ Xid:\ 
+TransactionImpl.createdTime=\n\ Created Time:\ 
+
+AdminStatus.CODE_UNKNOWN=Unknown.
+AdminStatus.CODE_SUCCESS=Success.
+AdminStatus.CODE_DECRYPTION_FAILED=Warning: The following connector bindings have NOT been imported because the passwords could not be decrypted: {0}.  The bindings may have been exported from a system with a different keystore.  You must either import with AdminOptions.BINDINGS_IGNORE_DECRYPT_ERROR then manually re-enter the passwords by setting the properties on the Connector binding via the Admin API, or via the Console ''Properties'' tab, or convert the file with the ''convertpasswords'' utility and re-import.
+        
+MMScriptsContainer.unable_to_locate_directory=Unable to locate directory {0}.
+MMScriptsContainer.unable_to_write_to_directory=Unable to write to directory {0}.
+MMScriptsContainer.files_exist=These files already exist: {0}.
+MMScriptsContainer.fileContents_was_null=Required argument "fileContents" was null or empty.
+MMScriptsContainer.error_writing_file=Error writing file: {0}.
+MMScriptsContainer.fileName_was_null=Required argument "fileName" was null or empty.
+
+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.
+
+PartialResultsException.WARNING__There_were_failures_while_processing_the_query=WARNING: There were failures while processing the query:
+
+
+MSG.014.010.0003 = Registering AppServerVMController {0}
+MSG.014.010.0004 = Setting log config: {0}
+ServiceRegistryBinding.Err_creating_stub=Error creating stub for Service
+ERR.014.006.0022 = Error connecting service stub to ORB.
+
+PlatformProxyHelper.Err_create_session_svc=Error creating SessionServiceProxy,
+PlatformProxyHelper.Err_create_auth_svc=Error creating AuthorizationServiceProxy,
+PlatformProxyHelper.Err_create_membership_svc=Error creating MembershipServiceProxy,
+PlatformProxyHelper.Err_create_config_svc=Error creating ConfigurationServiceProxy,
+
+
+Admin_Audit_request=Administrator [{0}], session [{1}] requesting access which requires role [{2}] to method [{3}].
+Admin_Audit_not_authorized=Administrator [{0}], session [{1}] does not have the required role [{2}] so is not authorized to perform the action [{3}].
+Admin_Audit_granted=Administrator [{0}], session [{1}] granted access to method [{3}].
+
+MaterializationLoadScriptsImpl.null_load_script_file_name=Attempting to set a null load script file name.
+MaterializationLoadScriptsImpl.null_load_script_file_contents=Attempting to set null load script file contents.
+
+RequestContext.invalid_context=Invalid portable context string. Unable to reinstantiate a request context from the string :{0}
+RequestContext.null_context=The portable request context should not be null.
+Request.virtual_restricted=Executing commands with virtual groups or virtual procedures is not allowed due to license restriction.
+ResultBatch.no_rows=The row count for this batch is 0 and it contains no values.
+ResultBatch.invalid_row=Invalid row {0}: begin row <= row value <= end row.
+ResultBatch.invalid_column=Invalid column {0}: 1 <= column <= column count
+ResultBatch.null_result=Unexpected null result from the server when requesting a LOB chunk.
+ResultBatch.no_params=This result batch contains no parameters.
+ResultBatch.invalid_paramindex=Invalid parameter index {0}: 1 <= parameter index <= parameter count.
+ResultBatch.not_update=This result batch does not represent an update result.
+ResultBatch.exception_exists=The update count is invalid: this result contains an exception.
+ResultBatch.update_count_unavailable=Unable to retrieve an update count from this batch.
+ServerConnectionInfo.invalid_context=Invalid portable context string. Unable to reinstantiate a ServerConnectionInfo from the string :{0}
+ServerConnectionInfo.invalid_url=The url "{0}" is invalid and could not be parsed. The url should be of the form mm[s]://host[,host2,host3...]:port[,port2,port3...]
+ServerFacadeImpl.invalid_txnautowrap=Invalid transaction autowrap mode "{0}"
+ServerFacadeImpl.invalid_beginRow=Invalid beginRow {0}: beginRow must be >= 1
+ServerFacadeImpl.invalid_endRow=Invalid maxEndRow {0}: beginRow must be <= maxEndRow
+ServerFacadeImpl.invalid_waitTime=Invalid waitTime {0}: waitTime must be >= 0
+ServerFacadeImpl.invalid_connInfo=The server facade expects an instance of ServerConnectionInfo.
+ServerFacadeImpl.null_requestInfo=The request info must not be null.
+ServerFacadeImpl.invalid_requestInfo=The server facade expects an instance of ServerRequest.
+ServerFacadeImpl.invalid_cursorType=The cursor type must be one of {ResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVE}.
+ServerFacadeImpl.invalid_fetchSize=The fetch size must be >= 0
+ServerFacadeImpl.invalid_requestType=The request type must be one of {RequestInfo.REQUEST_TYPE_STATEMENT,RequestInfo.REQUEST_TYPE_PREPARED_STATEMENT,RequestInfo.REQUEST_TYPE_CALLABLE_STATEMENT}.
+ServerFacadeImpl.invalid_sql=The SQL command must not be null.
+ServerFacadeImpl.invalid_txnAutowrap=The transaction autowrap mode must be one of {RequestInfo.AUTOWRAP_OFF,RequestInfo.AUTOWRAP_ON,RequestInfo.AUTOWRAP_OPTIMISTIC,RequestInfo.AUTOWRAP_PESSIMISTIC}.
+ServerSessionContext.invalid_context=Invalid portable context string. Unable to reinstantiate a server session context from the string :{0}
+ServerSessionContext.null_context=The portable session context should not be null.
+ServerConnectionInfo.invalid_encoding=Invalid encoded object within the portable string. Unable to reinstantiate an object from the encoded string :{0}
+ServerFacadeImpl.timeout=Timed out while waiting for a response.
+ServerFacadeImpl.null_connInfo=The connection info must not be null.
+ServerFacadeImpl.null_URL=The server URL must not be null.
+ServerFacadeImpl.null_user=The user name must not be null.
+ServerFacadeImpl.null_pwd=The password must not be null.
+ServerFacadeImpl.null_vdb=The VDB name must not be null.
+ServerFacadeImpl.updates_not_supported=The server facade does not support metadata requests for INSERT, UPDATE, DELETE, or SELECT...INTO statements.
+ResultBatch.not_last_batch=This method can only be called on the last batch of results.
+ResultBatch.not_out_param=The parameter at index {0} must be of type RETURN, OUT, or INOUT
+CacheResults.Trying_to_cache_unexpected_results=Trying to cache unexpected results. Expected request ID "{0}"; Got request ID "{1}"
+QueryMetadataCache.cache_not_valid=The query metadata cache may have been cleared and is no longer valid, create a new cache.
+Request.failed_deliver_message=Error delivering results to client for request {0}
+LobStream.noreference=LOB can not be reached; reference is null for streaming.
+Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
+no_response_server=No response received from server.
+Request.query_plan_not_allowed=Query Plan not allowed in this context. Please remove the SHOWPLAN or PLANONLY option.
+Request.wsdl_user_not_authorized=The anonymous user is not authorized for this action.

Modified: trunk/engine/src/test/java/com/metamatrix/dqp/message/TestAtomicRequestMessage.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/message/TestAtomicRequestMessage.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/message/TestAtomicRequestMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -24,6 +24,7 @@
 
 import junit.framework.TestCase;
 
+import org.teiid.client.RequestMessage;
 import org.teiid.dqp.internal.datamgr.language.TestQueryImpl;
 import org.teiid.dqp.internal.process.DQPWorkContext;
 

Modified: trunk/engine/src/test/java/com/metamatrix/dqp/message/TestResultsMessage.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/message/TestResultsMessage.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/message/TestResultsMessage.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,6 +28,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.metadata.ParameterInfo;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.common.types.DataTypeManager;

Modified: trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,11 +33,11 @@
 import java.util.List;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.api.exception.query.QueryParserException;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.sql.lang.BetweenCriteria;
 import com.metamatrix.query.sql.lang.Command;
 import com.metamatrix.query.sql.lang.CompareCriteria;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataStore.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataStore.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/FakeDataStore.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,9 +27,10 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.metadata.StoredProcedureInfo;
 import com.metamatrix.query.metadata.TempMetadataStore;
 import com.metamatrix.query.sql.lang.SPParameter;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,12 +28,12 @@
 import java.util.List;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryValidatorException;
 import com.metamatrix.common.buffer.TupleSource;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.optimizer.TestOptimizer;
 import com.metamatrix.query.processor.proc.CreateCursorResultSetInstruction;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -41,6 +41,7 @@
 import java.util.Set;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
@@ -54,7 +55,6 @@
 import com.metamatrix.common.types.XMLType;
 import com.metamatrix.core.MetaMatrixCoreException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.function.FunctionLibrary;
 import com.metamatrix.query.function.FunctionTree;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,6 +32,7 @@
 import java.util.Map;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
@@ -44,7 +45,6 @@
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.common.types.XMLType;
 import com.metamatrix.core.MetaMatrixCoreException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.metadata.QueryMetadataInterface;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLPlanningEnhancements.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLPlanningEnhancements.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLPlanningEnhancements.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -26,11 +26,12 @@
 import java.util.List;
 import java.util.Map;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.common.buffer.BufferManager;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.mapping.xml.MappingAttribute;
 import com.metamatrix.query.mapping.xml.MappingDocument;

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -37,6 +37,7 @@
 import javax.xml.transform.OutputKeys;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
@@ -51,7 +52,6 @@
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.common.types.XMLType;
 import com.metamatrix.core.util.UnitTestUtil;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.mapping.xml.MappingAttribute;

Modified: trunk/engine/src/test/java/com/metamatrix/query/resolver/TestProcedureResolving.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/resolver/TestProcedureResolving.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/resolver/TestProcedureResolving.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,13 +30,13 @@
 import java.util.Map;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.api.exception.query.QueryParserException;
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.metadata.QueryMetadataInterface;

Modified: trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/resolver/TestResolver.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -39,13 +39,13 @@
 
 import org.junit.Before;
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.function.FunctionDescriptor;
 import com.metamatrix.query.function.FunctionLibrary;

Modified: trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,6 +33,7 @@
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
@@ -43,7 +44,6 @@
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.common.util.TimestampWithTimezone;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.parser.QueryParser;
 import com.metamatrix.query.resolver.QueryResolver;

Modified: trunk/engine/src/test/java/com/metamatrix/query/sql/util/TestUpdateProcedureGenerator.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/util/TestUpdateProcedureGenerator.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/util/TestUpdateProcedureGenerator.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,11 +25,12 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import junit.framework.TestCase;
 
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.parser.QueryParser;

Modified: trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestSQLStringVisitor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestSQLStringVisitor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/visitor/TestSQLStringVisitor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,12 +27,12 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.connector.language.SQLReservedWords;
 
 import junit.framework.TestCase;
 
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.parser.QueryParser;
 import com.metamatrix.query.resolver.QueryResolver;
 import com.metamatrix.query.sql.LanguageObject;

Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,12 +29,13 @@
 import java.util.List;
 import java.util.Properties;
 
+import org.teiid.client.metadata.ParameterInfo;
+
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.core.util.ArgCheck;
 import com.metamatrix.core.util.Assertion;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.function.FunctionLibrary;
 import com.metamatrix.query.function.SystemFunctionManager;
 import com.metamatrix.query.mapping.relational.QueryNode;

Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,6 +32,7 @@
 import org.teiid.adminapi.impl.ModelMetaData;
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.dqp.internal.process.DQPWorkContext;
 import org.teiid.metadata.TransformationMetadata;
@@ -40,7 +41,6 @@
 import com.metamatrix.api.exception.query.QueryMetadataException;
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.core.vdb.ModelType;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.mapping.xml.MappingAttribute;
 import com.metamatrix.query.mapping.xml.MappingDocument;

Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/RealMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/RealMetadataFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/RealMetadataFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,6 +28,7 @@
 import java.util.List;
 
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.metadata.ParameterInfo;
 import org.teiid.connector.metadata.runtime.Column;
 import org.teiid.connector.metadata.runtime.ColumnSet;
 import org.teiid.connector.metadata.runtime.MetadataStore;
@@ -42,7 +43,6 @@
 import org.teiid.metadata.TransformationMetadata;
 
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.sql.lang.SPParameter;
 

Modified: trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -36,6 +36,7 @@
 import java.util.Set;
 
 import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
@@ -43,7 +44,6 @@
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.types.DataTypeManager;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.message.ParameterInfo;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.mapping.relational.QueryNode;
 import com.metamatrix.query.mapping.xml.MappingDocument;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,6 +32,7 @@
 import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.teiid.client.RequestMessage;
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ProcedureExecution;
@@ -42,7 +43,6 @@
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.AtomicResultsMessage;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
 import com.metamatrix.dqp.service.TransactionContext;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.parser.QueryParser;

Added: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestByteLobChunkStream.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestByteLobChunkStream.java	                        (rev 0)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestByteLobChunkStream.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -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.dqp.internal.process;
+
+import java.io.ByteArrayInputStream;
+import java.util.Arrays;
+
+import org.teiid.client.lob.LobChunkInputStream;
+
+import junit.framework.TestCase;
+
+import com.metamatrix.core.util.ObjectConverterUtil;
+
+public class TestByteLobChunkStream extends TestCase {
+
+    public void testGetChunk() throws Exception {
+    	byte[] bytes = "hello world".getBytes(); //$NON-NLS-1$
+        ByteLobChunkStream stream = new ByteLobChunkStream(new ByteArrayInputStream(bytes), 5);
+
+        assertTrue(Arrays.equals(bytes, ObjectConverterUtil.convertToByteArray(new LobChunkInputStream(stream))));            
+    }
+    
+}

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,13 +33,13 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.ResultsMessage;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
 
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.common.queue.FakeWorkManager;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.ResultsMessage;
 import com.metamatrix.dqp.service.AutoGenDataService;
 import com.metamatrix.dqp.service.FakeBufferService;
 import com.metamatrix.query.unittest.FakeMetadataFactory;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCoreRequestHandling.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCoreRequestHandling.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCoreRequestHandling.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,15 +29,15 @@
 import junit.framework.TestCase;
 
 import org.teiid.adminapi.impl.RequestMetadata;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.SourceWarning;
+import org.teiid.client.security.SessionToken;
 import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
 import org.teiid.dqp.internal.process.DQPCore.ClientState;
 
 import com.metamatrix.api.exception.MetaMatrixException;
-import com.metamatrix.dqp.exception.SourceWarning;
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.platform.security.api.SessionToken;
 import com.metamatrix.query.sql.lang.Command;
 
 /**

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,13 +25,13 @@
 import junit.framework.TestCase;
 
 import org.mockito.Mockito;
+import org.teiid.client.RequestMessage;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
 
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.dqp.message.AtomicRequestMessage;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
 import com.metamatrix.dqp.service.AutoGenDataService;
 import com.metamatrix.dqp.service.FakeBufferService;
 import com.metamatrix.query.metadata.QueryMetadataInterface;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestMetaDataProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestMetaDataProcessor.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestMetaDataProcessor.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,13 +30,13 @@
 import junit.framework.TestCase;
 
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.metadata.ResultsMetadataConstants;
 import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
 
 import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.client.MetadataResult;
 import com.metamatrix.dqp.message.RequestID;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.parser.QueryParser;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -31,6 +31,8 @@
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.StatementType;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.dqp.internal.datamgr.impl.FakeTransactionService;
 
@@ -40,8 +42,6 @@
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.api.exception.query.QueryValidatorException;
 import com.metamatrix.common.buffer.BufferManagerFactory;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.RequestMessage.StatementType;
 import com.metamatrix.dqp.service.AutoGenDataService;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 import com.metamatrix.query.optimizer.TestOptimizer;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -28,6 +28,8 @@
 import junit.framework.TestCase;
 
 import org.mockito.Mockito;
+import org.teiid.client.RequestMessage;
+import org.teiid.client.RequestMessage.StatementType;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -36,8 +38,6 @@
 import com.metamatrix.api.exception.query.QueryResolverException;
 import com.metamatrix.api.exception.query.QueryValidatorException;
 import com.metamatrix.common.buffer.BufferManager;
-import com.metamatrix.dqp.message.RequestMessage;
-import com.metamatrix.dqp.message.RequestMessage.StatementType;
 import com.metamatrix.dqp.service.AutoGenDataService;
 import com.metamatrix.query.analysis.AnalysisRecord;
 import com.metamatrix.query.metadata.QueryMetadataInterface;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,10 +25,10 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.teiid.client.ResultsMessage;
+import org.teiid.client.TestRequestMessage;
 import org.teiid.dqp.internal.process.RequestWorkItem;
 
-import com.metamatrix.dqp.message.ResultsMessage;
-import com.metamatrix.dqp.message.TestRequestMessage;
 import com.metamatrix.query.sql.symbol.ElementSymbol;
 
 import junit.framework.TestCase;

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/transaction/TestTransactionServer.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/transaction/TestTransactionServer.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/transaction/TestTransactionServer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,9 +32,9 @@
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.teiid.adminapi.Transaction;
+import org.teiid.client.xa.XATransactionException;
+import org.teiid.client.xa.XidImpl;
 
-import com.metamatrix.common.xa.XidImpl;
-import com.metamatrix.common.xa.XATransactionException;
 import com.metamatrix.dqp.service.TransactionContext;
 public class TestTransactionServer {
 

Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -50,6 +50,9 @@
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
 import org.teiid.adminapi.jboss.AdminProvider;
+import org.teiid.client.DQP;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.util.ExceptionUtil;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
 import org.teiid.dqp.internal.process.DQPConfiguration;
 import org.teiid.dqp.internal.process.DQPCore;
@@ -68,16 +71,13 @@
 import com.metamatrix.api.exception.ComponentNotFoundException;
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.security.SessionServiceException;
-import com.metamatrix.client.ExceptionUtil;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.log.MessageLevel;
-import com.metamatrix.dqp.client.DQP;
 import com.metamatrix.dqp.service.BufferService;
 import com.metamatrix.dqp.service.SessionService;
 import com.metamatrix.dqp.service.TransactionService;
-import com.metamatrix.platform.security.api.ILogon;
 
 @ManagementObject(isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
 public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry  {

Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -23,6 +23,8 @@
 package org.teiid.metadata.index;
 
 import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -33,7 +35,11 @@
 import java.util.List;
 import java.util.Map;
 
+import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.plugins.context.zip.ZipEntryContext;
+import org.jboss.virtual.spi.VirtualFileHandler;
 import org.teiid.adminapi.impl.ModelMetaData;
 import org.teiid.adminapi.impl.VDBMetaData;
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
@@ -65,7 +71,7 @@
  * Loads MetadataRecords from index files.  
  */
 public class IndexMetadataFactory {
-
+	
 	private Index[] indexes;
     private Map<String, Datatype> datatypeCache;
     private Map<String, KeyRecord> primaryKeyCache = new HashMap<String, KeyRecord>();
@@ -73,6 +79,35 @@
 	private MetadataStore store;
 	private HashSet<VirtualFile> indexFiles = new HashSet<VirtualFile>();
 	private LinkedHashMap<String, Resource> vdbEntries;
+	
+	public IndexMetadataFactory() {
+		
+	}
+	
+	/**
+	 * Load index metadata from a URL.  For the system and test vdbs
+	 * @param url
+	 * @throws IOException
+	 * @throws URISyntaxException
+	 */
+	public IndexMetadataFactory(URL url) throws IOException, URISyntaxException {
+		VFS.init();
+		ZipEntryContext context = new ZipEntryContext(url);
+		VirtualFileHandler vfh = context.getRoot();
+		VirtualFile vdb = new VirtualFile(vfh);
+		List<VirtualFile> children = vdb.getChildrenRecursively(new VirtualFileFilter() {
+			@Override
+			public boolean accepts(VirtualFile file) {
+				return file.getName().endsWith(IndexConstants.NAME_DELIM_CHAR+IndexConstants.INDEX_EXT);
+			}
+		});
+		
+		for (VirtualFile f: children) {
+			addIndexFile(f);
+		}
+		//just use the defaults for model visibility
+		addEntriesPlusVisibilities(vdb, new VDBMetaData());
+	}
     
 	public MetadataStore getMetadataStore() throws IOException {
 		if (this.store == null) {

Modified: trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
===================================================================
--- trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -24,26 +24,26 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
 
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.plugins.context.zip.ZipEntryContext;
-import org.teiid.adminapi.impl.VDBMetaData;
 import org.teiid.connector.metadata.runtime.MetadataStore;
 import org.teiid.metadata.CompositeMetadataStore;
 import org.teiid.metadata.TransformationMetadata;
 
+import com.metamatrix.core.CoreConstants;
 import com.metamatrix.core.MetaMatrixRuntimeException;
+import com.metamatrix.core.util.FileUtils;
 import com.metamatrix.core.util.LRUCache;
+import com.metamatrix.core.util.UnitTestUtil;
 import com.metamatrix.query.function.metadata.FunctionMetadataReader;
 import com.metamatrix.query.function.metadata.FunctionMethod;
 
+ at SuppressWarnings("nls")
 public class VDBMetadataFactory {
 	
 	public static LRUCache<URL, TransformationMetadata> VDB_CACHE = new LRUCache<URL, TransformationMetadata>(10);
@@ -63,16 +63,13 @@
 		}
 
 		try {
-			VirtualFile vdbFile = getVirtualFile(vdbURL);
+			IndexMetadataFactory imf = loadMetadata(vdbURL);
 			
-			IndexMetadataFactory imf = getMetadataStore(vdbFile);
-			imf.addEntriesPlusVisibilities(vdbFile, new VDBMetaData());
-			
 			Collection <FunctionMethod> methods = null;
 			if (udfFile != null) {
 				methods = FunctionMetadataReader.loadFunctionMethods(udfFile.openStream());
 			}
-			MetadataStore system = getMetadataStore(getVirtualFile(VDBMetadataFactory.class.getResource("/System.vdb"))).getMetadataStore(); //$NON-NLS-1$
+			MetadataStore system = loadMetadata(Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB)).getMetadataStore();
 			vdbmetadata = new TransformationMetadata(null, new CompositeMetadataStore(Arrays.asList(system, imf.getMetadataStore())), imf.getEntriesPlusVisibilities(), methods); 
 			VDB_CACHE.put(vdbURL, vdbmetadata);
 			return vdbmetadata;
@@ -81,37 +78,17 @@
 		}
     }
 
-	private static VirtualFile getVirtualFile(URL vdbURL) throws IOException,
-			URISyntaxException {
-		VFS.init();
-		VDBContext vdbContext = new VDBContext(vdbURL);
-		VirtualFile vdbFile = new VirtualFile(vdbContext.getRoot());
-		return vdbFile;
-	}
-
-	private static IndexMetadataFactory getMetadataStore(VirtualFile vdbFile)
-			throws IOException {
-		List<VirtualFile> children = vdbFile.getChildrenRecursively(new VirtualFileFilter() {
-			@Override
-			public boolean accepts(VirtualFile file) {
-				return file.getName().endsWith(IndexConstants.NAME_DELIM_CHAR+IndexConstants.INDEX_EXT);
-			}
-		});
-		
-		IndexMetadataFactory imf = new IndexMetadataFactory();
-		for (VirtualFile f: children) {
-			imf.addIndexFile(f);
+	private static IndexMetadataFactory loadMetadata(URL vdbURL)
+			throws IOException, MalformedURLException, URISyntaxException {
+		//vfs has a problem with vdbs embedded in jars in the classpath, so we'll create a temp version
+		if (vdbURL.getProtocol().equals("jar")) {
+			InputStream is = vdbURL.openStream();
+			File temp = File.createTempFile("temp", ".vdb", new File(UnitTestUtil.getTestScratchPath()));
+			temp.deleteOnExit();
+			FileUtils.write(is, temp);
+			vdbURL = temp.toURI().toURL();
 		}
-		
-		return imf;
-	}	
-	
-
-	private static class VDBContext extends ZipEntryContext{
-		private static final long serialVersionUID = -6504988258841073415L;
-
-		protected VDBContext(URL url) throws IOException, URISyntaxException {
-			super(url,false);
-		}
+		return new IndexMetadataFactory(vdbURL);
 	}
+
 }

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/pom.xml	2010-03-20 03:06:44 UTC (rev 1981)
@@ -401,46 +401,55 @@
                 <groupId>org.jboss.man</groupId>
                 <artifactId>jboss-managed</artifactId>
                 <version>2.1.0.SP1</version>
+                <scope>provided</scope>
             </dependency>        
             <dependency>
               <groupId>org.jboss.man</groupId>
               <artifactId>jboss-metatype</artifactId>
               <version>2.1.0.SP1</version>
+              <scope>provided</scope>
             </dependency>            
             <dependency>
                 <groupId>org.jboss.integration</groupId>
                 <artifactId>jboss-profileservice-spi</artifactId>
                 <version>5.1.0.GA</version>
+                <scope>provided</scope>
             </dependency>      
             <dependency>    
                 <groupId>org.jboss</groupId>
                 <artifactId>jboss-vfs</artifactId>
                 <version>2.1.2.GA</version>
+                <scope>provided</scope>
             </dependency>
             <dependency>    
                 <groupId>org.jboss.deployers</groupId>
                 <artifactId>jboss-deployers-vfs-spi</artifactId>
                 <version>2.0.7.GA</version>
+                <scope>provided</scope>
             </dependency>      
             <dependency>    
                 <groupId>org.jboss.deployers</groupId>
                 <artifactId>jboss-deployers-vfs</artifactId>
                 <version>2.0.7.GA</version>
+                <scope>provided</scope>
             </dependency>              
             <dependency>
               <groupId>org.jboss.jbossas</groupId>
               <artifactId>jboss-as-connector</artifactId>
               <version>5.1.0.GA</version>
+              <scope>provided</scope>
             </dependency>
             <dependency>
                 <groupId>org.jboss</groupId>
                 <artifactId>jboss-reflect</artifactId>
                 <version>2.0.2.GA</version>
+                <scope>provided</scope>
             </dependency>             
             <dependency>
               <groupId>org.jboss.remoting</groupId>
               <artifactId>jboss-remoting</artifactId>
               <version>2.5.1</version>
+              <scope>provided</scope>
             </dependency>            
 			<dependency>
 				<groupId>beanshell</groupId>

Modified: trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -24,15 +24,11 @@
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.List;
 
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.plugins.context.zip.ZipEntryContext;
 import org.teiid.adminapi.impl.ModelMetaData;
 import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.metadata.index.IndexConstants;
 import org.teiid.metadata.index.IndexMetadataFactory;
+import org.teiid.metadata.index.RuntimeMetadataPlugin;
 import org.teiid.runtime.RuntimePlugin;
 
 import com.metamatrix.core.CoreConstants;
@@ -55,29 +51,16 @@
 		try {
 			URL url = Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB);
 			if (url == null) {
-				throw new MetaMatrixRuntimeException(RuntimePlugin.Util.getString("system_vdb_not_found")); //$NON-NLS-1$
+				throw new MetaMatrixRuntimeException(RuntimeMetadataPlugin.Util.getString("system_vdb_not_found")); //$NON-NLS-1$
 			}
-			SystemVDBContext systemVDB = new SystemVDBContext(url);
-			VirtualFile vdb = new VirtualFile(systemVDB.getRoot());
-			List<VirtualFile> children = vdb.getChildrenRecursively(new VirtualFileFilter() {
-				@Override
-				public boolean accepts(VirtualFile file) {
-					return file.getName().endsWith(IndexConstants.NAME_DELIM_CHAR+IndexConstants.INDEX_EXT);
-				}
-			});
-			
-			IndexMetadataFactory imf = new IndexMetadataFactory();
-			for (VirtualFile f: children) {
-				imf.addIndexFile(f);
-			}
-			this.vdbRepository.addMetadataStore(deployment, imf.getMetadataStore());
+			this.vdbRepository.addMetadataStore(deployment, new IndexMetadataFactory(url).getMetadataStore());
 		} catch (URISyntaxException e) {
 			throw new MetaMatrixRuntimeException(e, RuntimePlugin.Util.getString("failed_to_deployed", CoreConstants.SYSTEM_VDB)); //$NON-NLS-1$
 		} catch (IOException e) {
 			throw new MetaMatrixRuntimeException(e, RuntimePlugin.Util.getString("failed_to_deployed", CoreConstants.SYSTEM_VDB)); //$NON-NLS-1$
 		}
 	}
-	
+
 	public void stop() {
 		this.vdbRepository.removeVDB(CoreConstants.SYSTEM_VDB, 1);
 	}
@@ -86,11 +69,4 @@
 		this.vdbRepository = repo;
 	}	
 	
-	private static class SystemVDBContext extends ZipEntryContext{
-		private static final long serialVersionUID = -6504988258841073415L;
-
-		protected SystemVDBContext(URL url) throws IOException, URISyntaxException {
-			super(url,true);
-		}
-	}
 }

Modified: trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -43,22 +43,22 @@
 import org.jboss.managed.api.annotation.ManagementProperty;
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.SessionToken;
 import org.teiid.deployers.VDBRepository;
 import org.teiid.deployers.VirtualDatabaseException;
 import org.teiid.dqp.internal.process.DQPCore;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.ServerConnection;
 import org.teiid.runtime.RuntimePlugin;
 import org.teiid.security.Credentials;
 import org.teiid.security.SecurityHelper;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 import com.metamatrix.api.exception.security.SessionServiceException;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.core.util.ArgCheck;
 import com.metamatrix.dqp.service.SessionService;
-import com.metamatrix.platform.security.api.SessionToken;
 
 /**
  * This class serves as the primary implementation of the Session Service.
@@ -163,9 +163,9 @@
 
         // Validate VDB and version if logging on to server product...
         VDBMetaData vdb = null;
-        String vdbName = properties.getProperty(MMURL.JDBC.VDB_NAME);
+        String vdbName = properties.getProperty(TeiidURL.JDBC.VDB_NAME);
         if (vdbName != null) {
-        	String vdbVersion = properties.getProperty(MMURL.JDBC.VDB_VERSION);
+        	String vdbVersion = properties.getProperty(TeiidURL.JDBC.VDB_VERSION);
             try {
                 if (vdbVersion == null) {
                 	vdb = this.vdbRepository.getActiveVDB(vdbName);
@@ -175,8 +175,8 @@
                 }            
                 
                 // Reset product info with validated constants
-                productInfo.put(MMURL.JDBC.VDB_NAME, vdb.getName());
-                productInfo.put(MMURL.JDBC.VDB_VERSION, vdb.getVersion());                
+                productInfo.put(TeiidURL.JDBC.VDB_NAME, vdb.getName());
+                productInfo.put(TeiidURL.JDBC.VDB_VERSION, vdb.getVersion());                
             } catch (VirtualDatabaseException e) {
             	throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion==null?"latest":vdbVersion)); //$NON-NLS-1$ //$NON-NLS-2$ 
 			}            
@@ -195,8 +195,8 @@
         newSession.setUserName(userName);
         newSession.setCreatedTime(creationTime);
         newSession.setApplicationName(applicationName);
-        newSession.setClientHostName(properties.getProperty(MMURL.CONNECTION.CLIENT_HOSTNAME));
-        newSession.setIPAddress(properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS));
+        newSession.setClientHostName(properties.getProperty(TeiidURL.CONNECTION.CLIENT_HOSTNAME));
+        newSession.setIPAddress(properties.getProperty(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS));
         newSession.setSecurityDomain(securityDomain);
         if (vdb != null) {
 	        newSession.setVDBName(vdb.getName());

Modified: trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/ChannelListener.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -22,9 +22,10 @@
 
 package org.teiid.transport;
 
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.platform.socket.ObjectChannel;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.socket.ObjectChannel;
 
+
 public interface ChannelListener {
 	
 	public interface ChannelListenerFactory {

Modified: trunk/runtime/src/main/java/org/teiid/transport/ClientInstance.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ClientInstance.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/ClientInstance.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -25,9 +25,9 @@
 import java.io.Serializable;
 
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.socket.Message;
 
-import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.exception.CommunicationException;
 import com.metamatrix.common.util.crypto.Cryptor;
 
 /**

Modified: trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -34,19 +34,18 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.util.ExceptionUtil;
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.NetPlugin;
+import org.teiid.net.ServerConnection;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.comm.CommonCommPlugin;
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
 
 public class LocalServerConnection implements ServerConnection {
 	private static final String TEIID_RUNTIME = "teiid/engine-deployer"; //$NON-NLS-1$
@@ -80,7 +79,7 @@
         	if (e.getCause() instanceof CommunicationException) {
         		throw (CommunicationException)e.getCause();
         	}
-            throw new CommunicationException(e, CommPlatformPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix")); //$NON-NLS-1$
+            throw new CommunicationException(e, NetPlugin.Util.getString("PlatformServerConnectionFactory.Unable_to_find_a_component_used_in_logging_on_to_MetaMatrix")); //$NON-NLS-1$
         } 	
 	}	
 	
@@ -89,7 +88,7 @@
 
 			public Object invoke(Object arg0, final Method arg1, final Object[] arg2) throws Throwable {
 				if (!isOpen()) {
-					throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(CommonCommPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
+					throw ExceptionUtil.convertException(arg1, new MetaMatrixComponentException(NetPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
 				}
 				try {
 					final T service = csr.getClientService(iface);

Modified: trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,22 +27,22 @@
 import javax.security.auth.login.LoginException;
 
 import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
+import org.teiid.client.util.ResultsFuture;
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.ServerConnection;
 import org.teiid.security.Credentials;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 import com.metamatrix.api.exception.ComponentNotFoundException;
 import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.LogonException;
 import com.metamatrix.api.exception.security.SessionServiceException;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.ServerConnection;
 import com.metamatrix.core.CoreConstants;
-import com.metamatrix.dqp.client.ResultsFuture;
 import com.metamatrix.dqp.service.SessionService;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
 
 public class LogonImpl implements ILogon {
 	
@@ -57,17 +57,17 @@
 	public LogonResult logon(Properties connProps) throws LogonException,
 			ComponentNotFoundException {
 		
-        String applicationName = connProps.getProperty(MMURL.CONNECTION.APP_NAME);
+        String applicationName = connProps.getProperty(TeiidURL.CONNECTION.APP_NAME);
         // user may be null if using trustedToken to log on
-        String user = connProps.getProperty(MMURL.CONNECTION.USER_NAME, CoreConstants.DEFAULT_ANON_USERNAME);
+        String user = connProps.getProperty(TeiidURL.CONNECTION.USER_NAME, CoreConstants.DEFAULT_ANON_USERNAME);
         // password may be null if using trustedToken to log on
-        String password = connProps.getProperty(MMURL.CONNECTION.PASSWORD);
+        String password = connProps.getProperty(TeiidURL.CONNECTION.PASSWORD);
 		Credentials credential = null;
         if (password != null) {
             credential = new Credentials(password.toCharArray());
         }
         
-        boolean adminConnection = Boolean.parseBoolean(connProps.getProperty(MMURL.CONNECTION.ADMIN));
+        boolean adminConnection = Boolean.parseBoolean(connProps.getProperty(TeiidURL.CONNECTION.ADMIN));
 		try {
 			SessionMetadata sessionInfo = service.createSession(user,credential, applicationName, connProps, adminConnection);
 	        updateDQPContext(sessionInfo);

Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -53,9 +53,9 @@
 import org.jboss.netty.handler.codec.serialization.ObjectDecoder;
 import org.jboss.netty.handler.codec.serialization.ObjectEncoder;
 import org.jboss.netty.handler.ssl.SslHandler;
+import org.teiid.net.NetPlugin;
+import org.teiid.net.socket.ObjectChannel;
 
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
-import com.metamatrix.common.comm.platform.socket.ObjectChannel;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 
@@ -217,7 +217,7 @@
 			ChannelStateEvent e) throws Exception {
 		ChannelListener listener = this.listeners.remove(e.getChannel());
 		if (listener != null) {
-			LogManager.logDetail(LogConstants.CTX_TRANSPORT, CommPlatformPlugin.Util.getString("SSLAwareChannelHandler.channel_closed")); //$NON-NLS-1$
+			LogManager.logDetail(LogConstants.CTX_TRANSPORT, NetPlugin.Util.getString("SSLAwareChannelHandler.channel_closed")); //$NON-NLS-1$
 		}
 	}
 

Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,7 +30,8 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
 
-import com.metamatrix.common.comm.platform.socket.SocketUtil;
+import org.teiid.net.socket.SocketUtil;
+
 import com.metamatrix.core.util.Assertion;
 
 

Modified: trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -33,18 +33,18 @@
 import javax.crypto.SealedObject;
 
 import org.teiid.adminapi.AdminProcessingException;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.net.socket.Message;
+import org.teiid.net.socket.ServiceInvocationStruct;
 import org.teiid.runtime.RuntimePlugin;
 import org.teiid.transport.ClientServiceRegistryImpl.ClientService;
 
 import com.metamatrix.api.exception.ExceptionHolder;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.platform.socket.client.ServiceInvocationStruct;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.util.crypto.CryptoException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.dqp.client.ResultsFuture;
 
 public class ServerWorkItem implements Runnable {
 	

Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,12 +27,12 @@
 import java.net.SocketAddress;
 
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.NetPlugin;
+import org.teiid.net.socket.Handshake;
+import org.teiid.net.socket.Message;
+import org.teiid.net.socket.ObjectChannel;
 
-import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.platform.CommPlatformPlugin;
-import com.metamatrix.common.comm.platform.socket.Handshake;
-import com.metamatrix.common.comm.platform.socket.ObjectChannel;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.util.crypto.CryptoException;
@@ -113,7 +113,7 @@
             
             //ensure the key information
             if (returnedPublicKey == null) {
-                throw new CommunicationException(CommPlatformPlugin.Util.getString("SocketClientInstance.invalid_sessionkey")); //$NON-NLS-1$
+                throw new CommunicationException(NetPlugin.Util.getString("SocketClientInstance.invalid_sessionkey")); //$NON-NLS-1$
             }
             
             try {

Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -30,9 +30,9 @@
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelFactory;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import org.teiid.net.socket.ObjectChannel;
 import org.teiid.transport.ChannelListener.ChannelListenerFactory;
 
-import com.metamatrix.common.comm.platform.socket.ObjectChannel;
 import com.metamatrix.common.log.LogConstants;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.util.ApplicationInfo;

Modified: trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -13,11 +13,11 @@
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.client.security.InvalidSessionException;
 import org.teiid.security.Credentials;
 import org.teiid.services.TeiidLoginContext;
 import org.teiid.services.SessionServiceImpl;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 
 public class TestSessionServiceImpl {
 	

Modified: trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,20 +32,20 @@
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.socket.SocketServerConnection;
+import org.teiid.net.socket.SocketServerConnectionFactory;
+import org.teiid.net.socket.SocketUtil;
+import org.teiid.net.socket.UrlServerDiscovery;
 
 import com.metamatrix.api.exception.ComponentNotFoundException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.socket.SocketUtil;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnection;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnectionFactory;
-import com.metamatrix.common.comm.platform.socket.client.UrlServerDiscovery;
 import com.metamatrix.common.util.crypto.NullCryptor;
 import com.metamatrix.dqp.service.SessionService;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
 
 public class TestCommSockets {
 
@@ -69,8 +69,8 @@
 
 		try {
 			Properties p = new Properties();
-			String url = new MMURL(addr.getHostName(), listener.getPort() - 1, false).getAppServerURL();
-			p.setProperty(MMURL.CONNECTION.SERVER_URL, url); //wrong port
+			String url = new TeiidURL(addr.getHostName(), listener.getPort() - 1, false).getAppServerURL();
+			p.setProperty(TeiidURL.CONNECTION.SERVER_URL, url); //wrong port
 			SocketServerConnectionFactory.getInstance().getConnection(p);
 			fail("exception expected"); //$NON-NLS-1$
 		} catch (CommunicationException e) {
@@ -151,9 +151,9 @@
 		}
 
 		Properties p = new Properties();
-		String url = new MMURL(addr.getHostName(), listener.getPort(), clientSecure).getAppServerURL();
-		p.setProperty(MMURL.CONNECTION.SERVER_URL, url); 
-		p.setProperty(MMURL.CONNECTION.DISCOVERY_STRATEGY, UrlServerDiscovery.class.getName());
+		String url = new TeiidURL(addr.getHostName(), listener.getPort(), clientSecure).getAppServerURL();
+		p.setProperty(TeiidURL.CONNECTION.SERVER_URL, url); 
+		p.setProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, UrlServerDiscovery.class.getName());
 		if (sscf == null) {
 			sscf = new SocketServerConnectionFactory();
 			sscf.initialize(socketConfig);

Modified: trunk/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -29,12 +29,12 @@
 
 import org.mockito.Mockito;
 import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.TeiidURL;
 
-import com.metamatrix.common.api.MMURL;
 import com.metamatrix.dqp.service.SessionService;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
 
 public class TestLogonImpl extends TestCase {
 
@@ -44,8 +44,8 @@
 		String userName = "Fred"; //$NON-NLS-1$
 		String applicationName = "test"; //$NON-NLS-1$
 		Properties p = new Properties();
-		p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
-		p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
+		p.setProperty(TeiidURL.CONNECTION.USER_NAME, userName);
+		p.setProperty(TeiidURL.CONNECTION.APP_NAME, applicationName);
 
 		SessionMetadata session = new SessionMetadata();
 		session.setUserName(userName);

Modified: trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -32,30 +32,30 @@
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Test;
+import org.teiid.client.DQP;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.util.ResultsReceiver;
 import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.socket.Message;
+import org.teiid.net.socket.SocketServerConnection;
+import org.teiid.net.socket.SocketServerInstance;
+import org.teiid.net.socket.SocketServerInstanceFactory;
+import org.teiid.net.socket.SocketServerInstanceImpl;
+import org.teiid.net.socket.UrlServerDiscovery;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.api.exception.security.LogonException;
-import com.metamatrix.common.api.HostInfo;
-import com.metamatrix.common.api.MMURL;
-import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.api.ResultsReceiver;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerConnection;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerInstance;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerInstanceFactory;
-import com.metamatrix.common.comm.platform.socket.client.SocketServerInstanceImpl;
-import com.metamatrix.common.comm.platform.socket.client.UrlServerDiscovery;
 import com.metamatrix.common.util.crypto.Cryptor;
 import com.metamatrix.common.util.crypto.NullCryptor;
-import com.metamatrix.dqp.client.DQP;
-import com.metamatrix.dqp.client.ResultsFuture;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.LogonResult;
-import com.metamatrix.platform.security.api.SessionToken;
 
 public class TestSocketRemoting {
 	
@@ -213,7 +213,7 @@
 				return serverInstance;
 			}
 			
-		}, false, new UrlServerDiscovery(new MMURL("foo", 1, false)), new Properties(), null); //$NON-NLS-1$
+		}, false, new UrlServerDiscovery(new TeiidURL("foo", 1, false)), new Properties(), null); //$NON-NLS-1$
 		return connection;
 	}
 	

Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStaticMetadataProvider.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStaticMetadataProvider.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestStaticMetadataProvider.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -27,10 +27,10 @@
 
 import junit.framework.TestCase;
 
+import org.teiid.client.metadata.ResultsMetadataConstants;
 import org.teiid.dqp.internal.process.MetaDataProcessor;
 import org.teiid.jdbc.MetadataProvider;
 
-import com.metamatrix.dqp.metadata.ResultsMetadataConstants;
 
 /**
  */

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/StandaloneGlobalTransaction.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -8,11 +8,11 @@
 
 import javax.transaction.xa.XAResource;
 
+import org.teiid.client.xa.XidImpl;
 import org.teiid.test.framework.TransactionContainer;
 import org.teiid.test.framework.TransactionQueryTestCase;
 import org.teiid.test.framework.exception.TransactionRuntimeException;
 
-import com.metamatrix.common.xa.XidImpl;
 
 public class StandaloneGlobalTransaction extends TransactionContainer {
 	private static Random RANDOM = new Random();

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java	2010-03-19 19:17:01 UTC (rev 1980)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/transaction/XATransaction.java	2010-03-20 03:06:44 UTC (rev 1981)
@@ -8,11 +8,11 @@
 
 import javax.transaction.xa.XAResource;
 
+import org.teiid.client.xa.XidImpl;
 import org.teiid.test.framework.TransactionContainer;
 import org.teiid.test.framework.TransactionQueryTestCase;
 import org.teiid.test.framework.exception.TransactionRuntimeException;
 
-import com.metamatrix.common.xa.XidImpl;
 
 public class XATransaction extends TransactionContainer {
 	private static Random RANDOM = new Random();



More information about the teiid-commits mailing list