Author: rareddy
Date: 2010-03-30 17:24:33 -0400 (Tue, 30 Mar 2010)
New Revision: 2010
Added:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/
trunk/connectors/connector-xml-file/src/main/resources/org/teiid/connector/xml/
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnection.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileExecution.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/TrustedPayloadHandler.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/XMLSourcePlugin.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapDocLiteralRequest.java
trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml/
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/
Removed:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/
trunk/connectors/connector-xml-file/src/main/resources/org/teiid/connector/xmlsource/
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xmlsource/file/
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapRequest.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/TrustedPayloadHandler.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/XMLSourcePlugin.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/
trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xmlsource/
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xmlsource/soap/
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnection.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnector.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileManagedConnectionFactory.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileProcedureExecution.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileResultSetExecution.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileSourceCapabilities.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/XMLSourcePlugin.java
trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestCachingFileConnector.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestXMLConnector.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/FakeFileManagedConnectionfactory.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestCachingFileConnectorLong.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnector.java
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnectorLong.java
trunk/connectors/connector-xml-http/pom.xml
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/BaseRequest.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPRequest.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPResultSetExecution.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityManagedConnectionFactory.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityToken.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnection.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnector.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapManagedConnectionFactory.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapProcedureExecution.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapService.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java
trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapConnector.java
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapExecution.java
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java
Log:
TEIID-861: minor issues with configuration in running the XML file soap connectors
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java
===================================================================
---
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -61,6 +61,16 @@
this.inputStreamFilterClass = inputStreamFilterClass;
}
+ private boolean logRequestResponseDocs;
+
+ public boolean isLogRequestResponseDocs() {
+ return logRequestResponseDocs;
+ }
+
+ public void setLogRequestResponseDocs(Boolean logRequestResponseDocs) {
+ this.logRequestResponseDocs = logRequestResponseDocs;
+ }
+
public SQLXML getResponse(String key) {
return this.responses.get(key);
}
Copied: trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file
(from rev 2009,
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file)
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnection.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileConnection.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnection.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import java.io.File;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnector.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,4 +1,4 @@
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import org.teiid.connector.api.Connection;
import org.teiid.connector.api.ConnectorCapabilities;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileManagedConnectionFactory.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileManagedConnectionFactory.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileManagedConnectionFactory.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileProcedureExecution.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileProcedureExecution.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileProcedureExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import java.io.BufferedInputStream;
import java.io.File;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileResultSetExecution.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileResultSetExecution.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileResultSetExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import java.io.BufferedInputStream;
import java.io.File;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileSourceCapabilities.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileSourceCapabilities.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/FileSourceCapabilities.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import com.metamatrix.connector.xml.base.XMLCapabilities;
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/XMLSourcePlugin.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/XMLSourcePlugin.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xml/file/XMLSourcePlugin.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.file;
+package org.teiid.connector.xml.file;
import java.util.ResourceBundle;
@@ -34,7 +34,7 @@
/**
* The plug-in identifier of this plugin
*/
- public static final String PLUGIN_ID = "org.teiid.connector.xmlsource" ;
//$NON-NLS-1$
+ public static final String PLUGIN_ID = "org.teiid.connector.xml" ;
//$NON-NLS-1$
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
PLUGIN_ID + ".i18n",
ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml 2010-03-29 17:40:18
UTC (rev 2009)
+++ trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml 2010-03-30 21:24:33
UTC (rev 2010)
@@ -38,20 +38,20 @@
<outbound-resourceadapter>
<connection-definition>
-
<managedconnectionfactory-class>org.teiid.connector.xmlsource.file.FileManagedConnectionFactory</managedconnectionfactory-class>
+
<managedconnectionfactory-class>org.teiid.connector.xml.file.FileManagedConnectionFactory</managedconnectionfactory-class>
<config-property>
<description>{$display:"Connector
Class",$advanced:"true"}</description>
<config-property-name>ConnectorClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>org.teiid.connector.xmlsource.file.FileConnector</config-property-value>
+
<config-property-value>org.teiid.connector.xml.file.FileConnector</config-property-value>
</config-property>
<config-property>
<description>{$display:"Connector
Capabilities",$description:"The class to use to provide the Connector
Capabilities",$advanced:"true"}</description>
<config-property-name>CapabilitiesClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>org.teiid.connector.xmlsource.file.FileSourceCapabilities</config-property-value>
+
<config-property-value>org.teiid.connector.xml.file.FileSourceCapabilities</config-property-value>
</config-property>
<config-property>
Copied: trunk/connectors/connector-xml-file/src/main/resources/org/teiid/connector/xml
(from rev 2009,
trunk/connectors/connector-xml-file/src/main/resources/org/teiid/connector/xmlsource)
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestCachingFileConnector.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestCachingFileConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestCachingFileConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -10,8 +10,8 @@
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.xml.file.FakeFileManagedConnectionfactory;
-import org.teiid.connector.xmlsource.file.FileConnector;
-import org.teiid.connector.xmlsource.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileConnector;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
import com.metamatrix.cdk.api.ConnectorHost;
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestXMLConnector.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestXMLConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/TestXMLConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -27,8 +27,8 @@
import org.teiid.connector.api.ConnectorEnvironment;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.xml.file.FakeFileManagedConnectionfactory;
-import org.teiid.connector.xmlsource.file.FileConnection;
-import org.teiid.connector.xmlsource.file.FileConnector;
+import org.teiid.connector.xml.file.FileConnection;
+import org.teiid.connector.xml.file.FileConnector;
public class TestXMLConnector extends TestCase {
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/FakeFileManagedConnectionfactory.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/FakeFileManagedConnectionfactory.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/FakeFileManagedConnectionfactory.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,6 +1,6 @@
package org.teiid.connector.xml.file;
-import org.teiid.connector.xmlsource.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
import com.metamatrix.core.util.UnitTestUtil;
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestCachingFileConnectorLong.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestCachingFileConnectorLong.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestCachingFileConnectorLong.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -9,8 +9,8 @@
import org.teiid.connector.api.Connector;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.xmlsource.file.FileConnector;
-import org.teiid.connector.xmlsource.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileConnector;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
import com.metamatrix.cdk.api.ConnectorHost;
Copied:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnection.java
(from rev 2009,
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xmlsource/file/TestFileConnection.java)
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnection.java
(rev 0)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnection.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -0,0 +1,80 @@
+/*
+ * 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.connector.xml.file;
+
+import junit.framework.TestCase;
+
+import org.mockito.Mockito;
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ConnectorLogger;
+import org.teiid.connector.xml.file.FileConnection;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
+
+import com.metamatrix.core.util.UnitTestUtil;
+
+
+/**
+ */
+public class TestFileConnection extends TestCase {
+
+
+ public void testBadDirectory() {
+ FileManagedConnectionFactory config =
Mockito.mock(FileManagedConnectionFactory.class);
+ Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+ Mockito.stub(config.getDirectoryLocation()).toReturn("BadDirectory");
+
+ try {
+ new FileConnection(config);
+ fail("Must have failed because of bad directory location");
//$NON-NLS-1$
+ } catch (ConnectorException e) {
+ }
+ }
+
+
+ public void testGoodDirectory() {
+ String file = UnitTestUtil.getTestDataPath();
+
+ FileManagedConnectionFactory config =
Mockito.mock(FileManagedConnectionFactory.class);
+ Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+ Mockito.stub(config.getDirectoryLocation()).toReturn(file);
+
+ try {
+ FileConnection conn = new FileConnection(config);
+ assertTrue(conn.isConnected());
+ } catch (ConnectorException e) {
+ fail("mast have passed connection"); //$NON-NLS-1$
+ }
+ }
+
+ public void testNoDirectory() {
+ FileManagedConnectionFactory config =
Mockito.mock(FileManagedConnectionFactory.class);
+ Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+
+ try {
+ new FileConnection(config);
+ fail("Must have failed because of bad directory location");
//$NON-NLS-1$
+ } catch (ConnectorException e) {
+ }
+ }
+
+}
Property changes on:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnector.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -8,8 +8,8 @@
import org.mockito.Mockito;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.xmlsource.file.FileConnector;
-import org.teiid.connector.xmlsource.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileConnector;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
import com.metamatrix.cdk.api.ConnectorHost;
Modified:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnectorLong.java
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnectorLong.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileConnectorLong.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -9,8 +9,8 @@
import org.teiid.connector.api.Connector;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.xmlsource.file.FileConnector;
-import org.teiid.connector.xmlsource.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileConnector;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
import com.metamatrix.cdk.api.ConnectorHost;
Copied:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileExecution.java
(from rev 2009,
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xmlsource/file/TestFileExecution.java)
===================================================================
---
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileExecution.java
(rev 0)
+++
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -0,0 +1,115 @@
+/*
+ * 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.connector.xml.file;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.sql.SQLXML;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.mockito.Mockito;
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
+import org.teiid.connector.language.Call;
+import org.teiid.connector.language.LanguageFactory;
+import org.teiid.connector.metadata.runtime.Procedure;
+import org.teiid.connector.metadata.runtime.RuntimeMetadata;
+import org.teiid.connector.xml.file.FileConnection;
+import org.teiid.connector.xml.file.FileManagedConnectionFactory;
+import org.teiid.connector.xml.file.FileProcedureExecution;
+
+import com.metamatrix.core.util.ObjectConverterUtil;
+import com.metamatrix.core.util.UnitTestUtil;
+
+
+/**
+ */
+@SuppressWarnings("nls")
+public class TestFileExecution extends TestCase {
+
+ public void testGoodFile() throws Exception {
+ String file = UnitTestUtil.getTestDataPath();
+ FileManagedConnectionFactory config = new FileManagedConnectionFactory();
+ config.setLogWriter(Mockito.mock(PrintWriter.class));
+ config.setDirectoryLocation(file);
+
+ FileConnection conn = new FileConnection(config);
+ assertTrue(conn.isConnected());
+ RuntimeMetadata metadata = Mockito.mock(RuntimeMetadata.class);
+
+ LanguageFactory fact = config.getLanguageFactory();
+ Call procedure = fact.createCall("GetXMLFile", null,
createMockProcedureMetadata("BookCollection.xml")); //$NON-NLS-1$
+
+ FileProcedureExecution exec =
(FileProcedureExecution)conn.createExecution(procedure,
Mockito.mock(ExecutionContext.class), metadata); //$NON-NLS-1$ //$NON-NLS-2$
+
+ exec.execute();
+
+ List<?> result = exec.next();
+ assertNotNull(result);
+ assertNull(exec.next());
+ try {
+ exec.getOutputParameterValues();
+ fail("should have thrown error in returning a return");
//$NON-NLS-1$
+ }catch(Exception e) {
+ }
+ SQLXML xmlSource = (SQLXML)result.get(0);
+ assertNotNull(xmlSource);
+ String xml = xmlSource.getString();
+
+ String fileContents = ObjectConverterUtil.convertFileToString(new
File(file+"/BookCollection.xml")); //$NON-NLS-1$
+ fileContents = fileContents.replaceAll("\r", "");
//$NON-NLS-1$ //$NON-NLS-2$
+ //System.out.println(fileContents);
+
+ assertEquals(fileContents, xml);
+ }
+
+ public void testBadFile() throws Exception {
+ String file = UnitTestUtil.getTestDataPath();
+ FileManagedConnectionFactory config = new FileManagedConnectionFactory();
+ config.setLogWriter(Mockito.mock(PrintWriter.class));
+ config.setDirectoryLocation(file);
+
+
+ try {
+ FileConnection conn = new FileConnection(config);
+ assertTrue(conn.isConnected());
+ RuntimeMetadata metadata = Mockito.mock(RuntimeMetadata.class);
+ LanguageFactory fact = config.getLanguageFactory();
+ FileProcedureExecution exec =
(FileProcedureExecution)conn.createExecution(fact.createCall("GetXMLFile", null,
createMockProcedureMetadata("nofile.xml")),
Mockito.mock(ExecutionContext.class), metadata); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+
+
+ exec.execute();
+ fail("mast have failed to find the file"); //$NON-NLS-1$
+ } catch (ConnectorException e) {
+ //pass
+ }
+ }
+
+ public static Procedure createMockProcedureMetadata(String nameInSource) {
+ Procedure rm = Mockito.mock(Procedure.class);
+ Mockito.stub(rm.getNameInSource()).toReturn(nameInSource);
+ return rm;
+ }
+}
Property changes on:
trunk/connectors/connector-xml-file/src/test/java/org/teiid/connector/xml/file/TestFileExecution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-xml-http/pom.xml
===================================================================
--- trunk/connectors/connector-xml-http/pom.xml 2010-03-29 17:40:18 UTC (rev 2009)
+++ trunk/connectors/connector-xml-http/pom.xml 2010-03-30 21:24:33 UTC (rev 2010)
@@ -73,9 +73,6 @@
<goals>
<goal>jar</goal>
</goals>
- <configuration>
- <classifier>export</classifier>
- </configuration>
</execution>
<execution>
<id>deploy_jar</id>
Copied:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/TrustedPayloadHandler.java
(from rev 2009,
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/TrustedPayloadHandler.java)
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/TrustedPayloadHandler.java
(rev 0)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/TrustedPayloadHandler.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -0,0 +1,50 @@
+/*
+ * 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.connector.xml;
+
+import javax.security.auth.Subject;
+
+import org.teiid.connector.api.ConnectorEnvironment;
+import org.teiid.connector.api.ConnectorLogger;
+
+
+public interface TrustedPayloadHandler {
+
+ public String getUser();
+
+ public String getPassword();
+
+ public void setLogger(ConnectorLogger logger);
+
+ public void setSubject(Subject subject);
+
+ public void setConnectorEnvironment(ConnectorEnvironment connEnv);
+
+ public void processPayloads() throws Exception;
+
+ public void setUser(String userName);
+
+ public void setPassword(String password);
+}
Property changes on:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/TrustedPayloadHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/XMLSourcePlugin.java
(from rev 2009,
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/XMLSourcePlugin.java)
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/XMLSourcePlugin.java
(rev 0)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/XMLSourcePlugin.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.xml;
+
+import java.util.ResourceBundle;
+
+import com.metamatrix.core.BundleUtil;
+
+/**
+ * For logging purposes
+ */
+public class XMLSourcePlugin {
+
+ /**
+ * The plug-in identifier of this plugin
+ */
+ public static final String PLUGIN_ID = "org.teiid.connector.xml" ;
//$NON-NLS-1$
+
+ public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
+ PLUGIN_ID + ".i18n",
ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
+}
Property changes on:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/XMLSourcePlugin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap
(from rev 2009,
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap)
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/BaseRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/BaseRequest.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/BaseRequest.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,4 +1,4 @@
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.net.MalformedURLException;
import java.net.URL;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPRequest.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPRequest.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.io.StringReader;
import java.sql.SQLException;
@@ -40,7 +40,7 @@
import org.jdom.output.XMLOutputter;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
+import org.teiid.connector.xml.XMLSourcePlugin;
import com.metamatrix.connector.xml.Constants;
import com.metamatrix.connector.xml.base.CriteriaDesc;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPResultSetExecution.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPResultSetExecution.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SOAPResultSetExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.util.ArrayList;
import java.util.Arrays;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityManagedConnectionFactory.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SecurityManagedConnectionFactory.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityManagedConnectionFactory.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import org.teiid.connector.api.ConnectorEnvironment;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityToken.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SecurityToken.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SecurityToken.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,11 +20,11 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import javax.xml.ws.Dispatch;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
+import org.teiid.connector.xml.XMLSourcePlugin;
/**
* Security provider for calling the Web Service
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/ServiceOperation.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/ServiceOperation.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.io.StringReader;
@@ -28,7 +28,7 @@
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.Dispatch;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
+import org.teiid.connector.xml.XMLSourcePlugin;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnection.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapConnection.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnection.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnector.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,4 +1,4 @@
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.net.MalformedURLException;
import java.net.URL;
@@ -16,7 +16,7 @@
import org.teiid.connector.api.ConnectorEnvironment;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.basic.BasicConnector;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
+import org.teiid.connector.xml.XMLSourcePlugin;
public class SoapConnector extends BasicConnector {
Added:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapDocLiteralRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapDocLiteralRequest.java
(rev 0)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapDocLiteralRequest.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -0,0 +1,110 @@
+/*
+ * 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.connector.xml.soap;
+
+import java.sql.SQLXML;
+import java.util.List;
+
+import javax.xml.transform.Source;
+
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.xml.XMLSourcePlugin;
+import org.teiid.connector.xml.soap.ServiceOperation.ExcutionFailedException;
+import org.teiid.connector.xml.soap.SoapService.OperationNotFoundException;
+
+
+
+/**
+ * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
+ */
+public abstract class SoapDocLiteralRequest {
+
+ // Connection object.
+ private SoapManagedConnectionFactory env;
+ private SoapService service;
+
+ /**
+ * @param env
+ */
+ public SoapDocLiteralRequest(SoapManagedConnectionFactory env, SoapService service)
{
+ this.env = env;
+ this.service = service;
+ }
+
+ protected abstract String getProcedureName();
+
+ protected abstract List getInputParameters();
+
+ protected abstract SecurityToken getSecurityToken();
+
+ /**
+ * @see
org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.IProcedure,
int)
+ */
+ public SQLXML execute() throws ConnectorException {
+
+
+ String sourceProcedureName = getProcedureName();
+
+ // if the source procedure name is not supplied then throw an exception
+ if (sourceProcedureName == null || sourceProcedureName.length() == 0) {
+ String msg =
XMLSourcePlugin.Util.getString("source_name_not_supplied"); //$NON-NLS-1$
+ throw new ConnectorException(msg);
+ }
+
+
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("exec_soap_procedure",
new Object[] {sourceProcedureName})); //$NON-NLS-1$
+
+ // extract all the input parameters to send to the service
+ List argsList = getInputParameters();
+
+ // convert lists to arrays
+ Object[] args = argsList.toArray(new Object[argsList.size()]);
+
+ try {
+ ServiceOperation operation =
this.service.findOperation(sourceProcedureName);
+
+
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("service_execute",
new Object[] {operation.getName()})); //$NON-NLS-1$
+ for (int i = 0; i < args.length; i++) {
+ this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString(
"service_params", new Object[] {args[i]})); //$NON-NLS-1$
+ }
+
+ Source returnValue = operation.execute(args, getSecurityToken());
+
+
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("xml_contents",
new Object[] {returnValue})); //$NON-NLS-1$
+
+ return convertToXMLType(returnValue);
+
+ } catch (OperationNotFoundException e) {
+ throw new ConnectorException(e);
+ } catch (ExcutionFailedException e) {
+ throw new ConnectorException(e);
+ }
+ }
+
+ protected SQLXML convertToXMLType(Source value) {
+ return (SQLXML)env.getTypeFacility().convertToRuntimeType(value);
+ }
+
+ public List<?> getOutputParameterValues() throws ConnectorException {
+ throw new
ConnectorException(XMLSourcePlugin.Util.getString("No_outputs_allowed"));
//$NON-NLS-1$
+ }
+}
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapManagedConnectionFactory.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapManagedConnectionFactory.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapManagedConnectionFactory.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapProcedureExecution.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapProcedureExecution.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapProcedureExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.sql.SQLXML;
import java.util.ArrayList;
@@ -38,7 +38,7 @@
import org.teiid.connector.language.Argument.Direction;
import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
+import org.teiid.connector.xml.XMLSourcePlugin;
/**
* A soap call executor - handles all styles doc/literal, rpc/encoded etc.
@@ -72,7 +72,7 @@
*/
public void execute() throws ConnectorException {
- SoapRequest request = new SoapRequest(this.env, this.service) {
+ SoapDocLiteralRequest request = new SoapDocLiteralRequest(this.env, this.service) {
@Override
protected String getProcedureName() {
Deleted:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapRequest.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapRequest.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.xmlsource.soap;
-
-import java.sql.SQLXML;
-import java.util.List;
-
-import javax.xml.transform.Source;
-
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.xmlsource.XMLSourcePlugin;
-import org.teiid.connector.xmlsource.soap.ServiceOperation.ExcutionFailedException;
-import org.teiid.connector.xmlsource.soap.SoapService.OperationNotFoundException;
-
-
-
-/**
- * A soap call executor - handles all styles doc/literal, rpc/encoded etc.
- */
-public abstract class SoapRequest {
-
- // Connection object.
- private SoapManagedConnectionFactory env;
- private SoapService service;
-
- /**
- * @param env
- */
- public SoapRequest(SoapManagedConnectionFactory env, SoapService service) {
- this.env = env;
- this.service = service;
- }
-
- protected abstract String getProcedureName();
-
- protected abstract List getInputParameters();
-
- protected abstract SecurityToken getSecurityToken();
-
- /**
- * @see
org.teiid.connector.api.ProcedureExecution#execute(org.teiid.connector.language.IProcedure,
int)
- */
- public SQLXML execute() throws ConnectorException {
-
-
- String sourceProcedureName = getProcedureName();
-
- // if the source procedure name is not supplied then throw an exception
- if (sourceProcedureName == null || sourceProcedureName.length() == 0) {
- String msg =
XMLSourcePlugin.Util.getString("source_name_not_supplied"); //$NON-NLS-1$
- throw new ConnectorException(msg);
- }
-
-
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("exec_soap_procedure",
new Object[] {sourceProcedureName})); //$NON-NLS-1$
-
- // extract all the input parameters to send to the service
- List argsList = getInputParameters();
-
- // convert lists to arrays
- Object[] args = argsList.toArray(new Object[argsList.size()]);
-
- try {
- ServiceOperation operation =
this.service.findOperation(sourceProcedureName);
-
-
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("service_execute",
new Object[] {operation.getName()})); //$NON-NLS-1$
- for (int i = 0; i < args.length; i++) {
- this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString(
"service_params", new Object[] {args[i]})); //$NON-NLS-1$
- }
-
- Source returnValue = operation.execute(args, getSecurityToken());
-
-
this.env.getLogger().logDetail(XMLSourcePlugin.Util.getString("xml_contents",
new Object[] {returnValue})); //$NON-NLS-1$
-
- return convertToXMLType(returnValue);
-
- } catch (OperationNotFoundException e) {
- throw new ConnectorException(e);
- } catch (ExcutionFailedException e) {
- throw new ConnectorException(e);
- }
- }
-
- protected SQLXML convertToXMLType(Source value) {
- return (SQLXML)env.getTypeFacility().convertToRuntimeType(value);
- }
-
- public List<?> getOutputParameterValues() throws ConnectorException {
- throw new
ConnectorException(XMLSourcePlugin.Util.getString("No_outputs_allowed"));
//$NON-NLS-1$
- }
-}
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapService.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapService.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapService.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.net.URL;
import java.util.Iterator;
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapSourceCapabilities.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xml/soap/SoapSourceCapabilities.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import org.teiid.connector.basic.BasicConnectorCapabilities;
Deleted:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/TrustedPayloadHandler.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/TrustedPayloadHandler.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/TrustedPayloadHandler.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.connector.xmlsource;
-
-import javax.security.auth.Subject;
-
-import org.teiid.connector.api.ConnectorEnvironment;
-import org.teiid.connector.api.ConnectorLogger;
-
-
-public interface TrustedPayloadHandler {
-
- public String getUser();
-
- public String getPassword();
-
- public void setLogger(ConnectorLogger logger);
-
- public void setSubject(Subject subject);
-
- public void setConnectorEnvironment(ConnectorEnvironment connEnv);
-
- public void processPayloads() throws Exception;
-
- public void setUser(String userName);
-
- public void setPassword(String password);
-}
Deleted:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/XMLSourcePlugin.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/XMLSourcePlugin.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/XMLSourcePlugin.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.xmlsource;
-
-import java.util.ResourceBundle;
-
-import com.metamatrix.core.BundleUtil;
-
-/**
- * For logging purposes
- */
-public class XMLSourcePlugin {
-
- /**
- * The plug-in identifier of this plugin
- */
- public static final String PLUGIN_ID = "org.teiid.connector.xmlsource" ;
//$NON-NLS-1$
-
- public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
- PLUGIN_ID + ".i18n",
ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
-}
Modified: trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml 2010-03-29 17:40:18
UTC (rev 2009)
+++ trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml 2010-03-30 21:24:33
UTC (rev 2010)
@@ -38,20 +38,20 @@
<outbound-resourceadapter>
<connection-definition>
-
<managedconnectionfactory-class>org.teiid.connector.xmlsource.soap.SoapManagedConnectionFactory</managedconnectionfactory-class>
+
<managedconnectionfactory-class>org.teiid.connector.xml.soap.SoapManagedConnectionFactory</managedconnectionfactory-class>
<config-property>
<description>{$display:"Connector
Class",$advanced:"true"}</description>
<config-property-name>ConnectorClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>org.teiid.connector.xmlsource.soap.SoapConnector</config-property-value>
+
<config-property-value>org.teiid.connector.xml.soap.SoapConnector</config-property-value>
</config-property>
<config-property>
<description>{$display:"Connector
Capabilities",$description:"The class to use to provide the Connector
Capabilities",$advanced:"true"}</description>
<config-property-name>CapabilitiesClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>org.teiid.connector.xmlsource.soap.SoapSourceCapabilities</config-property-value>
+
<config-property-value>org.teiid.connector.xml.soap.SoapSourceCapabilities</config-property-value>
</config-property>
<config-property>
Copied: trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xml
(from rev 2009,
trunk/connectors/connector-xml-soap/src/main/resources/org/teiid/connector/xmlsource)
Copied: trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap
(from rev 2009,
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xmlsource/soap)
Modified:
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapConnector.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xmlsource/soap/TestSoapConnector.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapConnector.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
@@ -33,7 +33,9 @@
import org.mockito.Mockito;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.xmlsource.soap.SoapService.OperationNotFoundException;
+import org.teiid.connector.xml.soap.SoapConnector;
+import org.teiid.connector.xml.soap.SoapManagedConnectionFactory;
+import org.teiid.connector.xml.soap.SoapService.OperationNotFoundException;
import com.metamatrix.core.util.UnitTestUtil;
Modified:
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapExecution.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xmlsource/soap/TestSoapExecution.java 2010-03-29
17:40:18 UTC (rev 2009)
+++
trunk/connectors/connector-xml-soap/src/test/java/org/teiid/connector/xml/soap/TestSoapExecution.java 2010-03-30
21:24:33 UTC (rev 2010)
@@ -20,7 +20,7 @@
* 02110-1301 USA.
*/
-package org.teiid.connector.xmlsource.soap;
+package org.teiid.connector.xml.soap;
import java.io.File;
import java.io.PrintWriter;
@@ -44,6 +44,10 @@
import org.teiid.connector.language.Argument.Direction;
import org.teiid.connector.metadata.runtime.Procedure;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
+import org.teiid.connector.xml.soap.SecurityToken;
+import org.teiid.connector.xml.soap.SoapConnection;
+import org.teiid.connector.xml.soap.SoapConnector;
+import org.teiid.connector.xml.soap.SoapManagedConnectionFactory;
import com.metamatrix.connector.xmlsource.soap.service.WebServiceServer;
import com.metamatrix.core.util.UnitTestUtil;