Author: shawkins
Date: 2010-03-25 11:15:25 -0400 (Thu, 25 Mar 2010)
New Revision: 1999
Removed:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/BaseXMLConnectorState.java
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/base/
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileProcedureExecution.java
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileResultSetExecution.java
trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/SecureConnectorStateImpl.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnector.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPExecutor.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPManagedConnectionFactory.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java
trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPRequest.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPResultSetExecution.java
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapRequest.java
trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/ResultProducer.java
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/streaming/BaseStreamingExecution.java
Log:
TEIID-137 refining changes to the xml connector(s)
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/ResultProducer.java
===================================================================
---
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/ResultProducer.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/ResultProducer.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -21,5 +21,5 @@
*/
public Iterator<Document> getXMLDocuments() throws ConnectorException;
- public void closeStreams();
+ void close() throws ConnectorException;
}
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-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -22,11 +22,16 @@
package com.metamatrix.connector.xml.base;
+import java.sql.SQLXML;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
import org.teiid.connector.basic.BasicManagedConnectionFactory;
public class XMLBaseManagedConnectionFactory extends BasicManagedConnectionFactory {
private String saxFilterProviderClass;
+ private Map<String, SQLXML> responses = new ConcurrentHashMap<String,
SQLXML>();
public String getSaxFilterProviderClass() {
return this.saxFilterProviderClass;
@@ -56,4 +61,16 @@
this.inputStreamFilterClass = inputStreamFilterClass;
}
+ public SQLXML getResponse(String key) {
+ return this.responses.get(key);
+ }
+
+ public void setResponse(String key, SQLXML xml) {
+ this.responses.put(key, xml);
+ }
+
+ public SQLXML removeResponse(String key) {
+ return this.responses.remove(key);
+ }
+
}
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/streaming/BaseStreamingExecution.java
===================================================================
---
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/streaming/BaseStreamingExecution.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/streaming/BaseStreamingExecution.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -29,7 +29,6 @@
import javax.xml.transform.Source;
-import org.teiid.connector.DataPlugin;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.DataNotAvailableException;
import org.teiid.connector.api.ExecutionContext;
@@ -113,15 +112,8 @@
}
}
- protected SQLXML convertToXMLType(Source value) throws ConnectorException {
- if (value == null) {
- return null;
- }
- Object result = this.config.getTypeFacility().convertToRuntimeType(value);
- if (!(result instanceof SQLXML)) {
- throw new
ConnectorException(DataPlugin.Util.getString("unknown_object_type_to_tranfrom_xml"));
//$NON-NLS-1$
- }
- return (SQLXML)result;
+ protected SQLXML convertToXMLType(Source value) {
+ return (SQLXML)this.config.getTypeFacility().convertToRuntimeType(value);
}
@Override
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileProcedureExecution.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileProcedureExecution.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileProcedureExecution.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -27,13 +27,11 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.sql.SQLXML;
import java.util.Arrays;
import java.util.List;
import javax.xml.transform.Source;
-import org.teiid.connector.DataPlugin;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.DataNotAvailableException;
import org.teiid.connector.api.ExecutionContext;
@@ -108,22 +106,11 @@
this.config.getLogger().logDetail(XMLSourcePlugin.Util.getString("executing_procedure",
new Object[] {procedure.getProcedureName()})); //$NON-NLS-1$
}
- protected SQLXML convertToXMLType(Source value) throws ConnectorException {
- if (value == null) {
- return null;
- }
- Object result = this.config.getTypeFacility().convertToRuntimeType(value);
- if (!(result instanceof SQLXML)) {
- throw new
ConnectorException(DataPlugin.Util.getString("unknown_object_type_to_tranfrom_xml"));
//$NON-NLS-1$
- }
- return (SQLXML)result;
- }
-
@Override
public List<?> next() throws ConnectorException, DataNotAvailableException {
if (!returnedResult) {
returnedResult = true;
- return Arrays.asList(convertToXMLType(returnValue));
+ return Arrays.asList(returnValue);
}
return null;
}
Modified:
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileResultSetExecution.java
===================================================================
---
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileResultSetExecution.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-file/src/main/java/org/teiid/connector/xmlsource/file/FileResultSetExecution.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -116,13 +116,8 @@
}
@Override
- public void closeStreams() {
- // Nothing to do
- }
-
- @Override
public void close() throws ConnectorException {
- closeStreams();
+ // Nothing to do
}
@Override
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-25 12:11:07
UTC (rev 1998)
+++ trunk/connectors/connector-xml-file/src/main/rar/META-INF/ra.xml 2010-03-25 15:15:25
UTC (rev 1999)
@@ -101,7 +101,7 @@
<description>{$display:"XML Filter
Provider",$description:"The class the provides extended XML
Filters",$advanced:"true"}</description>
<config-property-name>SaxFilterProviderClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
@@ -115,14 +115,14 @@
<description>{$display:"Input Stream Filter
Class",$description:"The class to use to preprocess raw XML input
stream",$advanced:"true"}</description>
<config-property-name>InputStreamFilterClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
<description>{$display:"Query Preprocessor
Class",$description:"The class to use to preprocess the
IQuery",$advanced:"true"}</description>
<config-property-name>QueryPreprocessorClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.NoQueryPreprocessing</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
Deleted:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/BaseXMLConnectorState.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/BaseXMLConnectorState.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/BaseXMLConnectorState.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-
-
-package org.teiid.connector.xml;
-
-
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.xml.http.HTTPManagedConnectionFactory;
-
-public interface BaseXMLConnectorState {
-
- public abstract java.util.Properties getState();
-
- public abstract void setState(HTTPManagedConnectionFactory env) throws
ConnectorException;
-
- public abstract void setLogger(ConnectorLogger logger);
-
- public abstract ConnectorLogger getLogger();
-
-}
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -28,11 +28,13 @@
import org.teiid.connector.api.Connection;
import org.teiid.connector.api.ConnectorCapabilities;
import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ConnectorLogger;
+import org.teiid.connector.xml.http.HTTPManagedConnectionFactory;
import com.metamatrix.connector.xml.IQueryPreprocessor;
import com.metamatrix.connector.xml.SAXFilterProvider;
-public interface XMLConnectorState extends BaseXMLConnectorState {
+public interface XMLConnectorState {
public static final String STATE_CLASS_PROP = "ConnectorStateClass";
//$NON-NLS-1$
@@ -51,8 +53,11 @@
public String getPluggableInputStreamFilterClass();
- public boolean isCaching();
+ public abstract void setState(HTTPManagedConnectionFactory env) throws
ConnectorException;
- public SQLXML getResponse(String key);
+ public abstract void setLogger(ConnectorLogger logger);
+ public abstract ConnectorLogger getLogger();
+
+
}
\ No newline at end of file
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/SecureConnectorStateImpl.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/SecureConnectorStateImpl.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/SecureConnectorStateImpl.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -24,8 +24,6 @@
package org.teiid.connector.xml.base;
-import java.util.Properties;
-
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.xml.SecureConnectorState;
import org.teiid.connector.xml.TrustedPayloadHandler;
@@ -63,13 +61,6 @@
getTrustDeserializerInstance();
}
- @Override
- public Properties getState() {
- Properties props = super.getState();
- props.setProperty(SECURITY_DESERIALIZER_CLASS, getSecurityDeserializerClass());
- return props;
- }
-
private void setSecurityDeserializerClass(String secClass) {
securityDeserializerClass = secClass;
}
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnector.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnector.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnector.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -29,7 +29,6 @@
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ConnectorLogger;
import org.teiid.connector.basic.BasicConnector;
-import org.teiid.connector.basic.BasicManagedConnectionFactory;
import org.teiid.connector.xml.StatefulConnector;
import org.teiid.connector.xml.XMLConnectorState;
import org.teiid.connector.xml.http.HTTPConnectorState;
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -24,10 +24,6 @@
package org.teiid.connector.xml.base;
import java.io.InputStream;
-import java.sql.SQLXML;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
import org.teiid.connector.api.ConnectorCapabilities;
import org.teiid.connector.api.ConnectorException;
@@ -53,24 +49,12 @@
private String m_pluggableInputStreamFilterClass;
- public static final String CACHE_ENABLED = "CacheEnabled"; //$NON-NLS-1$
+ public static final String SAX_FILTER_PROVIDER_CLASS_DEFAULT = "";
//$NON-NLS-1$
- public static final String LOG_REQUEST_RESPONSE_DOCS =
"LogRequestResponseDocs"; //$NON-NLS-1$
-
- public static final String SAX_FILTER_PROVIDER_CLASS =
"SaxFilterProviderClass"; //$NON-NLS-1$
-
- public static final String QUERY_PREPROCESS_CLASS =
"QueryPreprocessorClass"; //$NON-NLS-1$
+ public static final String QUERY_PREPROCESS_CLASS_DEFAULT = "";
//$NON-NLS-1$
- public static final String INPUT_STREAM_FILTER_CLASS =
"InputStreamFilterClass"; //$NON-NLS-1$
+ private static final String INPUT_STREAM_FILTER_CLASS_DEFAULT = "";
//$NON-NLS-1$
- public static final String SAX_FILTER_PROVIDER_CLASS_DEFAULT =
"com.metamatrix.connector.xml.base.NoExtendedFilters"; //$NON-NLS-1$
-
- public static final String QUERY_PREPROCESS_CLASS_DEFAULT =
"com.metamatrix.connector.xml.base.NoQueryPreprocessing"; //$NON-NLS-1$
-
- private static final String INPUT_STREAM_FILTER_CLASS_DEFAULT =
"com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl";
//$NON-NLS-1$
-
- public static final String CONNECTOR_CAPABILITES =
"ConnectorCapabilities";
-
protected ConnectorLogger logger;
private IQueryPreprocessor preprocessor;
@@ -79,11 +63,6 @@
private ConnectorCapabilities capabilites;
-
- private boolean caching = false;
-
- private Map<String, SQLXML> responses = new ConcurrentHashMap<String,
SQLXML>();
-
public XMLConnectorStateImpl() {
setPreprocess(true);
setLogRequestResponse(false);
@@ -96,37 +75,28 @@
if (logger == null) {
throw new RuntimeException("Internal Exception: logger is null");
}
- setCaching(env.getCacheEnabled());
setLogRequestResponse(env.getLogRequestResponseDocs());
setCapabilites(loadConnectorCapabilities(env.getCapabilitiesClass()));
String provider = env.getSaxFilterProviderClass();
- if (provider != null && !provider.equals("")) {
+ if (provider != null &&
!provider.equals(SAX_FILTER_PROVIDER_CLASS_DEFAULT)) {
setSaxProviderClass(provider);
setSAXFilterProvider(loadSAXFilter(getSaxProviderClass()));
}
String preprocessor = env.getQueryPreprocessorClass();
- if (preprocessor != null && !preprocessor.equals("")) {
+ if (preprocessor != null &&
!preprocessor.equals(QUERY_PREPROCESS_CLASS_DEFAULT)) {
setQueryPreprocessorClass(preprocessor);
setPreprocessor(loadPreprocessor(getQueryPreprocessorClass()));
}
String streamFilter = env.getInputStreamFilterClass();
- if(streamFilter != null && !streamFilter.equals("")) {
+ if(streamFilter != null &&
!streamFilter.equals(INPUT_STREAM_FILTER_CLASS_DEFAULT)) {
setPluggableInputStreamFilterClass(streamFilter);
}
}
- private void setCaching(Boolean caching) {
- this.caching = caching;
- }
-
- public boolean isCaching() {
- return this.caching;
- }
-
private ConnectorCapabilities loadConnectorCapabilities(
String connectorCapabilitiesClass) throws ConnectorException {
ConnectorCapabilities caps = null;
@@ -158,15 +128,6 @@
return logger;
}
- public java.util.Properties getState() {
- Properties props = new Properties();
- props.setProperty(LOG_REQUEST_RESPONSE_DOCS, Boolean
- .toString(isLogRequestResponse()));
- props.setProperty(SAX_FILTER_PROVIDER_CLASS, getSaxProviderClass());
- props.setProperty(QUERY_PREPROCESS_CLASS, getQueryPreprocessorClass());
- return props;
- }
-
protected boolean isNotNullOrEmpty(String value) {
return (value != null && !value.equals(""));
}
@@ -316,16 +277,4 @@
return stream;
}
- @Override
- public SQLXML getResponse(String key) {
- return this.responses.get(key);
- }
-
- public void setResponse(String key, SQLXML xml) {
- this.responses.put(key, xml);
- }
-
- public void removeResponse(String key) {
- this.responses.remove(key);
- }
}
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPExecutor.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPExecutor.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPExecutor.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -76,7 +76,7 @@
}
@Override
- public void closeStreams() {
+ public void close() {
for(HTTPRequest request : this.requests) {
if (request != null) {
request.release();
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPManagedConnectionFactory.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPManagedConnectionFactory.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPManagedConnectionFactory.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -155,16 +155,6 @@
this.connectorStateClass = connectorStateClass;
}
- private boolean cacheEnabled;
-
- public boolean getCacheEnabled() {
- return this.cacheEnabled;
- }
-
- public void setCacheEnabled(Boolean cacheEnabled) {
- this.cacheEnabled = cacheEnabled;
- }
-
private boolean logRequestResponseDocs;
public boolean getLogRequestResponseDocs() {
Modified:
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java
===================================================================
---
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/http/HTTPRequest.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -91,14 +91,14 @@
CriteriaDesc criterion = this.exeInfo.getResponseIDCriterion();
if (criterion != null) {
String responseid = (String) (criterion.getValues().get(0));
- SQLXML xml = this.state.getResponse(responseid);
+ SQLXML xml = this.config.getResponse(responseid);
Assertion.isNotNull(xml);
document = new DocumentImpl(xml, responseid);
} else {
// Not a join, but might still be cached.
// Not cached, so make the request
SQLXML responseBody = executeRequest();
- this.state.setResponse(this.context.getExecutionCountIdentifier(), responseBody);
+ this.config.setResponse(this.context.getExecutionCountIdentifier(), responseBody);
this.response = responseBody;
//InputStream filteredStream = getState().addStreamFilters(responseBody);
document = new DocumentImpl(responseBody,
this.context.getExecutionCountIdentifier());
@@ -140,7 +140,7 @@
request.releaseConnection();
}
if (response != null) {
- this.state.removeResponse(this.context.getExecutionCountIdentifier());
+ this.config.removeResponse(this.context.getExecutionCountIdentifier());
try {
response.free();
} catch (SQLException e) {
Modified: trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml 2010-03-25 12:11:07
UTC (rev 1998)
+++ trunk/connectors/connector-xml-http/src/main/rar/META-INF/ra.xml 2010-03-25 15:15:25
UTC (rev 1999)
@@ -38,13 +38,13 @@
<outbound-resourceadapter>
<connection-definition>
-
<managedconnectionfactory-class>com.metamatrix.connector.xml.http.HTTPManagedConnectionFactory</managedconnectionfactory-class>
+
<managedconnectionfactory-class>org.teiid.connector.xml.http.HTTPManagedConnectionFactory</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>com.metamatrix.connector.xml.base.XMLConnector</config-property-value>
+
<config-property-value>org.teiid.connector.xml.base.XMLConnector</config-property-value>
</config-property>
<config-property>
@@ -88,7 +88,7 @@
<description>{$display:"XML Filter
Provider",$description:"The class the provides extended XML
Filters",$advanced:"true"}</description>
<config-property-name>SaxFilterProviderClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
@@ -115,7 +115,7 @@
<description>{$display:"Connector State
Class",$required:"true",$advanced:"true"}</description>
<config-property-name>ConnectorStateClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.http.HTTPConnectorState</config-property-value>
+
<config-property-value>org.teiid.connector.xml.http.HTTPConnectorState</config-property-value>
</config-property>
<config-property>
@@ -168,7 +168,7 @@
<description>{$display:"Trust Deserializer
Class",$description:"The class to use to process trusted payloads and execution
payloads",$advanced:"true"}</description>
<config-property-name>TrustDeserializerClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.http.DefaultTrustDeserializer</config-property-value>
+
<config-property-value>org.teiid.connector.xml.http.DefaultTrustDeserializer</config-property-value>
</config-property>
<config-property>
@@ -182,7 +182,7 @@
<description>{$display:"Input Stream Filter
Class",$description:"The class to use to preprocess raw XML input
stream",$advanced:"true"}</description>
<config-property-name>InputStreamFilterClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
@@ -195,7 +195,7 @@
<description>{$display:"Query Preprocessor
Class",$description:"The class to use to preprocess the
IQuery",$advanced:"true"}</description>
<config-property-name>QueryPreprocessorClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.NoQueryPreprocessing</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
Modified:
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java
===================================================================
---
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -4,9 +4,8 @@
import org.teiid.connector.xml.SecureConnectorState;
import org.teiid.connector.xml.XMLConnectorState;
-import org.teiid.connector.xml.base.XMLConnectorStateImpl;
-
+@SuppressWarnings("nls")
public class FakeHttpProperties {
public static Properties getDefaultXMLRequestProps() {
Properties defaultHTTPProps = getDefaultHttpProps();
@@ -16,8 +15,6 @@
public static Properties getDefaultHttpProps() {
Properties testHTTPProps = new Properties();
- testHTTPProps.put(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE);
- testHTTPProps.put(XMLConnectorStateImpl.CONNECTOR_CAPABILITES,
"com.metamatrix.connector.xml.base.XMLCapabilities");
testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP,
"com.metamatrix.connector.xml.http.HTTPConnectorState");
testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD,HTTPConnectorState.GET);
testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD,HTTPConnectorState.PARAMETER_XML_REQUEST);
@@ -36,7 +33,6 @@
public static Properties getDefaultHTTPProps() {
Properties testHTTPProps = new Properties();
- testHTTPProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED,
Boolean.TRUE.toString());
testHTTPProps.setProperty(HTTPConnectorState.URI,
"http://localhost:8673"); //$NON-NLS-1$
testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60");
//$NON-NLS-1$
testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP,
"com.metamatrix.connector.xml.http.HTTPConnectorState"); //$NON-NLS-1$
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPRequest.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPRequest.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -22,6 +22,7 @@
package org.teiid.connector.xmlsource.soap;
import java.io.StringReader;
+import java.sql.SQLException;
import java.sql.SQLXML;
import java.util.ArrayList;
import java.util.Iterator;
@@ -37,7 +38,6 @@
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;
-import org.teiid.connector.api.CacheScope;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.xmlsource.XMLSourcePlugin;
@@ -121,14 +121,14 @@
CriteriaDesc criterion = this.executionInfo.getResponseIDCriterion();
if (criterion != null) {
String responseid = (String) (criterion.getValues().get(0));
- SQLXML xml = (SQLXML)this.context.getFromCache(CacheScope.REQUEST,
responseid);
+ SQLXML xml = this.config.getResponse(responseid);
Assertion.isNotNull(xml);
document = new DocumentImpl(xml, responseid);
} else {
// Not a join, but might still be cached.
// Not cached, so make the request
SQLXML responseBody = executeRequest();
-
this.context.storeInCache(CacheScope.REQUEST,this.context.getExecutionCountIdentifier(),
responseBody);
+ this.config.setResponse(this.context.getExecutionCountIdentifier(),
responseBody);
//InputStream filteredStream = getState().addStreamFilters(responseBody);
document = new DocumentImpl(responseBody,
this.context.getExecutionCountIdentifier());
}
@@ -179,7 +179,7 @@
// I should be able to send no value here, but the dispatch throws an
exception
// if soapAction == null. We allow the default "" to get sent in
that case.
// In SOAP 1.1 we must send a SoapAction.
- String soapAction =
(String)this.executionInfo.getOtherProperties().get("SOAPAction");
+ String soapAction =
this.executionInfo.getOtherProperties().get("SOAPAction");
if(null != soapAction) {
dispatch.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY,
soapAction);
}
@@ -198,12 +198,20 @@
}
}
+ public void release() {
+ SQLXML response =
this.config.removeResponse(this.context.getExecutionCountIdentifier());
+ if (response != null) {
+ try {
+ response.free();
+ } catch (SQLException e) {
+ }
+ }
+ }
+
private SQLXML createSQLXML(Source output) {
return (SQLXML)this.config.getTypeFacility().convertToRuntimeType(output);
}
-
-
public int getDocumentCount() throws ConnectorException {
return 1;
}
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPResultSetExecution.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPResultSetExecution.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SOAPResultSetExecution.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -75,13 +75,10 @@
@Override
public void close() throws ConnectorException {
- closeStreams();
+ for (SOAPRequest request : requests) {
+ request.release();
+ }
}
-
- @Override
- public void closeStreams() {
- // do clean up?
- }
@Override
public Iterator<Document> getXMLDocuments() throws ConnectorException {
Modified:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapRequest.java
===================================================================
---
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapRequest.java 2010-03-25
12:11:07 UTC (rev 1998)
+++
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/soap/SoapRequest.java 2010-03-25
15:15:25 UTC (rev 1999)
@@ -27,7 +27,6 @@
import javax.xml.transform.Source;
-import org.teiid.connector.DataPlugin;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.xmlsource.XMLSourcePlugin;
import org.teiid.connector.xmlsource.soap.ServiceOperation.ExcutionFailedException;
@@ -101,15 +100,8 @@
}
}
- protected SQLXML convertToXMLType(Source value) throws ConnectorException {
- if (value == null) {
- return null;
- }
- Object result = env.getTypeFacility().convertToRuntimeType(value);
- if (!(result instanceof SQLXML)) {
- throw new
ConnectorException(DataPlugin.Util.getString("unknown_object_type_to_tranfrom_xml"));
//$NON-NLS-1$
- }
- return (SQLXML)result;
+ protected SQLXML convertToXMLType(Source value) {
+ return (SQLXML)env.getTypeFacility().convertToRuntimeType(value);
}
public List<?> getOutputParameterValues() throws ConnectorException {
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-25 12:11:07
UTC (rev 1998)
+++ trunk/connectors/connector-xml-soap/src/main/rar/META-INF/ra.xml 2010-03-25 15:15:25
UTC (rev 1999)
@@ -175,7 +175,7 @@
<description>{$display:"XML Filter
Provider",$description:"The class the provides extended XML
Filters",$advanced:"true"}</description>
<config-property-name>SaxFilterProviderClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>