Permalink
Browse files

forward merge of 7.6.1

  • Loading branch information...
1 parent 503b51d commit 53bf29548c7136c27d8a3292b31cb070413c6b93 @shawkins shawkins committed Dec 1, 2011
Showing with 634 additions and 283 deletions.
  1. +1 −0 build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
  2. +13 −11 build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/README.txt
  3. +1 −1 build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
  4. +2 −1 build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-vdb.xml
  5. +1 −1 build/kits/jboss-container/teiid-examples/simpleclient/run.bat
  6. +5 −0 cache-jbosscache/pom.xml
  7. +36 −2 client/src/main/java/org/teiid/gss/MakeGSS.java
  8. +2 −0 client/src/main/resources/org/teiid/jdbc/i18n.properties
  9. +28 −0 connectors/connector-ws/src/main/java/org/teiid/resource/adapter/ws/WSConnectionImpl.java
  10. +2 −0 connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
  11. +49 −0 connectors/connector-ws/src/test/java/org/teiid/resource/adapter/ws/TestWSAdapter.java
  12. +2 −2 connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
  13. +3 −2 ...ectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
  14. +21 −1 connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
  15. +5 −0 ...anslator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
  16. +8 −10 connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
  17. +63 −34 ...slator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
  18. +99 −101 ...-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
  19. +25 −30 ...salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java
  20. +11 −11 ...or-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
  21. +24 −0 ...or-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestQueryExecutionImpl.java
  22. +47 −14 ...tor-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
  23. +1 −1 console/src/main/resources/META-INF/rhq-plugin.xml
  24. +12 −3 engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
  25. +1 −1 engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
  26. +40 −13 engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
  27. +1 −1 engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
  28. +0 −1 engine/src/main/java/org/teiid/query/sql/lang/Command.java
  29. +1 −0 engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
  30. +1 −0 engine/src/main/resources/org/teiid/query/i18n.properties
  31. +1 −1 engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorManager.java
  32. +10 −19 engine/src/test/java/org/teiid/query/parser/TestOptionsAndHints.java
  33. +12 −0 engine/src/test/java/org/teiid/query/processor/TestProcessor.java
  34. +21 −0 engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java
  35. +1 −0 jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
  36. +5 −8 jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
  37. +1 −1 jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
  38. +5 −0 pom.xml
  39. +67 −6 runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
  40. +1 −3 runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
  41. +1 −1 runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
  42. +1 −0 runtime/src/main/resources/org/teiid/runtime/i18n.properties
  43. +1 −1 runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
  44. +1 −1 runtime/src/test/java/org/teiid/transport/TestCommSockets.java
  45. +1 −1 test-integration/common/src/test/java/org/teiid/jdbc/TestLocalConnections.java
@@ -88,6 +88,7 @@
<bean name="VDBStatusChecker" class="org.teiid.deployers.VDBStatusChecker">
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
<property name="threadPool"><inject bean="jboss.system:service=ThreadPool"/></property>
+ <property name="translatorRepository"><inject bean="translatorRepository"/></property>
</bean>
<!-- Persistence class for the VDB deployment file -->
@@ -38,18 +38,20 @@ select t.* from
2. SOAP11 RPC call providing all of the parameter values for the invoke procedure. With a SOAP
invocation, the action is used to convey the SOAPAction header value if needed. Also note
the use of the endpoint here with an absolute URL, which will be used instead of the default
-on the datasource.
+on the datasource. We are also using the DefaultServiceMode of MESSAGE (see the weather-vdb.xml file)
+to use the full SOAP message request and response.
select xmlserialize(document w.result as string) from
- (call weather.invoke(action=>'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonListZipCode',
- endpoint=>'http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php',
+ (call weather.invoke(action=>'http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php#LatLonListZipCode',
+ endpoint=>'http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php',
binding=>'SOAP11',
request=>'
- <ns1:LatLonListZipCode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:ns1="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl">
- <zipCodeList xsi:type="ns2:zipCodeListType" xmlns:ns2="http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd">63303</zipCodeList>
- </ns1:LatLonListZipCode>')) as w
-
-See the DatabaseMetadata on the invoke procedure for a full description of the parameters.
-
+ <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
+ <SOAP-ENV:Body>
+ <ns8077:LatLonListZipCode xmlns:ns8077="uri:DWMLgen">
+ <listZipCodeList xsi:type="xsd:string">20910 25414</listZipCodeList>
+ </ns8077:LatLonListZipCode>
+ </SOAP-ENV:Body>
+ </SOAP-ENV:Envelope>')) as w
+
+See the Reference or retrieve the JDBC DatabaseMetadata on the invoke procedure for a full description of the parameters.
@@ -7,7 +7,7 @@
<rar-name>teiid-connector-ws.rar</rar-name>
<connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
- <config-property name="EndPoint">http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php</config-property>
+ <config-property name="EndPoint">http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php</config-property>
<max-pool-size>20</max-pool-size>
@@ -2,7 +2,7 @@
<vdb name="weather" version="1">
<!--
- See the dynamicvdb Portfolio example, or http://community.jboss.org/wiki/DynamicVDBinTeiid70
+ See the dynamicvdb Portfolio example, or the Reference
for more information on the format of a vdb.xml file.
-->
@@ -16,6 +16,7 @@
<translator name="MessageWeather" type="ws">
<property name="DefaultBinding" value="HTTP"/>
+ <property name="DefaultServiceMode" value="MESSAGE"/>
</translator>
</vdb>
@@ -2,7 +2,7 @@ rem First one sets the path for the client
set CLIENT_PATH=.
rem Second one adds the Teiid client
-set TEIID_PATH=../lib/teiid-${pom.version}-client.jar
+set TEIID_PATH=../../lib/teiid-${pom.version}-client.jar
java -cp %CLIENT_PATH%;%TEIID_PATH% JDBCClient %*
@@ -34,6 +34,11 @@
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-clustering-jgroups</artifactId>
<scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <scope>provided</scope>
</dependency>
</dependencies>
</project>
@@ -67,8 +67,42 @@ public static LogonResult authenticate(ILogon logon, Properties props)
Object result = null;
- String jaasApplicationName = props.getProperty(TeiidURL.CONNECTION.JAAS_NAME, "teiid"); //$NON-NLS-1$
- String kerberosPrincipalName = props.getProperty(TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME, "teiid"); //$NON-NLS-1$
+ StringBuilder errors = new StringBuilder();
+ String jaasApplicationName = props.getProperty(TeiidURL.CONNECTION.JAAS_NAME);
+ String nl = System.getProperty("line.separator");//$NON-NLS-1$
+ if (jaasApplicationName == null) {
+ errors.append(JDBCPlugin.Util.getString("client_prop_missing", TeiidURL.CONNECTION.JAAS_NAME)); //$NON-NLS-1$
+ errors.append(nl);
+ }
+
+ String kerberosPrincipalName = props.getProperty(TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME);
+ if (kerberosPrincipalName == null) {
+ errors.append(JDBCPlugin.Util.getString("client_prop_missing", TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME)); //$NON-NLS-1$
+ errors.append(nl);
+ }
+
+ String realm = System.getProperty("java.security.krb5.realm"); //$NON-NLS-1$
+ if (realm == null) {
+ errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.krb5.realm")); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.append(nl);
+ }
+
+ String kdc = System.getProperty("java.security.krb5.kdc"); //$NON-NLS-1$
+ if (kdc == null) {
+ errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.krb5.kdc")); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.append(nl);
+ }
+
+ String config = System.getProperty("java.security.auth.login.config"); //$NON-NLS-1$
+ if (config == null) {
+ errors.append(JDBCPlugin.Util.getString("system_prop_missing", "java.security.auth.login.config")); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.append(nl);
+ }
+
+ if (errors.length() > 0) {
+ throw new LogonException(errors.toString());
+ }
+
String user = props.getProperty(TeiidURL.CONNECTION.USER_NAME);
String password = props.getProperty(TeiidURL.CONNECTION.PASSWORD);
@@ -155,3 +155,5 @@ BatchSerializer.datatype_mismatch=The modeled datatype {0} for column {1} doesn'
no_krb_ticket=No cached kerberos ticket found and/or no password supplied
gss_auth_failed=GSS Authentication failed
setup_failed=Protocol error. Session setup failed.
+client_prop_missing=Client URL connection property missing "{0}". Please add the property to connection URL.
+system_prop_missing=System property "{0}" missing, please add using -D option on the VM startup script.
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
package org.teiid.resource.adapter.ws;
import java.io.IOException;
@@ -188,6 +210,9 @@ public WSConnectionImpl(WSManagedConnectionFactory mcf) {
String defaultEndpoint = mcf.getEndPoint();
String defaultQueryString = null;
String defaultFragment = null;
+ if (defaultEndpoint == null) {
+ throw new WebServiceException(WSManagedConnectionFactory.UTIL.getString("null_default_endpoint")); //$NON-NLS-1$
+ }
String[] parts = defaultEndpoint.split("\\?", 2); //$NON-NLS-1$
defaultEndpoint = parts[0];
if (parts.length > 1) {
@@ -212,6 +237,9 @@ public WSConnectionImpl(WSManagedConnectionFactory mcf) {
}
} else {
endpoint = mcf.getEndPoint();
+ if (endpoint == null) {
+ throw new WebServiceException(WSManagedConnectionFactory.UTIL.getString("null_endpoint")); //$NON-NLS-1$
+ }
}
Dispatch<T> dispatch = null;
if (HTTPBinding.HTTP_BINDING.equals(binding) && type == DataSource.class) {
@@ -20,3 +20,5 @@
# 02110-1301 USA.
#
+null_endpoint=An endpoint must be specified by the procedure call or have a default value set by the EndPoint datasource property.
+null_default_endpoint=The use of a relative endpoint in a procedure call requires a a default endpoint on the datasource.
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.resource.adapter.ws;
+
+import javax.resource.ResourceException;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.http.HTTPBinding;
+
+import org.junit.Test;
+
+public class TestWSAdapter {
+
+ @Test(expected=WebServiceException.class) public void testMissingEndpoint() throws ResourceException {
+ WSManagedConnectionFactory wsmcf = new WSManagedConnectionFactory();
+
+ WSConnectionImpl conn = (WSConnectionImpl)wsmcf.createConnectionFactory().getConnection();
+ conn.createDispatch(HTTPBinding.HTTP_BINDING, null, StreamSource.class, Mode.PAYLOAD);
+ }
+
+ @Test(expected=WebServiceException.class) public void testMissingEndpoint1() throws ResourceException {
+ WSManagedConnectionFactory wsmcf = new WSManagedConnectionFactory();
+
+ WSConnectionImpl conn = (WSConnectionImpl)wsmcf.createConnectionFactory().getConnection();
+ conn.createDispatch(HTTPBinding.HTTP_BINDING, "/x", StreamSource.class, Mode.PAYLOAD); //$NON-NLS-1$
+ }
+
+}
@@ -211,9 +211,9 @@ public void visit(Call obj) {
if (obj.getArguments().get(i).getDirection() != Direction.IN) {
throw new IllegalArgumentException(JDBCPlugin.Util.getString("SQLConversionVisitor.not_in_parameter", i+1)); //$NON-NLS-1$
}
- visit(obj.getArguments().get(i));
+ buffer.append('?');
if (this.prepared) {
- this.preparedValues.add(obj.getArguments());
+ this.preparedValues = obj.getArguments();
}
}
}
@@ -70,6 +70,7 @@
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.JDBCPlugin;
import org.teiid.translator.jdbc.LocateFunctionModifier;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -606,8 +607,8 @@ public boolean isOracleSuppliedDriver() {
public List<?> translate(LanguageObject obj, ExecutionContext context) {
if (oracleSuppliedDriver && obj instanceof Call) {
Call call = (Call)obj;
- //oracle returns the resultset as a parameter
- if (call.getReturnType() == null) {
+ if (call.getReturnType() == null && call.getMetadataObject() != null && call.getMetadataObject().getProperties().get(SQLConversionVisitor.TEIID_NATIVE_QUERY) == null) {
+ //oracle returns the resultset as a parameter
call.setReturnType(RefCursorType.class);
}
}
@@ -27,6 +27,7 @@
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
+import java.sql.Types;
import java.util.Arrays;
import java.util.List;
@@ -875,11 +876,30 @@ public void helpTestVisitor(String vdb, String input, String expectedOutput) thr
@Test public void testNativeQueryProc() throws Exception {
String input = "call proc(2)"; //$NON-NLS-1$
- String output = "select x from y where z = 2"; //$NON-NLS-1$
+ String output = "select x from y where z = ?"; //$NON-NLS-1$
QueryMetadataInterface metadata = getOracleSpecificMetadata();
helpTestVisitor(metadata, input, EMPTY_CONTEXT, null, output);
}
+
+ @Test public void testNativeQueryProcPreparedExecution() throws Exception {
+ CommandBuilder commandBuilder = new CommandBuilder(getOracleSpecificMetadata());
+ Command command = commandBuilder.getCommand("call proc(2)");
+ Connection connection = Mockito.mock(Connection.class);
+ CallableStatement cs = Mockito.mock(CallableStatement.class);
+ Mockito.stub(cs.getUpdateCount()).toReturn(-1);
+ ResultSet rs = Mockito.mock(ResultSet.class);
+ Mockito.stub(cs.getObject(1)).toReturn(rs);
+ Mockito.stub(cs.getInt(3)).toReturn(4);
+ Mockito.stub(connection.prepareCall("select x from y where z = ?")).toReturn(cs); //$NON-NLS-1$
+ OracleExecutionFactory ef = new OracleExecutionFactory();
+
+ JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), ef);
+ procedureExecution.execute();
+ Mockito.verify(cs, Mockito.never()).registerOutParameter(1, OracleExecutionFactory.CURSOR_TYPE);
+ Mockito.verify(cs, Mockito.never()).getObject(1);
+ Mockito.verify(cs, Mockito.times(1)).setObject(1, 2, Types.INTEGER);
+ }
}
@@ -167,5 +167,10 @@ public boolean supportsOrCriteria() {
public boolean supportsCompareCriteriaOrdered() {
return true;
}
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return true;
+ }
}
@@ -21,8 +21,8 @@
*/
package org.teiid.translator.salesforce;
-import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.Date;
import org.teiid.translator.TranslatorException;
@@ -56,16 +56,14 @@ public static void validateQueryLength(StringBuffer query) throws TranslatorExce
}
}
- public static SimpleDateFormat getSalesforceDateTimeFormat() {
- return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); //$NON-NLS-1$
- }
+ private static String timeZone;
- public static SimpleDateFormat getTimeZoneOffsetFormat() {
- return new SimpleDateFormat("Z"); //$NON-NLS-1$
+ public static String getDefaultTimeZoneString() {
+ if (timeZone == null) {
+ String s = new SimpleDateFormat("Z").format(new Date(0)); //$NON-NLS-1$
+ timeZone = s.substring(0, 3) + ':' + s.substring(3, 5);
+ }
+ return timeZone;
}
- public static DateFormat getSalesforceDateFormat() {
- return new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
- }
-
}
Oops, something went wrong.

0 comments on commit 53bf295

Please sign in to comment.