teiid SVN: r2484 - branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-23 13:53:50 -0400 (Mon, 23 Aug 2010)
New Revision: 2484
Modified:
branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
Log:
TEIID-1211 updating the load balancing doc
Modified: branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-23 17:44:19 UTC (rev 2483)
+++ branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-23 17:53:50 UTC (rev 2484)
@@ -532,6 +532,8 @@
The default setting is to maintain 16 connections (see <code>org.teiid.sockets.maxCachedInstances</code> in the client jar's teiid-client-settings.properties file.
If you're client is connecting to large numbers of Teiid instances and you're using post connection time load balancing, then consider increasing the number of cached instances.
You may either set an analogous system property or create another version of teiid-client-settings.properties file and place it into the classpath ahead of the client jar.</para>
+ <note><para>Session level temporary tables, currently running transactions, session level cache entries, and PreparedPlans for a given session will not be available on other cluster members.
+ Therefore, it is recommended that post connection time load balancing is only used when the logical connection could have been closed, but the actual connection is reused (the typical connection pool pattern).</para></note>
</section>
<section id="advancedconfig">
<title>Advanced Configuration</title>
14 years, 4 months
teiid SVN: r2483 - in branches/7.1.x: client/src/main/java/org/teiid/jdbc and 8 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-23 13:44:19 -0400 (Mon, 23 Aug 2010)
New Revision: 2483
Added:
branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
Removed:
branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/entitlements.xml
Modified:
branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
branches/7.1.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java
branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
branches/7.1.x/documentation/reference/src/main/docbook/en-US/Reference.xml
branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
Log:
TEIID-1211 refining load balancing support utilizing a set statement.
Modified: branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html 2010-08-23 17:44:19 UTC (rev 2483)
@@ -26,31 +26,7 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
- <LI><B>ODBC Support</B> - Support for ODBC access is now available through PostgreSQL ODBC driver clients. See the Client Developer's Guide for more on how
- to use Teiid's ODBC access.
- <LI><B>Native Materialized Tables</B> - views marked as materialized without a target table will be materialized internally by Teiid. Materialized view tables will
- be indexed by the primary key of the view if present and can be controlled through the expanded cache hint.
- There are also new system procedures refreshMatView and refreshMatViewRow to refresh internal materialized view contents.
- <LI><B>Expanded Cache Hint</B> - The cache hint can now specify pref_mem to indicate that data should prefer to be held in memory, ttl to indicate the time-to-live,
- and updatable to indicate that a materialized view with a primary key can be updated by row with the refreshMatViewRow system procedure.
- <LI><B>SQL Support</B>
- <ul>
- <li>Added NULLS FIST/LAST handling - including pushdown support.
- <li>Added enhanced numeric stat aggregate functions STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP, with pushdown and aggregate decomposition.
- <li>Added support for the boolean aggregate functions ANY, SOME, EVERY.
- <li>Added support for using boolean value expression as both criteria and expressions, e.g. "... where boolean_value" or "select x = 1 as boolean_value ...".
- <li>Changed named procedure syntax to accept param=>value, rather than param=value.
- <li>Added PRIMARY KEY and the associated index support to temp tables.
- </ul>
- <LI>
- <LI><B>Parallel Source Queries</B> - reestablished parallel execution of source queries within a query plan along with a prioritized work system to help prevent resource contention.
- <LI><B>Improved Insert Support</B> - Cross source inserts using a query expression can defer to the source to perform the entire insert atomically with source controlled batching.
- See maxPreparedInsertBatchSize on any JDBC translator supporting the InsertWithIterator capability.
- <LI><B>SHOW Statement</B> - added client handling for the SHOW statement to retrieve query plan information and see parameter values.
- <LI><B>User Identity</B> - Teiid DataSources in JBossAS connecting to a local Teiid instance can preserve the thread's user identity, rather than requiring
- a new authentication. See TeiidDataSource.setPassthroughAuthentication.
- <LI><B>VDB Versioning</B> - The VDB version may be determined by the deployed file name. The expected pattern is <VDB Name>.<Version>.vdb. See the Admin Guide
- for more on how to use VDB versioning.
+ <LI><B>Refined Load Balancing and Fail Over</B> - clients can use use the statement "SET NEWINSTANCE TRUE" to allow their connection to select a new server instance. See the Client Developer's Guide for more information.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -155,174 +131,7 @@
<h2><a name="Details">Detailed Release Notes</a></h2>
Detailed Release Notes - Teiid - Version ${project.version}
-<h2> Bug
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-76'>TEIID-76</a>] - Attempting to execute a procedure from MM to MM returns error "<procedure>() does not exist"
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-108'>TEIID-108</a>] - xsd type conversion should be consistent
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1107'>TEIID-1107</a>] - Add support for raising criteria if it has been pushed too far
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1140'>TEIID-1140</a>] - Unnecessary jars in the Teiid deployment
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1141'>TEIID-1141</a>] - getCatalogs call on DatabaseMetadata is returning no rows
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1144'>TEIID-1144</a>] - PostgreSQL (simple capabilities) returning an unexpected number of rows
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1145'>TEIID-1145</a>] - Unable to deploy VDB with virtual BQT2 model
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1147'>TEIID-1147</a>] - Sybase concat function handling
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1149'>TEIID-1149</a>] - Importing tables from a deployed VDB does not import columns
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1152'>TEIID-1152</a>] - Jopr Plugin Needs to Handle Secure ProfileService Connection
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1153'>TEIID-1153</a>] - Turned of ProfileService authenticatiion and it caused an NPE in the Teiid RHQ Plugin
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1157'>TEIID-1157</a>] - NPE with texttable planning
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1166'>TEIID-1166</a>] - Receiving ASSERTION FAILED: expected reference to be not null from SQL query with sub-select
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1169'>TEIID-1169</a>] - VDBs are not being displayed in Jopr
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1172'>TEIID-1172</a>] - Loopback translator fails to be invoked when a property is set
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1178'>TEIID-1178</a>] - Jopr VDB loading error when Data Source is not available
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1180'>TEIID-1180</a>] - the deprecated input group qualifier should be replaced with inputs
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1181'>TEIID-1181</a>] - Teiid Pushdown queries producing unexpected results (Sybase 12.5)
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1182'>TEIID-1182</a>] - UDF model is not being loaded if the file is not placed in the root location of VDB
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1183'>TEIID-1183</a>] - Cannot create a SalesForce datasource throught the admin API.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1185'>TEIID-1185</a>] - Shutting down JBoss AS server causes NPE in ClusterableCacheFactory
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1186'>TEIID-1186</a>] - broken internal link in Teiid Reference Documentation
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1188'>TEIID-1188</a>] - Error while reading the template properties for LDAP
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1192'>TEIID-1192</a>] - JDBC driver doesn't accept underscores _ in server names
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1200'>TEIID-1200</a>] - Non-parsable SQL in transformation provides no help to user - NPE in stack trace
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1201'>TEIID-1201</a>] - Property 'Url' with value 'vfsfile:/home/pnittel/Teiid71/jboss-5.1.0.GA/server/default/deploy/EyeTuneZ-vdb.xml' is not a valid URL
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1203'>TEIID-1203</a>] - "connector-ws" is not visible as one of the avaialble connectors
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1206'>TEIID-1206</a>] - NPE during the JDBC Metadata read when "resultSetCacheMode=true" turned on
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1208'>TEIID-1208</a>] - VDB "getStatus" through Admin API always returning "INACTIVE"
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1216'>TEIID-1216</a>] - Cannot pass xml result from one select as critera to another select
-</li>
-</ul>
-
-<h2> Feature Request
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-168'>TEIID-168</a>] - Refine caching behavior
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-250'>TEIID-250</a>] - Enable Axis data compression in SFDC Connector, per SFDC API guidelines
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-715'>TEIID-715</a>] - Add support for nulls first/last
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-829'>TEIID-829</a>] - revamp code table caching
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-860'>TEIID-860</a>] - Add odbc support
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-886'>TEIID-886</a>] - Request for more statistical functions in Teiid
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-892'>TEIID-892</a>] - Add a capability to control bulk insert batch size
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-908'>TEIID-908</a>] - Enable access to the query plan without reference to Teiid classes.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-968'>TEIID-968</a>] - Timestamp literals with fractional seconds result in source query execution performance when being compared to less percise time types
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1006'>TEIID-1006</a>] - Dynamic vdb metadata load enhancements
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1028'>TEIID-1028</a>] - Make Materialized Views first class objects in the system
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1048'>TEIID-1048</a>] - Embedded Connection should support the pass though authentication
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1151'>TEIID-1151</a>] - Re-enable multi-threaded source query execution
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1155'>TEIID-1155</a>] - Allow boolean value expressions to be used as criteria or expressions
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1167'>TEIID-1167</a>] - Add support for primary key handling in temp tables
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1177'>TEIID-1177</a>] - Allow for implicit temp table definition with just a query, omitting the columns
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1179'>TEIID-1179</a>] - Add a CommandContext interface to the teiid api
-</li>
-</ul>
-<h2> Patch
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1184'>TEIID-1184</a>] - Patch to refactor numbered <sect> tags in documentation to <section>
-</li>
-</ul>
-
-<h2> Quality Risk
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-954'>TEIID-954</a>] - Need method to control max amount of buffer disk space
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1150'>TEIID-1150</a>] - Introduce alternative named parameter syntax
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1154'>TEIID-1154</a>] - Remove JDOM
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1187'>TEIID-1187</a>] - Refine vdb version logic
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1190'>TEIID-1190</a>] - Procedure logic clean up
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1199'>TEIID-1199</a>] - Use consistent names for security concepts
-</li>
-</ul>
-
-<h2> Task
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-749'>TEIID-749</a>] - Replace the TestNoArgConnector Test with an integration test.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-882'>TEIID-882</a>] - Look into using javax.xml.xpath in the XML-Relational connectors.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-996'>TEIID-996</a>] - Administration of the granular entitlements to data elements should be supported using the management console.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1055'>TEIID-1055</a>] - Secure profile service access
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1142'>TEIID-1142</a>] - Teiid should work with EAP 5.1
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1143'>TEIID-1143</a>] - Remove the version number from the RAR files, to promote easy migration between the versions
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1160'>TEIID-1160</a>] - Add Support for Discovery of Dynamic VDBs in Teiid Jopr Plugin
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1165'>TEIID-1165</a>] - Upgrade to Netty 3.2.0 final
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1173'>TEIID-1173</a>] - Provide a facility to create "empty" VDBs for preview purpose
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1174'>TEIID-1174</a>] - Allow '-' character in VDB names.
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1194'>TEIID-1194</a>] - Document the recommended approach to using Teiid entitlements
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1207'>TEIID-1207</a>] - Fix Yahoo Translator to work with "Dynamic Portfoilo" example
-</li>
-</ul>
-
-<h2> Sub-task
-</h2>
-<ul>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-958'>TEIID-958</a>] - Provide ability to monitor buffer manager disk space usage and free space
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1189'>TEIID-1189</a>] - JOPR support for multiple versions
-</li>
-<li>[<a href='https://jira.jboss.org/browse/TEIID-1198'>TEIID-1198</a>] - Allow specifying the VDB version as part of the VDB name in the JDBC URL connection string.
-</li>
-</ul>
-
<h2><a name="Documentation">Documentation and Help</a></h2>
The <a href="http://www.jboss.org/teiid/">Teiid community project</a> is hosted on jboss.org.
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -900,10 +900,7 @@
logger.log(Level.WARNING, JDBCPlugin.Util.getString("MMXAConnection.rolling_back_error"), e); //$NON-NLS-1$
}
- //perform load balancing
- if (this.serverConn instanceof SocketServerConnection) {
- ((SocketServerConnection)this.serverConn).selectNewServerInstance();
- }
+ this.serverConn.cleanUp();
}
public boolean isSameProcess(ConnectionImpl conn) throws CommunicationException {
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -100,5 +100,7 @@
*/
public static final String NOEXEC = "NOEXEC"; //$NON-NLS-1$
+ public static final String NEWINSTANCE = "NEWINSTANCE"; //$NON-NLS-1$
+
}
\ No newline at end of file
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -395,7 +395,11 @@
}
String key = match.group(1);
String value = match.group(2);
- JDBCURL.addNormalizedProperty(key, value, this.driverConnection.getExecutionProperties());
+ if (ExecutionProperties.NEWINSTANCE.equalsIgnoreCase(key) && Boolean.valueOf(value)) {
+ this.getMMConnection().getServerConnection().cleanUp();
+ } else {
+ JDBCURL.addNormalizedProperty(key, value, this.driverConnection.getExecutionProperties());
+ }
this.updateCounts = new int[] {0};
return;
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -32,6 +32,10 @@
/**
* Defines the hostname/port or {@link InetAddress} to connect to a host.
+ *
+ * Similar to an {@link InetSocketAddress} except that it can be constructed
+ * fully resolved, with an {@link InetAddress} and a hostname.
+ *
* @since 4.2
*/
public class HostInfo {
@@ -41,12 +45,23 @@
private InetAddress inetAddress;
private boolean ssl;
+ /**
+ * Construct a fully resolved {@link HostInfo}.
+ * @param hostName
+ * @param addr
+ */
public HostInfo(String hostName, InetSocketAddress addr) {
this.hostName = hostName;
this.portNumber = addr.getPort();
this.inetAddress = addr.getAddress();
}
+ /**
+ * Construct a {@link HostInfo} that can resolve each
+ * time an {@link InetAddress} is asked for.
+ * @param host
+ * @param port
+ */
public HostInfo (String host, int port) {
ArgCheck.isNotNull(host);
this.hostName = host.toLowerCase();
@@ -101,6 +116,9 @@
if (inetAddress != null && hostInfo.inetAddress != null) {
return inetAddress.equals(hostInfo.inetAddress);
}
+ if (ssl != hostInfo.ssl) {
+ return false;
+ }
return hostName.equals(hostInfo.getHostName());
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -38,4 +38,6 @@
boolean isSameInstance(ServerConnection conn) throws CommunicationException;
+ void cleanUp();
+
}
\ No newline at end of file
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -44,7 +44,8 @@
void init(TeiidURL url, Properties p);
/**
- * Get the currently known hosts.
+ * Get the currently known hosts. Will be called prior to connecting and after
+ * authentication for each connection.
* @param result, the current {@link LogonResult} - may be null if unauthenticated
* @param instance, the currently connected instance - may be null if not connected
* @return
@@ -67,5 +68,14 @@
* Shutdown this {@link ServerDiscovery}
*/
void shutdown();
+
+ /**
+ * Select the next instance to try. The entry should be removed from the list
+ * when no more attempts are desired.
+ * and not return null.
+ * @param hosts
+ * @return a non-null HostInfo to try
+ */
+ HostInfo selectNextInstance(List<HostInfo> hosts);
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashSet;
@@ -114,7 +113,7 @@
List<HostInfo> hostCopy = new ArrayList<HostInfo>(hostKeys);
int knownHosts = hostKeys.size();
while (hostKeys.size() > 0) {
- HostInfo hostInfo = hostKeys.remove((int) (Math.random() * hostKeys.size()));
+ HostInfo hostInfo = this.serverDiscovery.selectNextInstance(hostKeys);
Exception ex = null;
try {
@@ -165,9 +164,6 @@
private ILogon connect(HostInfo hostInfo) throws CommunicationException,
IOException {
- if (!hostInfo.isResolved()) {
- hostInfo = new HostInfo(hostInfo.getHostName(), new InetSocketAddress(hostInfo.getInetAddress(), hostInfo.getPortNumber()));
- }
hostInfo.setSsl(secure);
this.serverInstance = connectionFactory.getServerInstance(hostInfo);
this.logonResult = logonResults.get(hostInfo);
@@ -305,7 +301,7 @@
}
}
- public void selectNewServerInstance() {
+ public void cleanUp() {
closeServerInstance();
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -31,7 +31,8 @@
/**
- * Simple URL discovery strategy
+ * Simple URL discovery strategy with a random load balancing policy
+ * TOOD: add black listing support
*/
public class UrlServerDiscovery implements ServerDiscovery {
@@ -70,4 +71,9 @@
}
+ @Override
+ public HostInfo selectNextInstance(List<HostInfo> hosts) {
+ return hosts.remove((int) (Math.random() * hosts.size()));
+ }
+
}
Modified: branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
===================================================================
--- branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -64,7 +64,7 @@
processes.add(p2);
Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes); //$NON-NLS-1$
Mockito.stub(instance.getService(Admin.class)).toReturn(serverAdmin);
- Mockito.stub(instance.getHostInfo().getHostName()).toReturn("foo"); //$NON-NLS-1$
+ Mockito.stub(instance.getHostInfo()).toReturn(knownHost);
discovery.connectionSuccessful(knownHost);
List<HostInfo> knownHosts = discovery.getKnownHosts(new LogonResult(), instance);
Modified: branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-23 17:44:19 UTC (rev 2483)
@@ -278,15 +278,15 @@
</entry>
<entry>Server where the Teiid runtime installed</entry>
</row>
- <!-- <row>
+ <row>
<entry>
<code>AlternateServers</code>
</entry>
<entry>
<code>String</code>
</entry>
- <entry>Optional , delimited list of host:port entries. See the <link linkend="multiple_hosts">multiple hosts</link> section for more information.</entry>
- </row> -->
+ <entry>Optional delimited list of host:port entries. See the <link linkend="multiple_hosts">multiple hosts</link> section for more information.</entry>
+ </row>
<row>
<entry>
<code>AdditionalProperties</code>
@@ -488,27 +488,61 @@
<section id="multiple_hosts">
<title>Using Multiple Hosts</title>
- <para>A group of Teiid Servers in the same AS cluster may be connected using connection time failover and load-balancing.
- To enable this feature the client needs to specify multiple host name and port number combinations on the URL connection string.
- The client will randomly pick any one the Teiid server from the list and will have session established with that server.
- If that server cannot be contacted, then a connection will be attempted to each of the remaining servers in random order.</para>
-
- <!-- If the "autoFailover" connection property is set to "true", a failure with the connected server will cause the client to automatically failover
- to other available servers. Even if autoFailover is not set, when using a managed DataSource based connection, the connection will randomly select a new server instance when it is returned to the pool.</para>
- -->
- <example><title>Example URL connection string</title><programlisting><![CDATA[jdbc:teiid:<vdb-name>@mm://host1:31000, host1:31001, host2:31000;version=2]]></programlisting></example>
-
- <!-- <para>Currently when the fail over happens, the user is re-authenticated with the new server. The clustering
- feature coming up in the Teiid 7.1 release will define how the transparent session fail over will occur with out the
- re-authentication.</para>
-
- <para>You can also use this feature to distribute the query load among various avaialble Teiid Servers available.
- Load balancing happens automatically, when you are using a data source along with connection pooling. Each time a connection is
- grabbed from the pool, it will randomly select a Teiid Server to distribute the load. Note, that load balacing feature
- is not avaialble if you are using Teiid Driver to make your connection.</para>-->
-
- <para>If you are using DataSource to connect to Teiid Server, use "AlternateServers" property/method to define the failover servers.
- Check out the Javadoc on the format of the string.</para>
+ <para>A group of Teiid Servers in the same JBoss AS cluster may be connected using failover and load-balancing features.
+ To enable theses features in their simplest form, the client needs to specify multiple host name and port number combinations on the URL connection string.
+ <example><title>Example URL connection string</title><programlisting><![CDATA[jdbc:teiid:<vdb-name>@mm://host1:31000,host1:31001,host2:31000;version=2]]></programlisting></example>
+ </para>
+ <para>If you are using a DataSource to connect to Teiid Server, use the "AlternateServers" property/method to define the failover servers. The format is also a comma separated list of host:port combinations.</para>
+ <para>The client will randomly pick one the Teiid server from the list and establish a session with that server.
+ If that server cannot be contacted, then a connection will be attempted to each of the remaining servers in random order.
+ This allows for both connection time fail-over and random server selection load balancing.
+ </para>
+ <section id="failover">
+ <title>Fail Over</title>
+ <para>Post connection fail over will be sued if you're using an admin connection (such as what is used by AdminShell) or if the autoFailover connection property is set to true.
+ Post connection failover works by sending a ping, at most every second, to test the connection prior to use. If the ping fails, a new instance will be selected prior to the operation being attempted.
+ This is not true "transparent application failover" as the client will not restart the transaction/query/recreate session scoped temp tables, etc. So this feature should be used with caution by non-admin connections.</para>
+ </section>
+ <section id="loadbalancing">
+ <title>Load Balancing</title>
+ <para>Post connection load balancing can be utilized in one of two ways. First if you are using <code>TeiidDataSource</code> and the Connections returned by
+ Teiid <code>PooledConnections</code> have their <code>close</code> method called, then a new server instance will be selected automatically.
+ However when using driver based connections or even when using <code>TeiidDataSource</code> in a connection pool (such as JBoss AS), the automatic load balancing will not happen.
+ Second you can explicitly trigger load balancing through the use of the set statement: <programlisting>SET NEWINSTANCE TRUE</programlisting>
+ Typically you will not need want to issue this statement manually, but instead use it as the connection test query on your DataSource configuration.
+ <example>
+ <title>JBoss AS DataSource With Post Connection Load Balancing</title>
+ <programlisting><![CDATA[<datasources>
+ <local-tx-datasource>
+ <jndi-name>TEIID-DS</jndi-name>
+ <connection-url>jdbc:metamatrix:myVDB@mm://localhost:31000,mm://localhost:32000</connection-url>
+ <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
+ <user-name>admin</user-name>
+ <password>teiid</password>
+
+ <!-- pool and other JBoss datasource properties -->
+ <check-valid-connection-sql>SET NEWINSTANCE TRUE</check-valid-connection-sql>
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>10</max-pool-size>
+ </local-tx-datasource>
+</datasources>]]></programlisting>
+</example>
+ </para>
+ <para>Teiid by default maintians a pool of extra socket connections that are reused. For load balancing, this reduces the potential cost of switching a connection to another server instance.
+ The default setting is to maintain 16 connections (see <code>org.teiid.sockets.maxCachedInstances</code> in the client jar's teiid-client-settings.properties file.
+ If you're client is connecting to large numbers of Teiid instances and you're using post connection time load balancing, then consider increasing the number of cached instances.
+ You may either set an analogous system property or create another version of teiid-client-settings.properties file and place it into the classpath ahead of the client jar.</para>
+ </section>
+ <section id="advancedconfig">
+ <title>Advanced Configuration</title>
+ <para>Server discovery, load balancing, fail over, retry, retry delay, etc. may be customize if the default policy is not sufficient.
+ See the <code>org.teiid.net.socket.ServerDiscovery</code> interface and default implementaion <code>org.teiid.net.socket.UrlServerDiscovery</code> for how to start with your customization.
+ The <code>UrlServerDiscovery</code> implemenation provides the following: discovery of servers from the URL hosts (DataSource server/alternativeServers), random selection for load balancing and failover, 1 connection attempt per host, no biasing, black listing, or other advanced features.
+ Typically you'll want to extend the <code>UrlServerDiscovery</code> so that it can be used as the fallback strategy and to only implement the necessary changed methods.
+ It's important to consider that 1 <code>ServerDiscovery</code> instance will be created for each connection. Any sharing of information between instances should be done through static state or some other shared lookup.
+ </para>
+ <para>Your customized server discovery class will then need to be referenced by the discoveryStategy connection/DataSource property by its full class name.</para>
+ </section>
</section>
</chapter>
\ No newline at end of file
Modified: branches/7.1.x/documentation/reference/src/main/docbook/en-US/Reference.xml
===================================================================
--- branches/7.1.x/documentation/reference/src/main/docbook/en-US/Reference.xml 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/Reference.xml 2010-08-23 17:44:19 UTC (rev 2483)
@@ -53,7 +53,7 @@
<xi:include href="content/scalar_functions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/procedures.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/transaction_support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="content/entitlements.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/dataroles.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/system_schema.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/translators.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/federated_planning.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Copied: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml (from rev 2478, branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/entitlements.xml)
===================================================================
--- branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml (rev 0)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml 2010-08-23 17:44:19 UTC (rev 2483)
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter id="dataroles">
+ <title>Data Roles</title>
+ <para>Data roles, also called entitlements, are sets of permissions that are defined
+ per VDB that dictate data access (create, read, update, delete). The use of data roles is controlled system wide with the property in
+ <code><jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml</code> file
+ in bean configuration section of <code>RuntimeEngineDeployer</code> with property <code>useDataRoles</code>.</para>
+
+ <para>Once data roles are enabled, the access permissions defined in a VDB will be enforced by the Teiid Server.
+ </para>
+
+ <warning><para>Teiid uses a deny by default permission system, so all VDBs deployed to the server will need roles granting access with this feature enabled.</para></warning>
+
+ <section>
+ <title>Permissions</title>
+
+ <para>CREATE, READ, UPDATE, DELETE (CRUD) permissions can be set for any resource path in a VDB.
+ A resource path can be as specific as the fully qualified name of a column or as general a top level model (schema) name.
+ Permissions granted to a particular path apply to it and any resource paths that share the same partial name.
+ For example, granting read to "model" will also grant read to "model.table", "model.table.column", etc.
+ Allowing or denying a particular action is determined by searching for permissions from the most to least specific resource paths.
+ The first permission found with a specific allow or deny will be used.
+ Thus it is possible to set very general permissions at high-level resource path names and to override only as necessary at more specific resource paths.
+ </para>
+
+ <para>Permission grants are only needed for resources that are visible.
+ All non-visible, typically physical, models in a VDB are automatically
+ inaccessible by user level requests. Permissions are also only applied
+ to the columns and tables in the user query - not to every resource
+ accessed transitively through views and procedures.
+ It is important therefore to ensure that permission grants are applied
+ consistently across visible models that access the same resources.
+ </para>
+
+ <orderedlist>
+ <para>To process a <emphasis>SELECT</emphasis> statement or a stored procedure execution, the user account requires the following access rights:</para>
+ <listitem> <para><emphasis>READ</emphasis> - on the Table(s) being accessed or the procedure being called.</para></listitem>
+ <listitem> <para><emphasis>READ</emphasis> - on every column referenced.</para></listitem>
+ </orderedlist>
+
+ <orderedlist>
+ <para>To process an <emphasis>INSERT</emphasis> statement, the user account requires the following access rights:</para>
+ <listitem> <para><emphasis>CREATE</emphasis> - on the Table being inserted into.</para></listitem>
+ <listitem> <para><emphasis>CREATE</emphasis> - on every column being inserted on that Table.</para></listitem>
+ </orderedlist>
+
+ <orderedlist>
+ <para>To process an <emphasis>UPDATE</emphasis> statement, the user account requires the following access rights:</para>
+ <listitem> <para><emphasis>UPDATE</emphasis> - on the Table being updated.</para></listitem>
+ <listitem> <para><emphasis>UPDATE</emphasis> - on every column being updated on that Table.</para></listitem>
+ <listitem> <para><emphasis>READ</emphasis> - on every column referenced in the criteria.</para></listitem>
+ </orderedlist>
+
+ <orderedlist>
+ <para>To process a <emphasis>DELETE</emphasis> statement, the user account requires the following access rights:</para>
+ <listitem> <para><emphasis>DELETE</emphasis> - on the Table being deleted.</para></listitem>
+ <listitem> <para><emphasis>READ</emphasis> - on every column referenced in the criteria.</para></listitem>
+ </orderedlist>
+
+ <orderedlist>
+ <para>To process a <emphasis>EXEC</emphasis> statement, the user account requires the following access rights:</para>
+ <listitem> <para><emphasis>READ</emphasis> - on the Procedure being executed.</para></listitem>
+ </orderedlist>
+
+ </section>
+
+ <section>
+ <title>XML Definition</title>
+ <para>Data roles are defined inside the <code>vdb.xml</code> file (inside the .vdb Zip archive under META-INF/vdb.xml) if you used Designer.
+ This example will show a sample "vdb.xml" file with few simple data rules.</para>
+
+ <para>For example, if a VDB defines a table "TableA" in schema "modelName" with columns (column1, column2) - note that the column types do not matter. And we wish to define three roles "RoleA", "RoleB", "RoleC" with following permissions:
+ <orderedlist>
+ <listitem><para>RoleA has privileges to read, write access to TableA, but can not delete.</para></listitem>
+ <listitem><para>RoleB has no privileges that allow access to TableA</para></listitem>
+ <listitem><para>RoleC has privileges that only allow read access to TableA.column1</para></listitem>
+ </orderedlist>
+ </para>
+ <example><title>vdb.xml defining RoleA, RoleB, and RoleC</title>
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<vdb name="sample" version="1">
+
+ <model name="modelName">
+ <source name="source-name" translator-name="oracle" connection-jndi-name="java:myDS" />
+ </model>
+
+ <data-role name="RoleA">
+ <description>Allow all, except Delete</description>
+
+ <permission>
+ <resource-name>modelName.TableA</resource-name>
+ <allow-create>true</allow-create>
+ <allow-read>true</allow-read>
+ <allow-update>true</allow-update>
+ </permission>
+
+ <permission>
+ <resource-name>modelName.TableA.colum1</resource-name>
+ <allow-create>true</allow-create>
+ <allow-read>true</allow-read>
+ <allow-update>true</allow-update>
+ </permission>
+
+ <permission>
+ <resource-name>modelName.TableA.column2</resource-name>
+ <allow-create>true</allow-create>
+ <allow-read>true</allow-read>
+ <allow-update>true</allow-update>
+ </permission>
+
+ <mapped-role-name>role1</mapped-role-name>
+
+ </data-role>
+
+ <data-role name="RoleC">
+ <description>Allow read only</description>
+
+ <permission>
+ <resource-name>modelName.TableA</resource-name>
+ <allow-read>true</allow-read>
+ </permission>
+
+ <permission>
+ <resource-name>modelName.TableA.colum1</resource-name>
+ <allow-read>true</allow-read>
+ </permission>
+
+ <mapped-role-name>role2</mapped-role-name>
+ </data-role>
+</vdb>]]></programlisting>
+</example>
+ <para>The above XML defined two data roles, "RoleA" which allows everything except delete on the table, "RoleC" that
+ allows only read operation on the table. Since Teiid uses deny by default, there is no explicit data-role entry needed for "RoleB". The "mapped-role-name" defines the JAAS "role" to whom these policies are applicable.</para>
+
+ <para>For assigning roles to your users in the JBoss AS,
+ check out the instructions for the selected Login Module. Check the "Admin Guide" for configuring Login Modules.</para>
+
+ <para>The "vdb.xml" file is checked against the schema file <code>vdb-deployer.xsd</code>, check the documents sections of the Teiid kit
+ to find a copy of the schema file.</para>
+
+ </section>
+
+</chapter>
\ No newline at end of file
Property changes on: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/dataroles.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/entitlements.xml
===================================================================
--- branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/entitlements.xml 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/entitlements.xml 2010-08-23 17:44:19 UTC (rev 2483)
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
-%CustomDTD;
-]>
-<chapter id="entitlements">
- <title>Data Roles</title>
- <para>Data roles, also called entitlements, are sets of permissions that are defined
- per VDB that dictate data access (create, read, update, delete). The use of data roles is controlled system wide with the property in
- <code><jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml</code> file
- in bean configuration section of <code>RuntimeEngineDeployer</code> with property <code>useDataRoles</code>.</para>
-
- <para>Once data roles are enabled, the access permissions defined in a VDB will be enforced by the Teiid Server.
- </para>
-
- <warning><para>Teiid uses a deny by default permission system, so all VDBs deployed to the server will need roles granting access with this feature enabled.</para></warning>
-
- <section>
- <title>Permissions</title>
-
- <para>CREATE, READ, UPDATE, DELETE (CRUD) permissions can be set for any resource path in a VDB.
- A resource path can be as specific as the fully qualified name of a column or as general a top level model (schema) name.
- Permissions granted to a particular path apply to it and any resource paths that share the same partial name.
- For example, granting read to "model" will also grant read to "model.table", "model.table.column", etc.
- Allowing or denying a particular action is determined by searching for permissions from the most to least specific resource paths.
- The first permission found with a specific allow or deny will be used.
- Thus it is possible to set very general permissions at high-level resource path names and to override only as necessary at more specific resource paths.
- </para>
-
- <para>Permission grants are only needed for resources that are visible.
- All non-visible, typically physical, models in a VDB are automatically
- inaccessible by user level requests. Permissions are also only applied
- to the columns and tables in the user query - not to every resource
- accessed transitively through views and procedures.
- It is important therefore to ensure that permission grants are applied
- consistently across visible models that access the same resources.
- </para>
-
- <orderedlist>
- <para>To process a <emphasis>SELECT</emphasis> statement or a stored procedure execution, the user account requires the following access rights:</para>
- <listitem> <para><emphasis>READ</emphasis> - on the Table(s) being accessed or the procedure being called.</para></listitem>
- <listitem> <para><emphasis>READ</emphasis> - on every column referenced.</para></listitem>
- </orderedlist>
-
- <orderedlist>
- <para>To process an <emphasis>INSERT</emphasis> statement, the user account requires the following access rights:</para>
- <listitem> <para><emphasis>CREATE</emphasis> - on the Table being inserted into.</para></listitem>
- <listitem> <para><emphasis>CREATE</emphasis> - on every column being inserted on that Table.</para></listitem>
- </orderedlist>
-
- <orderedlist>
- <para>To process an <emphasis>UPDATE</emphasis> statement, the user account requires the following access rights:</para>
- <listitem> <para><emphasis>UPDATE</emphasis> - on the Table being updated.</para></listitem>
- <listitem> <para><emphasis>UPDATE</emphasis> - on every column being updated on that Table.</para></listitem>
- <listitem> <para><emphasis>READ</emphasis> - on every column referenced in the criteria.</para></listitem>
- </orderedlist>
-
- <orderedlist>
- <para>To process a <emphasis>DELETE</emphasis> statement, the user account requires the following access rights:</para>
- <listitem> <para><emphasis>DELETE</emphasis> - on the Table being deleted.</para></listitem>
- <listitem> <para><emphasis>READ</emphasis> - on every column referenced in the criteria.</para></listitem>
- </orderedlist>
-
- <orderedlist>
- <para>To process a <emphasis>EXEC</emphasis> statement, the user account requires the following access rights:</para>
- <listitem> <para><emphasis>READ</emphasis> - on the Procedure being executed.</para></listitem>
- </orderedlist>
-
- </section>
-
- <section>
- <title>XML Definition</title>
- <para>Data roles are defined inside the <code>vdb.xml</code> file (inside the .vdb Zip archive under META-INF/vdb.xml) if you used Designer.
- This example will show a sample "vdb.xml" file with few simple data rules.</para>
-
- <para>For example, if a VDB defines a table "TableA" in schema "modelName" with columns (column1, column2) - note that the column types do not matter. And we wish to define three roles "RoleA", "RoleB", "RoleC" with following permissions:
- <orderedlist>
- <listitem><para>RoleA has privileges to read, write access to TableA, but can not delete.</para></listitem>
- <listitem><para>RoleB has no privileges that allow access to TableA</para></listitem>
- <listitem><para>RoleC has privileges that only allow read access to TableA.column1</para></listitem>
- </orderedlist>
- </para>
- <example><title>vdb.xml defining RoleA, RoleB, and RoleC</title>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<vdb name="sample" version="1">
-
- <model name="modelName">
- <source name="source-name" translator-name="oracle" connection-jndi-name="java:myDS" />
- </model>
-
- <data-role name="RoleA">
- <description>Allow all, except Delete</description>
-
- <permission>
- <resource-name>modelName.TableA</resource-name>
- <allow-create>true</allow-create>
- <allow-read>true</allow-read>
- <allow-update>true</allow-update>
- </permission>
-
- <permission>
- <resource-name>modelName.TableA.colum1</resource-name>
- <allow-create>true</allow-create>
- <allow-read>true</allow-read>
- <allow-update>true</allow-update>
- </permission>
-
- <permission>
- <resource-name>modelName.TableA.column2</resource-name>
- <allow-create>true</allow-create>
- <allow-read>true</allow-read>
- <allow-update>true</allow-update>
- </permission>
-
- <mapped-role-name>role1</mapped-role-name>
-
- </data-role>
-
- <data-role name="RoleC">
- <description>Allow read only</description>
-
- <permission>
- <resource-name>modelName.TableA</resource-name>
- <allow-read>true</allow-read>
- </permission>
-
- <permission>
- <resource-name>modelName.TableA.colum1</resource-name>
- <allow-read>true</allow-read>
- </permission>
-
- <mapped-role-name>role2</mapped-role-name>
- </data-role>
-</vdb>]]></programlisting>
-</example>
- <para>The above XML defined two data roles, "RoleA" which allows everything except delete on the table, "RoleC" that
- allows only read operation on the table. Since Teiid uses deny by default, there is no explicit data-role entry needed for "RoleB". The "mapped-role-name" defines the JAAS "role" to whom these policies are applicable.</para>
-
- <para>For assigning roles to your users in the JBoss AS,
- check out the instructions for the selected Login Module. Check the "Admin Guide" for configuring Login Modules.</para>
-
- <para>The "vdb.xml" file is checked against the schema file <code>vdb-deployer.xsd</code>, check the documents sections of the Teiid kit
- to find a copy of the schema file.</para>
-
- </section>
-
-</chapter>
\ No newline at end of file
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -38,7 +38,6 @@
import org.teiid.client.security.LogonException;
import org.teiid.client.security.LogonResult;
import org.teiid.client.util.ExceptionUtil;
-import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.dqp.internal.process.DQPWorkContext;
@@ -165,4 +164,9 @@
public boolean isSameInstance(ServerConnection conn) throws CommunicationException {
return (conn instanceof LocalServerConnection);
}
+
+ @Override
+ public void cleanUp() {
+
+ }
}
Modified: branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-08-20 22:18:46 UTC (rev 2482)
+++ branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-08-23 17:44:19 UTC (rev 2483)
@@ -35,11 +35,14 @@
import org.junit.Before;
import org.junit.Test;
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.common.buffer.BufferManagerFactory;
import org.teiid.core.ComponentNotFoundException;
+import org.teiid.core.TeiidComponentException;
import org.teiid.core.crypto.NullCryptor;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.dqp.service.SessionService;
@@ -155,6 +158,18 @@
throws LogonException, ComponentNotFoundException {
return new LogonResult(new SessionToken("dummy"), "x", 1, "z");
}
+
+ @Override
+ public ResultsFuture<?> ping() throws InvalidSessionException,
+ TeiidComponentException {
+ return ResultsFuture.NULL_FUTURE;
+ }
+
+ @Override
+ public void assertIdentity(SessionToken checkSession)
+ throws InvalidSessionException, TeiidComponentException {
+ return;
+ }
}, null);
server.registerClientService(FakeService.class, new TestSocketRemoting.FakeServiceImpl(), null);
@@ -206,4 +221,19 @@
helpEstablishConnection(true, config, p);
}
+ @Test public void testSelectNewInstance() throws Exception {
+ SSLConfiguration config = new SSLConfiguration();
+ Properties p = new Properties();
+ SocketServerConnection conn = helpEstablishConnection(false, config, p);
+ SocketListenerStats stats = listener.getStats();
+ assertEquals(2, stats.objectsRead); // handshake response, logon,
+ assertEquals(1, stats.sockets);
+ conn.cleanUp();
+ assertTrue(conn.isOpen(1000));
+ stats = listener.getStats();
+ assertEquals(5, stats.objectsRead); // ping (pool test), assert identity, ping (isOpen)
+ assertEquals(1, stats.sockets);
+ conn.close();
+ }
+
}
14 years, 4 months
teiid SVN: r2482 - in branches/7.1.x: client/src/main/java/org/teiid/client/security and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-20 18:18:46 -0400 (Fri, 20 Aug 2010)
New Revision: 2482
Modified:
branches/7.1.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java
branches/7.1.x/client/src/main/java/org/teiid/client/security/ILogon.java
branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
branches/7.1.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java
branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/Handshake.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java
branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/LogonImpl.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgFrontendProtocol.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketListener.java
branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
Log:
TEIID-1211 TEIID-1204 reimplementing loadbalancing and failover logic. this initial checkin mainly addresses failover
Modified: branches/7.1.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -27,11 +27,9 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Properties;
-import java.util.concurrent.ExecutionException;
import org.teiid.client.security.LogonException;
import org.teiid.client.util.ExceptionUtil;
-import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.net.CommunicationException;
@@ -51,42 +49,23 @@
private static final int DEFAULT_BOUNCE_WAIT = 2000;
- private final class ReconnectingProxy implements InvocationHandler {
+ private final class AdminProxy implements InvocationHandler {
private Admin target;
private ServerConnection registry;
private Properties p;
private boolean closed;
- public ReconnectingProxy(Properties p) throws ConnectionException, CommunicationException {
+ public AdminProxy(Properties p) throws ConnectionException, CommunicationException {
this.p = p;
this.registry = serverConnectionFactory.getConnection(p);
this.target = registry.getService(Admin.class);
}
- private synchronized Admin getTarget() throws AdminComponentException, CommunicationException {
+ private synchronized Admin getTarget() throws AdminComponentException {
if (closed) {
throw new AdminComponentException(NetPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
}
- if (target != null) {
- ResultsFuture<?> ping = registry.isOpen();
- if (ping != null) {
- try {
- ping.get();
- return target;
- } catch (InterruptedException e) {
- throw new CommunicationException(e);
- } catch (ExecutionException e) {
- //assume recoverable
- }
- }
- }
- try {
- registry = serverConnectionFactory.getConnection(p);
- } catch (ConnectionException e) {
- throw new AdminComponentException(e);
- }
- target = registry.getService(Admin.class);
return target;
}
@@ -97,7 +76,6 @@
close();
return null;
}
- Throwable t = null;
try {
return method.invoke(getTarget(), args);
} catch (InvocationTargetException e) {
@@ -109,10 +87,7 @@
}
}
throw e.getTargetException();
- } catch (CommunicationException e) {
- t = e;
}
- throw t;
}
public synchronized void close() {
@@ -231,7 +206,7 @@
p.setProperty(TeiidURL.CONNECTION.ADMIN, Boolean.TRUE.toString());
try {
- Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));
+ Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new AdminProxy(p));
return serverAdmin;
} catch (ConnectionException e) {
throw new AdminComponentException(e);
Modified: branches/7.1.x/client/src/main/java/org/teiid/client/security/ILogon.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/client/security/ILogon.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/client/security/ILogon.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -21,11 +21,13 @@
*/
package org.teiid.client.security;
+import java.util.Collection;
import java.util.Properties;
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.net.CommunicationException;
/**
@@ -33,7 +35,7 @@
*/
public interface ILogon {
LogonResult logon(Properties connectionProperties)
- throws LogonException, TeiidComponentException;
+ throws LogonException, TeiidComponentException, CommunicationException;
/**
* Ping the server to see if the client-server connection is alive.
@@ -41,8 +43,10 @@
* @throws ComponentNotFoundException if can't find the Session service.
*/
ResultsFuture<?> ping()
- throws InvalidSessionException, TeiidComponentException;
+ throws InvalidSessionException, TeiidComponentException, CommunicationException;
+ ResultsFuture<?> ping(Collection<String> sessions)
+ throws TeiidComponentException, CommunicationException;
/**
* Log off the specified session.
@@ -51,5 +55,5 @@
*/
ResultsFuture<?> logoff() throws InvalidSessionException, TeiidComponentException;
- void assertIdentity(SessionToken sessionId) throws InvalidSessionException, TeiidComponentException;
+ void assertIdentity(SessionToken sessionId) throws InvalidSessionException, TeiidComponentException, CommunicationException;
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -45,9 +45,6 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -878,20 +875,7 @@
}
public boolean isValid(int timeout) throws SQLException {
- ResultsFuture<?> future = this.getServerConnection().isOpen();
- if (future == null) {
- return false;
- }
- try {
- future.get(timeout, TimeUnit.SECONDS);
- return true;
- } catch (InterruptedException e) {
- return false;
- } catch (ExecutionException e) {
- return false;
- } catch (TimeoutException e) {
- return false;
- }
+ return this.getServerConnection().isOpen(timeout * 1000);
}
public void recycleConnection() {
@@ -918,7 +902,7 @@
//perform load balancing
if (this.serverConn instanceof SocketServerConnection) {
- ((SocketServerConnection)this.serverConn).selectNewServerInstance(this.getDQP());
+ ((SocketServerConnection)this.serverConn).selectNewServerInstance();
}
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -80,7 +80,7 @@
ex = ExceptionUtil.getExceptionOfType(e, CommunicationException.class);
if (ex instanceof SingleInstanceCommunicationException) {
ServerConnection sc = proxiedConnection.getServerConnection();
- if (sc.isOpen() != null) {
+ if (!sc.isOpen(ServerConnection.PING_INTERVAL)) {
ex = null;
}
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/HostInfo.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -23,6 +23,7 @@
package org.teiid.net;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import org.teiid.core.util.ArgCheck;
@@ -38,12 +39,12 @@
private String hostName;
private int portNumber = 0;
private InetAddress inetAddress;
-
- public InetAddress getInetAddress() throws UnknownHostException {
- if (inetAddress != null) {
- return inetAddress;
- }
- return InetAddress.getByName(this.hostName);
+ private boolean ssl;
+
+ public HostInfo(String hostName, InetSocketAddress addr) {
+ this.hostName = hostName;
+ this.portNumber = addr.getPort();
+ this.inetAddress = addr.getAddress();
}
public HostInfo (String host, int port) {
@@ -61,6 +62,13 @@
}
}
+ public InetAddress getInetAddress() throws UnknownHostException {
+ if (inetAddress != null) {
+ return inetAddress;
+ }
+ return InetAddress.getByName(this.hostName);
+ }
+
public String getHostName() {
return hostName;
}
@@ -87,7 +95,13 @@
return false;
}
HostInfo hostInfo = (HostInfo) obj;
- return hostName.equals(hostInfo.getHostName()) && portNumber == hostInfo.getPortNumber();
+ if (portNumber != hostInfo.getPortNumber()) {
+ return false;
+ }
+ if (inetAddress != null && hostInfo.inetAddress != null) {
+ return inetAddress.equals(hostInfo.inetAddress);
+ }
+ return hostName.equals(hostInfo.getHostName());
}
/**
@@ -98,5 +112,17 @@
int hc = HashCodeUtil.hashCode(0, hostName);
return HashCodeUtil.hashCode(hc, portNumber);
}
+
+ public boolean isResolved() {
+ return this.inetAddress != null;
+ }
+
+ public boolean isSsl() {
+ return ssl;
+ }
+
+ public void setSsl(boolean ssl) {
+ this.ssl = ssl;
+ }
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -23,7 +23,6 @@
package org.teiid.net;
import org.teiid.client.security.LogonResult;
-import org.teiid.client.util.ResultsFuture;
public interface ServerConnection {
@@ -33,7 +32,7 @@
void close();
- ResultsFuture<?> isOpen();
+ boolean isOpen(long msToTest);
LogonResult getLogonResult();
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/AdminApiServerDiscovery.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -82,7 +82,7 @@
&& (info.lastDiscoveryTime < System.currentTimeMillis() - DISCOVERY_TIMEOUT || info.knownHosts.isEmpty())) {
Admin serverAdmin = instance.getService(Admin.class);
try {
- Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
+ Collection<ProcessObject> processes = serverAdmin.getProcesses("*"); //$NON-NLS-1$
info.knownHosts.clear();
for (ProcessObject processObject : processes) {
if (!processObject.isEnabled() || !processObject.isRunning()) {
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/Handshake.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/Handshake.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/Handshake.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -50,8 +50,8 @@
/**
* @param version The version to set.
*/
- public void setVersion(String version) {
- this.version = version;
+ public void setVersion() {
+ this.version = ApplicationInfo.getInstance().getMajorReleaseNumber();
}
/**
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -26,22 +26,18 @@
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.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ConcurrentHashMap;
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;
@@ -52,6 +48,7 @@
import org.teiid.client.util.ExceptionUtil;
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
import org.teiid.net.HostInfo;
@@ -66,8 +63,7 @@
*/
public class SocketServerConnection implements ServerConnection {
- private static final int RETRY_COUNT = 3;
-
+ private static final int FAILOVER_PING_INTERVAL = 1000;
private SocketServerInstanceFactory connectionFactory;
private ServerDiscovery serverDiscovery;
private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
@@ -76,72 +72,44 @@
private Properties connProps;
private SocketServerInstance serverInstance;
- private volatile LogonResult logonResult;
+ private LogonResult logonResult;
+ private Map<HostInfo, LogonResult> logonResults = new ConcurrentHashMap<HostInfo, LogonResult>();
private ILogon logon;
- private Timer pingTimer;
private boolean closed;
private boolean failOver;
+ private long lastPing = System.currentTimeMillis();
+ private int pingFailOverInterval = FAILOVER_PING_INTERVAL;
public SocketServerConnection(
SocketServerInstanceFactory connectionFactory, boolean secure,
- ServerDiscovery serverDiscovery, Properties connProps,
- Timer pingTimer) throws CommunicationException, ConnectionException {
+ ServerDiscovery serverDiscovery, Properties connProps) throws CommunicationException, ConnectionException {
this.connectionFactory = connectionFactory;
this.serverDiscovery = serverDiscovery;
this.connProps = connProps;
this.secure = secure;
+ //ILogon that is allowed to failover
this.logon = this.getService(ILogon.class);
this.failOver = Boolean.valueOf(connProps.getProperty(TeiidURL.CONNECTION.AUTO_FAILOVER)).booleanValue();
-
- authenticate();
-
- this.pingTimer = pingTimer;
- schedulePing();
+ this.failOver |= Boolean.valueOf(connProps.getProperty(TeiidURL.CONNECTION.ADMIN)).booleanValue();
+ selectServerInstance();
}
-
- private void schedulePing() {
- if (this.pingTimer != null) {
- this.pingTimer.schedule(new TimerTask() {
-
- private ResultsFuture<?> ping;
-
- @Override
- public void run() {
- if (ping == null) {
- ping = isOpen();
- }
- if (ping != null) {
- try {
- ping.get(1, TimeUnit.SECONDS);
- ping = null;
- return;
- } catch (TimeoutException e) {
- return;
- } catch (Throwable e) {
- handlePingError(e);
- }
- }
- 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.
+ * @throws ConnectionException
*/
public synchronized SocketServerInstance selectServerInstance()
- throws CommunicationException {
+ throws CommunicationException, ConnectionException {
if (closed) {
throw new CommunicationException(NetPlugin.Util.getString("SocketServerConnection.closed")); //$NON-NLS-1$
}
if (this.serverInstance != null && (!failOver || this.serverInstance.isOpen())) {
return this.serverInstance;
}
- List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance));
+ List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, null));
+ boolean discoverHosts = true;
closeServerInstance();
List<HostInfo> hostCopy = new ArrayList<HostInfo>(hostKeys);
int knownHosts = hostKeys.size();
@@ -150,23 +118,38 @@
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());
+ ILogon newLogon = connect(hostInfo);
+ if (this.logonResult == null) {
+ try {
+ this.logonResult = newLogon.logon(connProps);
+ this.logonResults.put(this.serverInstance.getHostInfo(), this.logonResult);
+ this.connectionFactory.connected(this.serverInstance, this.logonResult.getSessionToken());
+ this.serverDiscovery.connectionSuccessful(hostInfo);
+ if (discoverHosts) {
+ List<HostInfo> updatedHosts = this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance);
+ if (updatedHosts.size() > 1 && new HashSet<HostInfo>(updatedHosts).size() > new HashSet<HostInfo>(hostCopy).size()) {
+ hostKeys = updatedHosts;
+ closeServerInstance();
+ discoverHosts = false;
+ continue;
+ }
+ }
+ } 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 (TeiidComponentException 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$
+ }
}
- 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 (TeiidComponentException e) {
- ex = e;
}
this.serverDiscovery.markInstanceAsBad(hostInfo);
if (knownHosts == 1) { //just a single host, use the exception
@@ -179,133 +162,127 @@
}
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);
- List<HostInfo> knownHosts = this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance);
- if (knownHosts.size() > 1 && !new HashSet<HostInfo>(knownHosts).equals(new HashSet<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, null)))) {
- //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 (TeiidComponentException 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 ILogon connect(HostInfo hostInfo) throws CommunicationException,
+ IOException {
+ if (!hostInfo.isResolved()) {
+ hostInfo = new HostInfo(hostInfo.getHostName(), new InetSocketAddress(hostInfo.getInetAddress(), hostInfo.getPortNumber()));
}
-
- private synchronized Object getTarget() throws CommunicationException {
- if (this.target == null) {
- this.target = selectServerInstance().getService(targetClass);
+ hostInfo.setSsl(secure);
+ this.serverInstance = connectionFactory.getServerInstance(hostInfo);
+ this.logonResult = logonResults.get(hostInfo);
+ ILogon newLogon = this.serverInstance.getService(ILogon.class);
+ if (this.logonResult != null) {
+ try {
+ newLogon.assertIdentity(logonResult.getSessionToken());
+ } catch (TeiidException e) {
+ // session is no longer valid
+ disconnect();
}
- 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 (!failOver || ExceptionUtil.getExceptionOfType(exception, SingleInstanceCommunicationException.class) == null) {
- break;
- }
- invalidateTarget();
- //TODO: look for invalid session exception
- }
- throw ExceptionUtil.convertException(method, exception);
- }
-
- private synchronized void invalidateTarget() {
- this.target = null;
- }
-
+ return newLogon;
}
-
+
public <T> T getService(Class<T> iface) {
- return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new ServerConnectionInvocationHandler(iface)));
+ return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new SocketServerInstanceImpl.RemoteInvocationHandler(iface) {
+ @Override
+ protected SocketServerInstance getInstance() throws CommunicationException {
+ if (failOver && System.currentTimeMillis() - lastPing > pingFailOverInterval) {
+ try {
+ ResultsFuture<?> future = selectServerInstance().getService(ILogon.class).ping();
+ future.get();
+ } catch (SingleInstanceCommunicationException e) {
+ closeServerInstance();
+ } catch (CommunicationException e) {
+ throw e;
+ } catch (InvalidSessionException e) {
+ disconnect();
+ closeServerInstance();
+ } catch (Exception e) {
+ closeServerInstance();
+ }
+ }
+ lastPing = System.currentTimeMillis();
+ try {
+ return selectServerInstance();
+ } catch (ConnectionException e) {
+ throw new CommunicationException(e);
+ }
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ try {
+ return super.invoke(proxy, method, args);
+ } catch (Exception e) {
+ if (ExceptionUtil.getExceptionOfType(e, InvalidSessionException.class) != null) {
+ disconnect();
+ }
+ throw e;
+ }
+ }
+
+ }));
}
+
public synchronized void close() {
- shutdown(true);
- }
- private synchronized void shutdown(boolean logoff) {
if (this.closed) {
return;
}
- if (logoff) {
+ if (this.serverInstance != null) {
+ logoff();
+ }
+
+ for (Map.Entry<HostInfo, LogonResult> logonEntry : logonResults.entrySet()) {
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 (TeiidComponentException e) {
- //ignore
+ connect(logonEntry.getKey());
+ logoff();
+ } catch (Exception e) {
+
}
}
- closeServerInstance();
-
this.closed = true;
this.serverDiscovery.shutdown();
}
+
+ private void logoff() {
+ disconnect();
+ try {
+ //make a best effort to send the logoff
+ Future<?> writeFuture = this.serverInstance.getService(ILogon.class).logoff();
+ writeFuture.get(5000, TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ //ignore
+ }
+ closeServerInstance();
+ }
+
+ private void disconnect() {
+ this.logonResults.remove(this.serverInstance.getHostInfo());
+ if (this.logonResult != null) {
+ this.connectionFactory.disconnected(this.serverInstance, this.logonResult.getSessionToken());
+ }
+ }
- public synchronized ResultsFuture<?> isOpen() {
+ private synchronized ResultsFuture<?> isOpen() throws CommunicationException, InvalidSessionException, TeiidComponentException {
if (this.closed) {
- return null;
+ throw new CommunicationException();
}
+ return logon.ping();
+ }
+
+ public boolean isOpen(long msToTest) {
try {
- if (!selectServerInstance().isOpen()) {
- return null;
- }
- } catch (CommunicationException e) {
- return null;
- }
- try {
- return logon.ping();
+ ResultsFuture<?> future = isOpen();
+ future.get(msToTest, TimeUnit.MILLISECONDS);
+ return true;
} catch (Throwable th) {
- return null;
+ return false;
}
}
- private void handlePingError(Throwable th) {
- if (ExceptionUtil.getExceptionOfType(th, InvalidSessionException.class) != null) {
- shutdown(false);
- } else {
- close();
- }
- }
-
public LogonResult getLogonResult() {
return logonResult;
}
@@ -321,20 +298,22 @@
if (!(otherService instanceof SocketServerConnection)) {
return false;
}
- SocketAddress address = selectServerInstance().getRemoteAddress();
- if (address == null) {
- return false;
+ try {
+ return selectServerInstance().getHostInfo().equals(((SocketServerConnection)otherService).selectServerInstance().getHostInfo());
+ } catch (ConnectionException e) {
+ throw new CommunicationException(e);
}
- return address.equals(((SocketServerConnection)otherService).selectServerInstance().getRemoteAddress());
}
- public void selectNewServerInstance(Object service) {
+ public void selectNewServerInstance() {
closeServerInstance();
- ServerConnectionInvocationHandler handler = (ServerConnectionInvocationHandler)Proxy.getInvocationHandler(service);
- handler.invalidateTarget();
}
public void setFailOver(boolean failOver) {
this.failOver = failOver;
}
+
+ public void setFailOverPingInterval(int pingFailOverInterval) {
+ this.pingFailOverInterval = pingFailOverInterval;
+ }
}
\ No newline at end of file
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -30,11 +30,16 @@
import java.lang.reflect.Proxy;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.Timer;
+import java.util.TimerTask;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
@@ -42,12 +47,15 @@
import java.util.logging.Logger;
import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.SessionToken;
import org.teiid.core.TeiidException;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.core.util.ReflectionHelper;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
import org.teiid.net.HostInfo;
+import org.teiid.net.ServerConnection;
import org.teiid.net.ServerConnectionFactory;
import org.teiid.net.TeiidURL;
@@ -106,13 +114,11 @@
private static class CachedInstance {
HostInfo info;
Integer instance;
- boolean ssl;
SocketServerInstance actual;
SocketServerInstance proxy;
- public CachedInstance(HostInfo info, boolean ssl) {
+ public CachedInstance(HostInfo info) {
this.info = info;
- this.ssl = ssl;
}
@Override
@@ -129,7 +135,7 @@
return false;
}
CachedInstance other = (CachedInstance) obj;
- if (!info.equals(other.info) || ssl != other.ssl) {
+ if (!info.equals(other.info)) {
return false;
}
if (instance == null || other.instance == null) {
@@ -142,6 +148,8 @@
private ObjectChannelFactory channelFactory;
private Timer pingTimer;
+ private HashMap<HostInfo, Set<SessionToken>> sessions = new HashMap<HostInfo, Set<SessionToken>>();
+
//instance pooling
private AtomicInteger instanceCount = new AtomicInteger();
private Map<CachedInstance, CachedInstance> instancePool = new LinkedHashMap<CachedInstance, CachedInstance>();
@@ -180,15 +188,58 @@
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.pingTimer.schedule(new TimerTask() {
+
+ @Override
+ public void run() {
+ Set<Map.Entry<HostInfo, Set<SessionToken>>> sessionEntries = null;
+ synchronized (sessions) {
+ sessionEntries = new HashSet<Map.Entry<HostInfo, Set<SessionToken>>>(sessions.entrySet());
+ }
+ for (Map.Entry<HostInfo, Set<SessionToken>> entry : sessionEntries) {
+ SocketServerInstance instance = null;
+ HashSet<SessionToken> entries = null;
+ synchronized (sessions) {
+ entries = new HashSet<SessionToken>(entry.getValue());
+ }
+ try {
+ instance = getServerInstance(entry.getKey());
+ ILogon logon = instance.getService(ILogon.class);
+ if ("7.1.1".compareTo(instance.getServerVersion()) > 0) { //$NON-NLS-1$
+ for (SessionToken session : entries) {
+ try {
+ logon.assertIdentity(session);
+ logon.ping();
+ } catch (InvalidSessionException e) {
+ }
+ }
+ } else {
+ ArrayList<String> sessionStrings = new ArrayList<String>(entry.getValue().size());
+ for (SessionToken session : entries) {
+ sessionStrings.add(session.getSessionID());
+ }
+ logon.ping(sessionStrings);
+ }
+ } catch (Exception e) {
+ log.log(Level.WARNING, "Error performing keep-alive ping", e); //$NON-NLS-1$
+ } finally {
+ if (instance != null) {
+ instance.shutdown();
+ }
+ }
+ }
+ }
+ }, ServerConnection.PING_INTERVAL, ServerConnection.PING_INTERVAL);
this.channelFactory = new OioOjbectChannelFactory(info);
}
-
- public SocketServerInstance getServerInstance(HostInfo info, boolean ssl) throws CommunicationException, IOException {
+
+ @Override
+ public SocketServerInstance getServerInstance(HostInfo info) throws CommunicationException, IOException {
CachedInstance key = null;
- CachedInstance instance = null;
boolean useCache = this.maxCachedInstances > 0;
if (useCache) {
- key = new CachedInstance(info, ssl);
+ CachedInstance instance = null;
+ key = new CachedInstance(info);
synchronized (instancePool) {
instance = instancePool.remove(key);
}
@@ -197,7 +248,7 @@
boolean valid = false;
try {
Future<?> success = logon.ping();
- success.get(this.channelFactory.getSoTimeout(), TimeUnit.MICROSECONDS);
+ success.get(this.channelFactory.getSoTimeout(), TimeUnit.MILLISECONDS);
valid = true;
} catch (Exception e) {
log.log(Level.FINE, "Error performing ping, will select another instance", e); //$NON-NLS-1$
@@ -219,7 +270,7 @@
}
}
}
- SocketServerInstanceImpl ssii = new SocketServerInstanceImpl(info, ssl, getSynchronousTtl());
+ SocketServerInstanceImpl ssii = new SocketServerInstanceImpl(info, getSynchronousTtl());
ssii.connect(this.channelFactory);
if (useCache) {
key.actual = ssii;
@@ -256,7 +307,7 @@
discovery.init(url, connectionProperties);
- return new SocketServerConnection(this, url.isUsingSSL(), discovery, connectionProperties, pingTimer);
+ return new SocketServerConnection(this, url.isUsingSSL(), discovery, connectionProperties);
}
static void updateConnectionProperties(Properties connectionProperties) {
@@ -284,5 +335,30 @@
public void setMaxCachedInstances(int maxCachedInstances) {
this.maxCachedInstances = maxCachedInstances;
}
+
+ @Override
+ public void connected(SocketServerInstance instance, SessionToken session) {
+ synchronized (sessions) {
+ Set<SessionToken> instanceSessions = sessions.get(instance.getHostInfo());
+ if (instanceSessions == null) {
+ instanceSessions = new HashSet<SessionToken>();
+ sessions.put(instance.getHostInfo(), instanceSessions);
+ }
+ instanceSessions.add(session);
+ }
+ }
+
+ @Override
+ public void disconnected(SocketServerInstance instance, SessionToken session) {
+ synchronized (sessions) {
+ Set<SessionToken> instanceSessions = sessions.get(instance.getHostInfo());
+ if (instanceSessions != null) {
+ instanceSessions.remove(session);
+ if (instanceSessions.isEmpty()) {
+ sessions.remove(instance.getHostInfo());
+ }
+ }
+ }
+ }
}
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -22,9 +22,14 @@
package org.teiid.net.socket;
-import java.net.SocketAddress;
+import java.io.Serializable;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.client.util.ResultsReceiver;
import org.teiid.core.crypto.Cryptor;
+import org.teiid.net.CommunicationException;
import org.teiid.net.HostInfo;
@@ -33,8 +38,6 @@
<T> T getService(Class<T> iface);
void shutdown();
-
- SocketAddress getRemoteAddress();
HostInfo getHostInfo();
@@ -42,4 +45,12 @@
Cryptor getCryptor();
+ long getSynchTimeout();
+
+ void send(Message message, ResultsReceiver<Object> receiver, Serializable key) throws CommunicationException, InterruptedException;
+
+ void read(long timeout, TimeUnit unit, ResultsFuture<?> resultsFuture) throws TimeoutException, InterruptedException;
+
+ String getServerVersion();
+
}
\ No newline at end of file
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -24,12 +24,17 @@
import java.io.IOException;
+import org.teiid.client.security.SessionToken;
import org.teiid.net.CommunicationException;
import org.teiid.net.HostInfo;
public interface SocketServerInstanceFactory {
- SocketServerInstance getServerInstance(HostInfo info, boolean ssl) throws CommunicationException, IOException;
+ SocketServerInstance getServerInstance(HostInfo info) throws CommunicationException, IOException;
+
+ void connected(SocketServerInstance instance, SessionToken session);
+
+ void disconnected(SocketServerInstance instance, SessionToken session);
}
\ No newline at end of file
Modified: branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
--- branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -30,7 +30,6 @@
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;
@@ -53,7 +52,6 @@
import org.teiid.core.crypto.Cryptor;
import org.teiid.core.crypto.DhKeyGenerator;
import org.teiid.core.crypto.NullCryptor;
-import org.teiid.core.util.ApplicationInfo;
import org.teiid.net.CommunicationException;
import org.teiid.net.HostInfo;
import org.teiid.net.NetPlugin;
@@ -69,31 +67,28 @@
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 static 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 HostInfo info;
private ObjectChannel socketChannel;
private Cryptor cryptor;
+ private String serverVersion;
private boolean hasReader;
- public SocketServerInstanceImpl() {
-
- }
-
- public SocketServerInstanceImpl(final HostInfo host, boolean ssl, long synchTimeout) {
- this.hostInfo = host;
- this.ssl = ssl;
+ public SocketServerInstanceImpl(HostInfo info, long synchTimeout) {
+ if (!info.isResolved()) {
+ throw new AssertionError("Expected HostInfo to be resolved"); //$NON-NLS-1$
+ }
+ this.info = info;
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);
+ this.socketChannel = channelFactory.createObjectChannel(new InetSocketAddress(info.getInetAddress(), info.getPortNumber()), info.isSsl());
try {
doHandshake();
} catch (CommunicationException e) {
@@ -105,20 +100,11 @@
}
}
- @Override
+ @Override
public HostInfo getHostInfo() {
- return this.hostInfo;
+ return info;
}
- @Override
- 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++) {
@@ -143,9 +129,9 @@
/*if (!getVersionInfo().equals(handshake.getVersion())) {
throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstanceImpl.version_mismatch", getVersionInfo(), handshake.getVersion())); //$NON-NLS-1$
}*/
+ serverVersion = handshake.getVersion();
+ handshake.setVersion();
- handshake.setVersion(getVersionInfo());
-
byte[] serverPublicKey = handshake.getPublicKey();
if (serverPublicKey != null) {
@@ -162,12 +148,17 @@
throw new CommunicationException(err);
}
}
+
+ @Override
+ public String getServerVersion() {
+ return serverVersion;
+ }
public boolean isOpen() {
return socketChannel.isOpen();
}
- protected void send(Message message, ResultsReceiver<Object> listener, Serializable messageKey)
+ public void send(Message message, ResultsReceiver<Object> listener, Serializable messageKey)
throws CommunicationException, InterruptedException {
if (listener != null) {
asynchronousListeners.put(messageKey, listener);
@@ -227,6 +218,7 @@
listener.receiveResults(messagePacket.getContents());
}
} else {
+ //TODO: could ping back
log.log(Level.FINE, "packet ignored:" + packet); //$NON-NLS-1$
}
}
@@ -242,7 +234,7 @@
return this.cryptor;
}
- void read(long timeout, TimeUnit unit, ResultsFuture<?> future) throws TimeoutException, InterruptedException {
+ public 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()) {
@@ -280,15 +272,24 @@
}
}
}
-
+
@SuppressWarnings("unchecked")
@Override
public <T> T getService(Class<T> iface) {
- return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new RemoteInvocationHandler(iface));
+ return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new RemoteInvocationHandler(iface) {
+ @Override
+ protected SocketServerInstanceImpl getInstance() {
+ return SocketServerInstanceImpl.this;
+ }
+ });
}
- public class RemoteInvocationHandler implements InvocationHandler {
+ public long getSynchTimeout() {
+ return synchTimeout;
+ }
+ public static abstract class RemoteInvocationHandler implements InvocationHandler {
+
private boolean secure;
private Class<?> targetClass;
@@ -302,17 +303,18 @@
throws Throwable {
Throwable t = null;
try {
+ final SocketServerInstance instance = getInstance();
Message message = new Message();
message.setContents(new ServiceInvocationStruct(args, method.getName(),
targetClass));
if (secure) {
- message.setContents(getCryptor().sealObject(message.getContents()));
+ message.setContents(instance.getCryptor().sealObject(message.getContents()));
}
ResultsFuture<Object> results = new ResultsFuture<Object>() {
@Override
protected Object convertResult() throws ExecutionException {
try {
- Object result = getCryptor().unsealObject((Serializable) super.convertResult());
+ Object result = instance.getCryptor().unsealObject(super.convertResult());
if (result instanceof ExceptionHolder) {
throw new ExecutionException(((ExceptionHolder)result).getException());
}
@@ -342,17 +344,17 @@
public Object get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException,
TimeoutException {
- read(timeout, unit, this);
+ instance.read(timeout, unit, this);
return super.get(timeout, unit);
}
};
final ResultsReceiver<Object> receiver = results.getResultsReceiver();
- send(message, receiver, Integer.valueOf(MESSAGE_ID.getAndIncrement()));
+ instance.send(message, receiver, Integer.valueOf(MESSAGE_ID.getAndIncrement()));
if (ResultsFuture.class.isAssignableFrom(method.getReturnType())) {
return results;
}
- return results.get(synchTimeout, TimeUnit.MILLISECONDS);
+ return results.get(instance.getSynchTimeout(), TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
t = e.getCause();
} catch (TimeoutException e) {
@@ -362,6 +364,8 @@
}
throw ExceptionUtil.convertException(method, t);
}
+
+ protected abstract SocketServerInstance getInstance() throws CommunicationException;
}
Modified: branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java
===================================================================
--- branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestAdminApiServerDiscovery.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -35,7 +35,6 @@
import org.teiid.client.security.LogonResult;
import org.teiid.net.HostInfo;
import org.teiid.net.TeiidURL;
-import org.teiid.net.socket.SocketServerInstance;
public class TestAdminApiServerDiscovery extends TestCase {
@@ -65,7 +64,7 @@
processes.add(p2);
Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes); //$NON-NLS-1$
Mockito.stub(instance.getService(Admin.class)).toReturn(serverAdmin);
- Mockito.stub(instance.getHostInfo()).toReturn(knownHost);
+ Mockito.stub(instance.getHostInfo().getHostName()).toReturn("foo"); //$NON-NLS-1$
discovery.connectionSuccessful(knownHost);
List<HostInfo> knownHosts = discovery.getKnownHosts(new LogonResult(), instance);
Modified: branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
===================================================================
--- branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -25,29 +25,30 @@
*/
package org.teiid.net.socket;
+import static org.junit.Assert.*;
+
import java.io.IOException;
-import java.net.InetSocketAddress;
+import java.io.Serializable;
+import java.util.Collection;
import java.util.Properties;
-import junit.framework.TestCase;
-
+import org.junit.Test;
import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
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.core.TeiidComponentException;
import org.teiid.core.crypto.NullCryptor;
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;
/**
@@ -55,12 +56,16 @@
* @see SocketServerConnection
* @since Westport
*/
-public class TestSocketServerConnection extends TestCase {
+public class TestSocketServerConnection {
private static final class FakeILogon implements ILogon {
Throwable t;
+ public FakeILogon(Throwable t) {
+ this.t = t;
+ }
+
@Override
public void assertIdentity(SessionToken sessionId)
throws InvalidSessionException, TeiidComponentException {
@@ -83,15 +88,25 @@
@Override
public ResultsFuture<?> ping()
- throws InvalidSessionException,
- TeiidComponentException {
+ throws TeiidComponentException, CommunicationException {
if (t != null) {
+ if (t instanceof CommunicationException) {
+ CommunicationException ce = (CommunicationException)t;
+ t = null;
+ throw ce;
+ }
TeiidComponentException e = new TeiidComponentException(t);
t = null;
throw e;
}
- return null;
+ return ResultsFuture.NULL_FUTURE;
}
+
+ @Override
+ public ResultsFuture<?> ping(Collection<String> sessions)
+ throws TeiidComponentException, CommunicationException {
+ return ping();
+ }
}
/**
@@ -109,7 +124,7 @@
*
* @since Westport
*/
- public void testSocketServerConnection_PropertiesClientHost() throws Throwable {
+ @Test public void testSocketServerConnection_PropertiesClientHost() throws Throwable {
Properties p = new Properties();
SocketServerConnectionFactory.updateConnectionProperties(p);
@@ -118,25 +133,20 @@
assertTrue(p.containsKey(TeiidURL.CONNECTION.CLIENT_IP_ADDRESS));
}
- public void testLogonFailsWithMultipleHosts() throws Exception {
+ @Test public void testLogonFailsWithMultipleHosts() throws Exception {
Properties p = new Properties();
- SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
- @Override
- public SocketServerInstance getServerInstance(HostInfo info,
- boolean ssl) throws CommunicationException, IOException {
- throw new SingleInstanceCommunicationException();
- }
- };
+ SocketServerInstanceFactory instanceFactory = Mockito.mock(SocketServerInstanceFactory.class);
+ Mockito.stub(instanceFactory.getServerInstance((HostInfo)Mockito.anyObject())).toThrow(new SingleInstanceCommunicationException());
ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL("mm://host1:1,host2:2")); //$NON-NLS-1$
try {
- new SocketServerConnection(instanceFactory, false, discovery, p, null);
+ new SocketServerConnection(instanceFactory, false, discovery, p);
fail("exception expected"); //$NON-NLS-1$
} catch (CommunicationException e) {
assertEquals("No valid host available. Attempted connections to: [host1:1, host2:2]", e.getMessage()); //$NON-NLS-1$
}
}
- public void testLogon() throws Exception {
+ @Test public void testLogon() throws Exception {
SocketServerConnection connection = createConnection(null);
assertEquals(String.valueOf(1), connection.getLogonResult().getSessionID());
}
@@ -144,63 +154,83 @@
/**
* Since the original instance is still open, this will be a transparent retry
*/
- public void testRetry() throws Exception {
+ @Test public void testRetry() throws Exception {
SocketServerConnection connection = createConnection(new SingleInstanceCommunicationException());
connection.setFailOver(true);
+ connection.setFailOverPingInterval(50);
ILogon logon = connection.getService(ILogon.class);
+ Thread.sleep(70);
logon.ping();
}
- public void testImmediateFail() throws Exception {
+ @Test(expected=CommunicationException.class) public void testImmediateFail() throws Exception {
SocketServerConnection connection = createConnection(new CommunicationException());
ILogon logon = connection.getService(ILogon.class);
- try {
- logon.ping();
- fail("expected exception"); //$NON-NLS-1$
- } catch (TeiidComponentException e) {
-
- }
+ logon.ping();
}
- public void testImmediateFail1() throws Exception {
+ @Test(expected=CommunicationException.class) public void testImmediateFail1() throws Exception {
SocketServerConnection connection = createConnection(new CommunicationException());
connection.setFailOver(true);
ILogon logon = connection.getService(ILogon.class);
- try {
- logon.ping();
- fail("expected exception"); //$NON-NLS-1$
- } catch (TeiidComponentException e) {
-
- }
+ logon.ping();
}
private SocketServerConnection createConnection(final Throwable throwException) throws CommunicationException, ConnectionException {
return createConnection(throwException, new HostInfo("0.0.0.2", 1)); //$NON-NLS-1$
}
- private SocketServerConnection createConnection(final Throwable t, HostInfo hostInfo)
+ private SocketServerConnection createConnection(final Throwable t, final HostInfo hostInfo)
throws CommunicationException, ConnectionException {
Properties p = new Properties();
ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL(hostInfo.getHostName(), hostInfo.getPortNumber(), false));
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
+ FakeILogon logon = new FakeILogon(t);
+
@Override
- public SocketServerInstance getServerInstance(final HostInfo info,
- boolean ssl) throws CommunicationException, IOException {
+ public SocketServerInstance getServerInstance(HostInfo info)
+ throws CommunicationException, IOException {
SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
Mockito.stub(instance.getCryptor()).toReturn(new NullCryptor());
- Mockito.stub(instance.getRemoteAddress()).toReturn(new InetSocketAddress(info.getInetAddress(), info.getPortNumber()));
- FakeILogon logon = new FakeILogon();
- logon.t = t;
+ Mockito.stub(instance.getHostInfo()).toReturn(hostInfo);
Mockito.stub(instance.getService(ILogon.class)).toReturn(logon);
+ if (t != null) {
+ try {
+ Mockito.doAnswer(new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation)
+ throws Throwable {
+ if (logon.t == null) {
+ return null;
+ }
+ throw logon.t;
+ }
+ }).when(instance).send((Message)Mockito.anyObject(), (ResultsReceiver<Object>)Mockito.anyObject(), (Serializable)Mockito.anyObject());
+ } catch (Exception e) {
+
+ }
+ }
Mockito.stub(instance.isOpen()).toReturn(true);
return instance;
}
+
+ @Override
+ public void connected(SocketServerInstance instance,
+ SessionToken session) {
+
+ }
+
+ @Override
+ public void disconnected(SocketServerInstance instance,
+ SessionToken session) {
+
+ }
};
- SocketServerConnection connection = new SocketServerConnection(instanceFactory, false, discovery, p, null);
+ SocketServerConnection connection = new SocketServerConnection(instanceFactory, false, discovery, p);
return connection;
}
- public void testIsSameInstance() throws Exception {
+ @Test public void testIsSameInstance() throws Exception {
SocketServerConnection conn = createConnection(null, new HostInfo("0.0.0.0", 1)); //$NON-NLS-1$
SocketServerConnection conn1 = createConnection(null, new HostInfo("0.0.0.1", 1)); //$NON-NLS-1$
Modified: branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
===================================================================
--- branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -34,17 +34,14 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeoutException;
-import org.junit.Ignore;
import org.junit.Test;
import org.teiid.client.security.ILogon;
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
import org.teiid.net.CommunicationException;
import org.teiid.net.HostInfo;
-import org.teiid.net.socket.ObjectChannelFactory;
-import org.teiid.net.socket.SocketServerInstanceImpl;
-
+@SuppressWarnings("nls")
public class TestSocketServerInstanceImpl {
private static class FakeObjectChannel implements ObjectChannel, ObjectChannelFactory {
@@ -127,7 +124,8 @@
private SocketServerInstanceImpl createInstance(ObjectChannelFactory channelFactory)
throws CommunicationException, IOException {
- SocketServerInstanceImpl ssii = new SocketServerInstanceImpl(new HostInfo("0.0.0.0", 1), false, 1); //$NON-NLS-1$
+ HostInfo info = new HostInfo("0.0.0.0", 1);
+ SocketServerInstanceImpl ssii = new SocketServerInstanceImpl(info, 1);
ssii.connect(channelFactory);
return ssii;
}
@@ -147,17 +145,4 @@
}
}
- @Ignore
- @Test public void testVersionMismatch() throws Exception {
- Handshake h = new Handshake();
- h.setVersion("foo"); //$NON-NLS-1$
- final FakeObjectChannel channel = new FakeObjectChannel(Arrays.asList(h));
- try {
- createInstance(channel);
- fail("exception expected"); //$NON-NLS-1$
- } catch (CommunicationException e) {
- assertTrue(e.getMessage().startsWith("Handshake failed due to version mismatch")); //$NON-NLS-1$
- }
- }
-
}
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -123,11 +123,11 @@
}
@Override
- public ResultsFuture<?> isOpen() {
+ public boolean isOpen(long msToTest) {
if (shutdown) {
- return null;
+ return false;
}
- return ResultsFuture.NULL_FUTURE;
+ return true;
}
public void close() {
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -22,6 +22,7 @@
package org.teiid.transport;
+import java.util.Collection;
import java.util.Properties;
import javax.security.auth.login.LoginException;
@@ -41,6 +42,7 @@
import org.teiid.dqp.service.SessionServiceException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.net.CommunicationException;
import org.teiid.net.TeiidURL;
import org.teiid.security.Credentials;
@@ -107,6 +109,18 @@
LogManager.logTrace(LogConstants.CTX_SECURITY, "Ping", id); //$NON-NLS-1$
return ResultsFuture.NULL_FUTURE;
}
+
+ @Override
+ public ResultsFuture<?> ping(Collection<String> sessions)
+ throws TeiidComponentException, CommunicationException {
+ for (String string : sessions) {
+ try {
+ this.service.pingServer(string);
+ } catch (InvalidSessionException e) {
+ }
+ }
+ return ResultsFuture.NULL_FUTURE;
+ }
@Override
public void assertIdentity(SessionToken checkSession) throws InvalidSessionException, TeiidComponentException {
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -39,7 +39,6 @@
import org.jboss.netty.channel.ChannelDownstreamHandler;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.MessageEvent;
import org.teiid.core.util.ReflectionHelper;
@@ -54,7 +53,6 @@
* Some parts of this code is taken from H2's implementation of ODBC
*/
@SuppressWarnings("nls")
-@ChannelPipelineCoverage("one")
public class PgBackendProtocol implements ChannelDownstreamHandler, ODBCClientRemote {
private static final int PG_TYPE_VARCHAR = 1043;
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgFrontendProtocol.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgFrontendProtocol.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/PgFrontendProtocol.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -34,7 +34,6 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -46,7 +45,6 @@
* Some parts of this code is taken from H2's implementation of ODBC
*/
@SuppressWarnings("nls")
-@ChannelPipelineCoverage("one")
public class PgFrontendProtocol extends FrameDecoder {
private int maxObjectSize;
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -42,13 +42,13 @@
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
+import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.ssl.SslHandler;
import org.jboss.netty.handler.stream.ChunkedWriteHandler;
import org.teiid.common.buffer.StorageManager;
@@ -62,7 +62,7 @@
* Main class for creating Netty Nio Channels
*/
-(a)ChannelPipelineCoverage(ChannelPipelineCoverage.ALL)
+@Sharable
public class SSLAwareChannelHandler extends SimpleChannelHandler implements ChannelPipelineFactory {
public class ObjectChannelImpl implements ObjectChannel {
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -94,7 +94,6 @@
public void onConnection() throws CommunicationException {
Handshake handshake = new Handshake();
- handshake.setVersion(SocketListener.getVersionInfo());
if (usingEncryption) {
keyGen = new DhKeyGenerator();
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketListener.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketListener.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/transport/SocketListener.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -31,7 +31,6 @@
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.teiid.common.buffer.StorageManager;
-import org.teiid.core.util.ApplicationInfo;
import org.teiid.core.util.NamedThreadFactory;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -99,10 +98,6 @@
return ((InetSocketAddress)this.serverChanel.getLocalAddress()).getPort();
}
- static String getVersionInfo() {
- return ApplicationInfo.getInstance().getMajorReleaseNumber();
- }
-
public void stop() {
this.serverChanel.close();
this.nettyPool.shutdownNow();
Modified: branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -37,6 +37,7 @@
import org.teiid.client.security.ILogon;
import org.teiid.client.security.LogonException;
import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.crypto.NullCryptor;
@@ -69,19 +70,14 @@
}
}
- @Test public void testFailedConnect() throws Exception {
+ @Test(expected=CommunicationException.class) public void testFailedConnect() throws Exception {
SSLConfiguration config = new SSLConfiguration();
listener = new SocketListener(addr.getPort(), addr.getAddress().getHostAddress(),1024, 1024, 1, config, null, BufferManagerFactory.getStandaloneBufferManager());
- try {
- Properties p = new Properties();
- 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) {
-
- }
+ Properties p = new Properties();
+ String url = new TeiidURL(addr.getHostName(), listener.getPort() - 1, false).getAppServerURL();
+ p.setProperty(TeiidURL.CONNECTION.SERVER_URL, url); //wrong port
+ SocketServerConnectionFactory.getInstance().getConnection(p);
}
@Test public void testConnectWithoutPooling() throws Exception {
@@ -157,7 +153,7 @@
@Override
public LogonResult logon(Properties connProps)
throws LogonException, ComponentNotFoundException {
- return new LogonResult();
+ return new LogonResult(new SessionToken("dummy"), "x", 1, "z");
}
}, null);
Modified: branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
===================================================================
--- branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java 2010-08-19 15:30:38 UTC (rev 2481)
+++ branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java 2010-08-20 22:18:46 UTC (rev 2482)
@@ -29,6 +29,10 @@
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.util.Collection;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@@ -60,7 +64,7 @@
import org.teiid.net.socket.SocketServerInstanceImpl;
import org.teiid.net.socket.UrlServerDiscovery;
-
+@SuppressWarnings("nls")
public class TestSocketRemoting {
public interface FakeService {
@@ -104,15 +108,11 @@
ClientServiceRegistryImpl server;
private ResultsReceiver<Object> listener;
- public FakeClientServerInstance(ClientServiceRegistryImpl server) {
- super();
+ public FakeClientServerInstance(ClientServiceRegistryImpl server) throws UnknownHostException {
+ super(new HostInfo("foo", new InetSocketAddress(InetAddress.getLocalHost(), 1)), 1000);
this.server = server;
}
-
- public HostInfo getHostInfo() {
- return new HostInfo("fake", 1); //$NON-NLS-1$
- }
-
+
public boolean isOpen() {
return true;
}
@@ -182,6 +182,12 @@
}
@Override
+ public ResultsFuture<?> ping(Collection<String> sessions)
+ throws TeiidComponentException, CommunicationException {
+ return null;
+ }
+
+ @Override
public void assertIdentity(SessionToken sessionId)
throws InvalidSessionException,
TeiidComponentException {
@@ -226,12 +232,24 @@
SocketServerConnection connection = new SocketServerConnection(new SocketServerInstanceFactory() {
@Override
- public SocketServerInstance getServerInstance(HostInfo info,
- boolean ssl) throws CommunicationException, IOException {
+ public SocketServerInstance getServerInstance(HostInfo info)
+ throws CommunicationException, IOException {
return serverInstance;
}
- }, false, new UrlServerDiscovery(new TeiidURL("foo", 1, false)), new Properties(), null); //$NON-NLS-1$
+ @Override
+ public void connected(SocketServerInstance instance,
+ SessionToken session) {
+
+ }
+
+ @Override
+ public void disconnected(SocketServerInstance instance,
+ SessionToken session) {
+
+ }
+
+ }, false, new UrlServerDiscovery(new TeiidURL("0.0.0.0", 1, false)), new Properties()); //$NON-NLS-1$
return connection;
}
14 years, 4 months
teiid SVN: r2481 - branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-19 11:30:38 -0400 (Thu, 19 Aug 2010)
New Revision: 2481
Modified:
branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
Log:
TEIID-1218 fixing adminshell help text
Modified: branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-08-18 14:07:14 UTC (rev 2480)
+++ branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-08-19 15:30:38 UTC (rev 2481)
@@ -154,11 +154,11 @@
return getAdmin().getCacheTypes();
}
- @Doc(text = "Cancel a request")
+ @Doc(text = "Change a VDB Connection Type")
public static void changeVDBConnectionType(
@Doc(text = "vdb name") String vdbName,
@Doc(text = "vdb version") int vdbVersion,
- @Doc(text = "Connection Type") String type)
+ @Doc(text = "Connection Type (NONE, BY_VERSION, or ANY") String type)
throws AdminException {
getAdmin().changeVDBConnectionType(vdbName, vdbVersion, ConnectionType.valueOf(type));
}
14 years, 4 months
teiid SVN: r2480 - in trunk: test-integration/common/src/test/java/org/teiid/jdbc and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-18 10:07:14 -0400 (Wed, 18 Aug 2010)
New Revision: 2480
Modified:
trunk/documentation/docbook/custom.dtd
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
Log:
updating to 7.2
Modified: trunk/documentation/docbook/custom.dtd
===================================================================
--- trunk/documentation/docbook/custom.dtd 2010-08-18 01:19:41 UTC (rev 2479)
+++ trunk/documentation/docbook/custom.dtd 2010-08-18 14:07:14 UTC (rev 2480)
@@ -1,4 +1,4 @@
-<!ENTITY versionNumber "7.1">
+<!ENTITY versionNumber "7.2">
<!ENTITY copyrightYear "2009">
<!ENTITY copyrightHolder "Red Hat, Inc.">
<!ENTITY url "http://www.jboss.org/teiid/">
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-08-18 01:19:41 UTC (rev 2479)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-08-18 14:07:14 UTC (rev 2480)
@@ -895,7 +895,7 @@
expected.put("getCatalogSeparator", ""); //$NON-NLS-1$ //$NON-NLS-2$
expected.put("getCatalogTerm", "VirtualDatabase"); //$NON-NLS-1$ //$NON-NLS-2$
expected.put("getDatabaseProductName", "Teiid Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
- expected.put("getDatabaseProductVersion", "7.1"); //$NON-NLS-1$ //$NON-NLS-2$
+ expected.put("getDatabaseProductVersion", "7.2"); //$NON-NLS-1$ //$NON-NLS-2$
expected.put("getDriverName", "Teiid JDBC Driver"); //$NON-NLS-1$ //$NON-NLS-2$
expected.put("getDriverVersion", ApplicationInfo.getInstance().getMajorReleaseVersion()+"."+ApplicationInfo.getInstance().getMinorReleaseVersion()); //$NON-NLS-1$ //$NON-NLS-2$
expected.put("getExtraNameCharacters", ".@"); //$NON-NLS-1$ //$NON-NLS-2$
14 years, 4 months
teiid SVN: r2479 - in branches/7.1.x: adminshell and 35 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 21:19:41 -0400 (Tue, 17 Aug 2010)
New Revision: 2479
Modified:
branches/7.1.x/adminshell/pom.xml
branches/7.1.x/api/pom.xml
branches/7.1.x/build/pom.xml
branches/7.1.x/cache-jbosscache/pom.xml
branches/7.1.x/client/pom.xml
branches/7.1.x/common-core/pom.xml
branches/7.1.x/connectors/connector-file/pom.xml
branches/7.1.x/connectors/connector-ldap/pom.xml
branches/7.1.x/connectors/connector-salesforce/pom.xml
branches/7.1.x/connectors/connector-ws/pom.xml
branches/7.1.x/connectors/pom.xml
branches/7.1.x/connectors/salesforce-api/pom.xml
branches/7.1.x/connectors/sandbox/pom.xml
branches/7.1.x/connectors/sandbox/translator-yahoo/pom.xml
branches/7.1.x/connectors/translator-file/pom.xml
branches/7.1.x/connectors/translator-jdbc/pom.xml
branches/7.1.x/connectors/translator-ldap/pom.xml
branches/7.1.x/connectors/translator-loopback/pom.xml
branches/7.1.x/connectors/translator-salesforce/pom.xml
branches/7.1.x/connectors/translator-ws/pom.xml
branches/7.1.x/console/pom.xml
branches/7.1.x/documentation/admin-guide/pom.xml
branches/7.1.x/documentation/caching-guide/pom.xml
branches/7.1.x/documentation/client-developers-guide/pom.xml
branches/7.1.x/documentation/developer-guide/pom.xml
branches/7.1.x/documentation/pom.xml
branches/7.1.x/documentation/quick-start-example/pom.xml
branches/7.1.x/documentation/reference/pom.xml
branches/7.1.x/engine/pom.xml
branches/7.1.x/hibernate-dialect/pom.xml
branches/7.1.x/jboss-integration/pom.xml
branches/7.1.x/metadata/pom.xml
branches/7.1.x/pom.xml
branches/7.1.x/runtime/pom.xml
branches/7.1.x/test-integration/common/pom.xml
branches/7.1.x/test-integration/db/pom.xml
branches/7.1.x/test-integration/pom.xml
Log:
switching to 7.1.1
Modified: branches/7.1.x/adminshell/pom.xml
===================================================================
--- branches/7.1.x/adminshell/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/adminshell/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: branches/7.1.x/api/pom.xml
===================================================================
--- branches/7.1.x/api/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/api/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: branches/7.1.x/build/pom.xml
===================================================================
--- branches/7.1.x/build/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/build/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>build</artifactId>
Modified: branches/7.1.x/cache-jbosscache/pom.xml
===================================================================
--- branches/7.1.x/cache-jbosscache/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/cache-jbosscache/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: branches/7.1.x/client/pom.xml
===================================================================
--- branches/7.1.x/client/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/client/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: branches/7.1.x/common-core/pom.xml
===================================================================
--- branches/7.1.x/common-core/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/common-core/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: branches/7.1.x/connectors/connector-file/pom.xml
===================================================================
--- branches/7.1.x/connectors/connector-file/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/connector-file/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: branches/7.1.x/connectors/connector-ldap/pom.xml
===================================================================
--- branches/7.1.x/connectors/connector-ldap/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/connector-ldap/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: branches/7.1.x/connectors/connector-salesforce/pom.xml
===================================================================
--- branches/7.1.x/connectors/connector-salesforce/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/connector-salesforce/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: branches/7.1.x/connectors/connector-ws/pom.xml
===================================================================
--- branches/7.1.x/connectors/connector-ws/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/connector-ws/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: branches/7.1.x/connectors/pom.xml
===================================================================
--- branches/7.1.x/connectors/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: branches/7.1.x/connectors/salesforce-api/pom.xml
===================================================================
--- branches/7.1.x/connectors/salesforce-api/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/salesforce-api/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: branches/7.1.x/connectors/sandbox/pom.xml
===================================================================
--- branches/7.1.x/connectors/sandbox/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/sandbox/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: branches/7.1.x/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- branches/7.1.x/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/sandbox/translator-yahoo/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: branches/7.1.x/connectors/translator-file/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-file/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-file/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: branches/7.1.x/connectors/translator-jdbc/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-jdbc/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: branches/7.1.x/connectors/translator-ldap/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-ldap/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-ldap/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: branches/7.1.x/connectors/translator-loopback/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-loopback/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-loopback/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: branches/7.1.x/connectors/translator-salesforce/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-salesforce/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: branches/7.1.x/connectors/translator-ws/pom.xml
===================================================================
--- branches/7.1.x/connectors/translator-ws/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/connectors/translator-ws/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: branches/7.1.x/console/pom.xml
===================================================================
--- branches/7.1.x/console/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/console/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: branches/7.1.x/documentation/admin-guide/pom.xml
===================================================================
--- branches/7.1.x/documentation/admin-guide/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/admin-guide/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: branches/7.1.x/documentation/caching-guide/pom.xml
===================================================================
--- branches/7.1.x/documentation/caching-guide/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/caching-guide/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: branches/7.1.x/documentation/client-developers-guide/pom.xml
===================================================================
--- branches/7.1.x/documentation/client-developers-guide/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/client-developers-guide/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: branches/7.1.x/documentation/developer-guide/pom.xml
===================================================================
--- branches/7.1.x/documentation/developer-guide/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/developer-guide/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: branches/7.1.x/documentation/pom.xml
===================================================================
--- branches/7.1.x/documentation/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,8 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
- </parent>
+ <version>7.1.1.Alpha1</version> </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
Modified: branches/7.1.x/documentation/quick-start-example/pom.xml
===================================================================
--- branches/7.1.x/documentation/quick-start-example/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/quick-start-example/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: branches/7.1.x/documentation/reference/pom.xml
===================================================================
--- branches/7.1.x/documentation/reference/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/documentation/reference/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: branches/7.1.x/engine/pom.xml
===================================================================
--- branches/7.1.x/engine/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/engine/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: branches/7.1.x/hibernate-dialect/pom.xml
===================================================================
--- branches/7.1.x/hibernate-dialect/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/hibernate-dialect/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: branches/7.1.x/jboss-integration/pom.xml
===================================================================
--- branches/7.1.x/jboss-integration/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/jboss-integration/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -2,13 +2,13 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-jboss-integration</artifactId>
<name>teiid-jboss-integration</name>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
<description>JBoss specific integration layer for teiid</description>
<dependencies>
Modified: branches/7.1.x/metadata/pom.xml
===================================================================
--- branches/7.1.x/metadata/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/metadata/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: branches/7.1.x/pom.xml
===================================================================
--- branches/7.1.x/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -5,15 +5,15 @@
<artifactId>teiid</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</developerConnection>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-7.1.1.Alpha1</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-7.1.1.Alpha1</developerConnection>
</scm>
<licenses>
<license>
Modified: branches/7.1.x/runtime/pom.xml
===================================================================
--- branches/7.1.x/runtime/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/runtime/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: branches/7.1.x/test-integration/common/pom.xml
===================================================================
--- branches/7.1.x/test-integration/common/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/test-integration/common/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: branches/7.1.x/test-integration/db/pom.xml
===================================================================
--- branches/7.1.x/test-integration/db/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/test-integration/db/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -19,7 +19,7 @@
<groupId>org.jboss.teiid.teiid-test-integration</groupId>
<description>Integration tests that require external database dependencies </description>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
<dependencies>
Modified: branches/7.1.x/test-integration/pom.xml
===================================================================
--- branches/7.1.x/test-integration/pom.xml 2010-08-17 20:32:57 UTC (rev 2478)
+++ branches/7.1.x/test-integration/pom.xml 2010-08-18 01:19:41 UTC (rev 2479)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.1.1.Alpha1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 4 months