Author: jdoyle
Date: 2009-09-02 14:20:57 -0400 (Wed, 02 Sep 2009)
New Revision: 1305
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java
trunk/connectors/connector-xml/src/main/resources/connector-xml.xml
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java
Log:
TEEID-816
XML-Relational File connector throws NPE.
Cleaned up some cruft left over from the cache change.
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java
===================================================================
---
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java 2009-09-02
15:28:03 UTC (rev 1304)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java 2009-09-02
18:20:57 UTC (rev 1305)
@@ -33,29 +33,10 @@
public static final String STATE_CLASS_PROP = "ConnectorStateClass";
//$NON-NLS-1$
- /**
- * @return Returns the m_cacheTimeout.
- */
- public abstract int getCacheTimeoutSeconds();
-
- public abstract int getCacheTimeoutMillis();
-
public abstract boolean isPreprocess();
public abstract ConnectorCapabilities getConnectorCapabilities();
- public abstract int getMaxMemoryCacheSizeByte();
-
- public abstract int getMaxMemoryCacheSizeKB();
-
- public abstract int getMaxInMemoryStringSize();
-
- public abstract int getMaxFileCacheSizeKB();
-
- public abstract int getMaxFileCacheSizeByte();
-
- public abstract String getCacheLocation();
-
public abstract boolean isLogRequestResponse();
public abstract SAXFilterProvider getSAXFilterProvider();
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java
===================================================================
---
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java 2009-09-02
15:28:03 UTC (rev 1304)
+++
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java 2009-09-02
18:20:57 UTC (rev 1305)
@@ -37,18 +37,8 @@
public abstract class XMLConnectorStateImpl implements Cloneable,
XMLConnectorState {
- private int m_cacheTimeout;
-
- private int m_maxMemoryCacheSize;
-
- private int m_maxInMemoryStringSize;
-
- private int m_maxFileCacheSize;
-
private boolean m_preprocess;
- private String m_cacheLocation;
-
private String m_saxProviderClass;
private String m_queryPreprocessorClass;
@@ -57,22 +47,8 @@
private String m_pluggableInputStreamFilterClass;
- private static final int SECONDS_TO_MILLIS = 1000;
-
- private static final int KB_TO_BYTES = 1000;
-
- public static final String CACHE_TIMEOUT = "CacheTimeout"; //$NON-NLS-1$
-
public static final String CACHE_ENABLED = "CacheEnabled"; //$NON-NLS-1$
- public static final String MAX_IN_MEMORY_STRING_SIZE =
"MaxInMemoryStringSize"; //$NON-NLS-1$
-
- public static final String MAX_MEMORY_CACHE_SIZE = "MaxMemoryCacheSize";
//$NON-NLS-1$
-
- public static final String MAX_FILE_CACHE_SIZE = "MaxFileCacheSize";
//$NON-NLS-1$
-
- public static final String FILE_CACHE_LOCATION = "FileCacheLocation";
//$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$
@@ -99,16 +75,9 @@
private String capabilitiesClass;
- private Boolean caching;
+ private boolean caching = false;
public XMLConnectorStateImpl() {
- final int defaultCacheTimeoutMillis = 60000;
- final int defaultMemoryCacheSize = 512;
- final int defaultFileCacheSize = -1; // unbounded
- setCacheTimeoutMillis(defaultCacheTimeoutMillis);
- setMaxMemoryCacheSizeKB(defaultMemoryCacheSize);
- setMaxInMemoryStringSize(128 * 1024);
- setMaxFileCacheSizeKB(defaultFileCacheSize);
setPreprocess(true);
setLogRequestResponse(false);
setSaxProviderClass(SAX_FILTER_PROVIDER_CLASS_DEFAULT);
@@ -127,33 +96,6 @@
setCaching(caching);
}
- String cache = props.getProperty(CACHE_TIMEOUT);
- if (cache != null) {
- setCacheTimeoutSeconds(Integer.parseInt(cache));
- }
- String maxMCache = props.getProperty(MAX_MEMORY_CACHE_SIZE);
- if (maxMCache != null) {
- setMaxMemoryCacheSizeKB(Integer.parseInt(maxMCache));
- }
-
- String maxStringSize = props.getProperty(MAX_IN_MEMORY_STRING_SIZE);
- if (maxStringSize != null) {
- setMaxInMemoryStringSize(Integer.parseInt(maxStringSize) * 1024);
- }
-
- String maxFCache = props.getProperty(MAX_FILE_CACHE_SIZE);
- if (maxFCache != null) {
- setMaxFileCacheSizeKB(Integer.parseInt(maxFCache));
- }
-
- String cacheLoc = props.getProperty(FILE_CACHE_LOCATION);
- if (cacheLoc != null) {
- setCacheLocation(cacheLoc);
- } else {
- String temp = System.getProperty("java.io.tmpdir");
- setCacheLocation(temp);
- }
-
String logReqRes = props.getProperty(LOG_REQUEST_RESPONSE_DOCS);
if (logReqRes != null) {
setLogRequestResponse(Boolean.valueOf(logReqRes).booleanValue());
@@ -241,21 +183,8 @@
public java.util.Properties getState() {
Properties props = new Properties();
- props.setProperty(CACHE_TIMEOUT, Integer
- .toString(getCacheTimeoutSeconds()));
- props.setProperty(MAX_MEMORY_CACHE_SIZE, Integer
- .toString(getMaxMemoryCacheSizeKB()));
- props.setProperty(MAX_IN_MEMORY_STRING_SIZE, Integer
- .toString(getMaxInMemoryStringSize()));
- props.setProperty(MAX_FILE_CACHE_SIZE, Integer
- .toString(getMaxFileCacheSizeKB()));
props.setProperty(LOG_REQUEST_RESPONSE_DOCS, Boolean
.toString(isLogRequestResponse()));
- String location = getCacheLocation();
- if (location == null) {
- location = "";//$NON-NLS-1$
- }
- props.setProperty(FILE_CACHE_LOCATION, location);
props.setProperty(SAX_FILTER_PROVIDER_CLASS, getSaxProviderClass());
props.setProperty(QUERY_PREPROCESS_CLASS, getQueryPreprocessorClass());
return props;
@@ -265,39 +194,6 @@
return (value != null && !value.equals(""));
}
- /**
- * @param m_cacheTimeout
- * The m_cacheTimeout to set.
- */
- private final void setCacheTimeoutSeconds(int cacheTimeoutseconds) {
-
- m_cacheTimeout = cacheTimeoutseconds * SECONDS_TO_MILLIS;
- }
-
- private final void setCacheTimeoutMillis(int cacheTimeoutmillis) {
-
- m_cacheTimeout = cacheTimeoutmillis;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.metamatrix.connector.xml.base.XMLConnectorState#getCacheTimeoutSeconds()
- */
- public final int getCacheTimeoutSeconds() {
- return m_cacheTimeout / SECONDS_TO_MILLIS;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.metamatrix.connector.xml.base.XMLConnectorState#getCacheTimeoutMillis()
- */
- public final int getCacheTimeoutMillis() {
- return m_cacheTimeout;
- }
-
private void setPreprocess(boolean preprocess) {
this.m_preprocess = preprocess;
}
@@ -324,84 +220,7 @@
this.capabilites = capabilities;
}
- private void setMaxMemoryCacheSizeKB(int maxMemoryCacheSizeKB) {
- m_maxMemoryCacheSize = maxMemoryCacheSizeKB * KB_TO_BYTES;
- }
- private void setMaxMemoryCacheSizeBytes(int maxMemoryCacheSizeByte) {
- m_maxMemoryCacheSize = maxMemoryCacheSizeByte;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
com.metamatrix.connector.xml.base.XMLConnectorState#getMaxMemoryCacheSizeByte()
- */
- public int getMaxMemoryCacheSizeByte() {
- return m_maxMemoryCacheSize;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
com.metamatrix.connector.xml.base.XMLConnectorState#getMaxMemoryCacheSizeKB()
- */
- public int getMaxMemoryCacheSizeKB() {
- return m_maxMemoryCacheSize / KB_TO_BYTES;
- }
-
- private void setMaxInMemoryStringSize(int maxInMemoryStringSize) {
- m_maxInMemoryStringSize = maxInMemoryStringSize;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
com.metamatrix.connector.xml.base.XMLConnectorState#getMaxInMemoryStringSize()
- */
- public int getMaxInMemoryStringSize() {
- return m_maxInMemoryStringSize;
- }
-
- private void setMaxFileCacheSizeByte(int maxFileCacheSize) {
- m_maxFileCacheSize = maxFileCacheSize;
- }
-
- private void setMaxFileCacheSizeKB(int maxFileCacheSize) {
- m_maxFileCacheSize = maxFileCacheSize * KB_TO_BYTES;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.metamatrix.connector.xml.base.XMLConnectorState#getMaxFileCacheSizeKB()
- */
- public int getMaxFileCacheSizeKB() {
- return m_maxFileCacheSize / KB_TO_BYTES;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
com.metamatrix.connector.xml.base.XMLConnectorState#getMaxFileCacheSizeByte()
- */
- public int getMaxFileCacheSizeByte() {
- return m_maxFileCacheSize;
- }
-
- private void setCacheLocation(String cacheLocation) {
- m_cacheLocation = cacheLocation;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.metamatrix.connector.xml.base.XMLConnectorState#getCacheLocation()
- */
- public String getCacheLocation() {
- return m_cacheLocation;
- }
-
private void setLogRequestResponse(boolean logRequestResponse) {
m_logRequestResponse = logRequestResponse;
}
Modified: trunk/connectors/connector-xml/src/main/resources/connector-xml.xml
===================================================================
--- trunk/connectors/connector-xml/src/main/resources/connector-xml.xml 2009-09-02
15:28:03 UTC (rev 1304)
+++ trunk/connectors/connector-xml/src/main/resources/connector-xml.xml 2009-09-02
18:20:57 UTC (rev 1305)
@@ -27,30 +27,22 @@
<PropertyDefinition Name="TrustType" DisplayName="Trust
Type:(DirectReference or IssuerSerial)" ShortDescription="Only required for
Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the
service are known to the service and have pre-registered their certificate chains before
using the service. The direct-reference method presumes that the service operator trusts
all users with certificates issued by a trusted CA."
DefaultValue="DirectReference" IsExpert="true" />
</ComponentType>
<ComponentType Name="XML-Relational File Connector"
ComponentTypeCode="2" Deployable="true" Deprecated="false"
Monitorable="false" SuperComponentType="XML Connector"
ParentComponentType="Connectors"
LastChangedDate="2008-10-31T10:26:19.918-06:00"
CreationDate="2008-10-31T10:26:19.918-06:00">
- <PropertyDefinition Name="TextExtractionThreshold"
DisplayName="Text Extraction Threshold (in kb)" ShortDescription="extract
text sections larger than this size to a file where more efficient access as a CLOB can be
effected." DefaultValue="128" PropertyType="Integer"
IsExpert="true" />
<PropertyDefinition Name="FilePath" DisplayName="File
Path" ShortDescription="" IsRequired="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard
Type" ShortDescription="Standard Built-in Connector Type"
DefaultValue="true" PropertyType="Boolean" IsExpert="true"
IsModifiable="false" />
- <PropertyDefinition Name="FileCacheLocation"
DisplayName="Location of the File Cache" ShortDescription=""
DefaultValue="" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache
Timeout (in seconds)" ShortDescription="" DefaultValue="60"
IsRequired="true" PropertyType="Integer" />
+ <PropertyDefinition Name="CacheEnabled" DisplayName="Enable
Document Caching" ShortDescription="" DefaultValue="false"
IsRequired="true" PropertyType="Boolean" />
<PropertyDefinition Name="SaxFilterProviderClass"
DisplayName="XML Filter Provider" ShortDescription="The class the provides
extended XML Filters"
DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters"
IsExpert="true" />
<PropertyDefinition Name="ConnectorClass"
DisplayName="Connector Class" ShortDescription=""
DefaultValue="com.metamatrix.connector.xml.base.XMLConnector"
IsRequired="true" IsExpert="true" />
- <PropertyDefinition Name="MaxFileCacheSize"
DisplayName="Max Size of file cache (in kb)" ShortDescription=""
DefaultValue="-1" IsRequired="true" PropertyType="Integer"
/>
<PropertyDefinition Name="ConnectorStateClass"
DisplayName="Connector State Class" ShortDescription=""
DefaultValue="com.metamatrix.connector.xml.file.FileConnectorState"
IsRequired="true" IsExpert="true" />
<PropertyDefinition Name="LogRequestResponseDocs"
DisplayName="Log XML Request and Response Documents"
ShortDescription="Write the request and response documents to the log at Info
level" DefaultValue="false" PropertyType="Boolean"
IsExpert="true" />
<PropertyDefinition Name="InputStreamFilterClass"
DisplayName="Input Stream Filter Class" ShortDescription="The class to use
to preprocess raw XML input stream"
DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl"
IsExpert="true" />
- <PropertyDefinition Name="MaxMemoryCacheSize"
DisplayName="Max Size of in-memory cache (in kb)" ShortDescription=""
DefaultValue="16384" IsRequired="true"
PropertyType="Integer" />
<PropertyDefinition Name="FileName" DisplayName="File
Name" ShortDescription="" DefaultValue="" />
<PropertyDefinition Name="QueryPreprocessorClass"
DisplayName="Query Preprocessor Class" ShortDescription="The class to use
to preprocess the IQuery"
DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing"
IsExpert="true" />
<PropertyDefinition Name="ConnectorCapabilities"
DisplayName="Connector Capabilities Class" ShortDescription="The class to
use to provide the Connector Capabilities"
DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities"
IsExpert="true" />
</ComponentType>
<ComponentType Name="XML-Relational HTTP Connector"
ComponentTypeCode="2" Deployable="true" Deprecated="false"
Monitorable="false" SuperComponentType="XML Connector"
ParentComponentType="Connectors"
LastChangedDate="2008-10-31T10:26:19.920-06:00"
CreationDate="2008-10-31T10:26:19.921-06:00">
- <PropertyDefinition Name="TextExtractionThreshold"
DisplayName="Text Extraction Threshold (in kb)" ShortDescription="Extract
text sections larger than this size to a file where more efficient access as a CLOB can be
effected." DefaultValue="128" PropertyType="Integer"
IsExpert="true" />
- <PropertyDefinition Name="FileCacheLocation"
DisplayName="Location of the File Cache" ShortDescription=""
DefaultValue="" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache
Timeout (in seconds)" ShortDescription="" DefaultValue="60"
IsRequired="true" PropertyType="Integer" />
<PropertyDefinition Name="SaxFilterProviderClass"
DisplayName="XML Filter Provider" ShortDescription="The class the provides
extended XML Filters"
DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters"
IsExpert="true" />
<PropertyDefinition Name="XMLParmName" DisplayName="XML
Parameter Name" ShortDescription="" />
<PropertyDefinition Name="RequestTimeout"
DisplayName="Request Timeout (in Milliseconds)" ShortDescription=""
DefaultValue="10000" IsRequired="true"
PropertyType="Integer" />
- <PropertyDefinition Name="MaxFileCacheSize"
DisplayName="Max Size of file cache (in kb)" ShortDescription=""
DefaultValue="-1" IsRequired="true" PropertyType="Integer"
/>
<PropertyDefinition Name="Authenticate"
DisplayName="Authentication Required" ShortDescription=""
DefaultValue="false" PropertyType="Boolean"
IsModifiable="true" />
<PropertyDefinition Name="ConnectorStateClass"
DisplayName="Connector State Class" ShortDescription=""
DefaultValue="com.metamatrix.connector.xml.http.HTTPConnectorState"
IsRequired="true" IsExpert="true" />
<PropertyDefinition Name="HttpBasicAuthPassword"
DisplayName="HTTP Basic Authentication Password" ShortDescription="Password
value for HTTP basic authentication" DefaultValue=""
IsExpert="true" IsMasked="true" />
@@ -59,7 +51,6 @@
<AllowedValue>post</AllowedValue>
</PropertyDefinition>
<PropertyDefinition Name="ProxyUri" DisplayName="Proxy
Server URI" ShortDescription="The URI of the proxy server"
DefaultValue="" />
- <PropertyDefinition Name="ExceptionOnIntraQueryCacheExpiration"
DisplayName="Exception On Intra-Query Cache Expiration"
ShortDescription="Throw an exception when a document expires from the cache between
executing different parts of a single query (instead of requesting the document
again)" DefaultValue="true" PropertyType="Boolean"
IsExpert="true" />
<PropertyDefinition Name="ConnectorCapabilities"
DisplayName="Connector Capabilities Class" ShortDescription="The class to
use to provide the Connector Capabilities"
DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities"
IsExpert="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard
Type" ShortDescription="Standard Built-in Connector Type"
DefaultValue="true" PropertyType="Boolean" IsExpert="true"
IsModifiable="false" />
<PropertyDefinition Name="HttpBasicAuthUserName"
DisplayName="HTTP Basic Authentication Name" ShortDescription="Name value
for HTTP basic authentication" DefaultValue="" IsExpert="true"
/>
@@ -74,23 +65,18 @@
<AllowedValue>XMLRequest</AllowedValue>
<AllowedValue>XMLInQueryString</AllowedValue>
</PropertyDefinition>
- <PropertyDefinition Name="MaxMemoryCacheSize"
DisplayName="Max Size of in-memory cache (in kb)" ShortDescription=""
DefaultValue="16384" IsRequired="true"
PropertyType="Integer" />
<PropertyDefinition Name="InputStreamFilterClass"
DisplayName="Input Stream Filter Class" ShortDescription="The class to use
to preprocess raw XML input stream"
DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl"
IsExpert="true" />
<PropertyDefinition Name="HostnameVerifier"
DisplayName="Hostname Verifier" ShortDescription="Class implementing
javax.net.ssl.HostnameVerifier. Used to implement a hostname mismatch workaround."
IsExpert="true" />
<PropertyDefinition Name="QueryPreprocessorClass"
DisplayName="Query Preprocessor Class" ShortDescription="The class to use
to preprocess the IQuery"
DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing"
IsExpert="true" />
</ComponentType>
<ComponentType Name="XML-Relational SOAP Connector"
ComponentTypeCode="2" Deployable="true" Deprecated="false"
Monitorable="false" SuperComponentType="XML Connector"
ParentComponentType="Connectors"
LastChangedDate="2008-10-31T10:26:19.919-06:00"
CreationDate="2008-10-31T10:26:19.919-06:00">
- <PropertyDefinition Name="TextExtractionThreshold"
DisplayName="Text Extraction Threshold (in kb)" ShortDescription="Extract
text sections larger than this size to a file where more efficient access as a CLOB can be
effected." DefaultValue="128" PropertyType="Integer"
IsExpert="true" />
<PropertyDefinition Name="AuthPassword"
DisplayName="Authentication User Password" ShortDescription="Password value
for authentication" DefaultValue="" IsExpert="true"
IsMasked="true" />
- <PropertyDefinition Name="FileCacheLocation"
DisplayName="Location of the File Cache" ShortDescription=""
DefaultValue="" />
<PropertyDefinition Name="SaxFilterProviderClass"
DisplayName="XML Filter Provider" ShortDescription="The class the provides
extended XML Filters"
DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters"
IsExpert="true" />
<PropertyDefinition Name="AuthUserName"
DisplayName="Authentication User Name" ShortDescription="Name value for
authentication" DefaultValue="" IsExpert="true" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache
Timeout (in seconds)" ShortDescription="" DefaultValue="60"
IsRequired="true" PropertyType="Integer" />
<PropertyDefinition Name="WSSecurityType"
DisplayName="WS-Security Type(UsernameToken, SAML..)"
ShortDescription="Type of WS-Security to be used; Combinations of multiple security
types can be used with a space in-between. Allowed types are: (UsernameToken,
UsernameToken-Digest, SAMLTokenUnsigned, SAMLTokenSigned, Signature, Timestamp,
Encrypt)" DefaultValue="" />
<PropertyDefinition Name="XMLParmName" DisplayName="XML
Parameter Name" ShortDescription="" DefaultValue=""
IsModifiable="false" />
<PropertyDefinition Name="EncryptUserName"
DisplayName="Encrypt UserName (only if Encrypt profile used)"
ShortDescription="The username to be used in the encryption; if blank uses auth
username" DefaultValue="" IsExpert="true" />
<PropertyDefinition Name="ExceptionOnSOAPFault"
DisplayName="Exception on SOAP Fault" ShortDescription="Throw connector
exception when SOAP fault is returned from source." DefaultValue="true"
PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="MaxFileCacheSize"
DisplayName="Max Size of file cache (in kb)" ShortDescription=""
DefaultValue="-1" IsRequired="true" PropertyType="Integer"
/>
<PropertyDefinition Name="RequestTimeout"
DisplayName="Request Timeout (in Milliseconds)" ShortDescription=""
DefaultValue="10000" IsRequired="true"
PropertyType="Integer" />
<PropertyDefinition Name="CryptoPropertyFile"
DisplayName="User Crypto Property File (If SAML or Signature profile used)"
ShortDescription="The file defines properties of cryptography;defines the
certificates;(crypto.properties)" DefaultValue="" IsExpert="true"
/>
<PropertyDefinition Name="ConnectorStateClass"
DisplayName="Connector State Class" ShortDescription=""
DefaultValue="com.metamatrix.connector.xml.soap.SOAPConnectorState"
IsRequired="true" IsExpert="true" />
@@ -101,7 +87,6 @@
</PropertyDefinition>
<PropertyDefinition Name="ProxyUri" DisplayName="Proxy
Server URI" ShortDescription="The URI of the proxy server"
DefaultValue="" />
<PropertyDefinition Name="EncryptPropertyFile"
DisplayName="Encrypt crypto property file (only if Encrypt profile used)"
ShortDescription="The file defines properties of cryptography for encryption of the
message;(crypto.properties)" DefaultValue="" IsExpert="true"
/>
- <PropertyDefinition Name="ExceptionOnIntraQueryCacheExpiration"
DisplayName="Exception On Intra-Query Cache Expiration"
ShortDescription="Throw an exception when a document expires from the cache between
executing different parts of a single query (instead of requesting the document
again)" DefaultValue="true" PropertyType="Boolean"
IsExpert="true" />
<PropertyDefinition Name="ConnectorCapabilities"
DisplayName="Connector Capabilities Class" ShortDescription="The class to
use to provide the Connector Capabilities"
DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities"
IsExpert="true" />
<PropertyDefinition Name="SAMLPropertyFile"
DisplayName="SAML Property File (only required when SAML profile used)"
ShortDescription="SAML Security property file (saml.properties)"
DefaultValue="" IsExpert="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard
Type" ShortDescription="Standard Built-in Connector Type"
DefaultValue="true" PropertyType="Boolean" IsExpert="true"
IsModifiable="false" />
@@ -123,7 +108,6 @@
<AllowedValue>XMLInQueryString</AllowedValue>
</PropertyDefinition>
<PropertyDefinition Name="InputStreamFilterClass"
DisplayName="Input Stream Filter Class" ShortDescription="The class to use
to preprocess raw XML input stream"
DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl"
IsExpert="true" />
- <PropertyDefinition Name="MaxMemoryCacheSize"
DisplayName="Max Size of in-memory cache (in kb)" ShortDescription=""
DefaultValue="16384" IsRequired="true"
PropertyType="Integer" />
<PropertyDefinition Name="HostnameVerifier"
DisplayName="Hostname Verifier" ShortDescription="a class implmenting
javax.net.ssl.HostnameVerifier. Used to implement a hostname mismatch workaround."
IsExpert="true" />
<PropertyDefinition Name="TrustType" DisplayName="Trust
Type:(DirectReference or IssuerSerial)" ShortDescription="Only required for
Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the
service are known to the service and have pre-registered their certificate chains before
using the service. The direct-reference method presumes that the service operator trusts
all users with certificates issued by a trusted CA."
DefaultValue="DirectReference" IsExpert="true" />
<PropertyDefinition Name="QueryPreprocessorClass"
DisplayName="Query Preprocessor Class" ShortDescription="The class to use
to preprocess the IQuery"
DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing"
IsExpert="true" />
Modified:
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java
===================================================================
---
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java 2009-09-02
15:28:03 UTC (rev 1304)
+++
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java 2009-09-02
18:20:57 UTC (rev 1305)
@@ -88,11 +88,7 @@
public static Properties getDefaultFileProps() {
Properties testFileProps = new Properties();
- testFileProps.put(XMLConnectorStateImpl.CACHE_TIMEOUT, new
String("500000"));
- testFileProps.put(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE, new
String("5000"));
- testFileProps.put(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE, new
String("5000"));
testFileProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED,
"false");
- testFileProps.put(XMLConnectorStateImpl.FILE_CACHE_LOCATION,
UnitTestUtil.getTestScratchPath()+"/test/cache");
testFileProps.setProperty(XMLConnectorState.STATE_CLASS_PROP,
"com.metamatrix.connector.xml.file.FileConnectorState");
testFileProps.setProperty(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS,
"com.metamatrix.connector.xml.base.NoQueryPreprocessing");
testFileProps.setProperty(XMLConnectorStateImpl.SAX_FILTER_PROVIDER_CLASS,
"com.metamatrix.connector.xml.base.NoExtendedFilters");
@@ -111,12 +107,7 @@
public static Properties getDefaultHTTPProps() {
Properties testHTTPProps = new Properties();
- testHTTPProps.setProperty(XMLConnectorStateImpl.CACHE_TIMEOUT, new
String("5000")); //$NON-NLS-1$
- testHTTPProps.setProperty(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE, new
String("50")); //$NON-NLS-1$
- testHTTPProps.setProperty(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE, new
String("50")); //$NON-NLS-1$
testHTTPProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED,
Boolean.TRUE.toString());
- testHTTPProps.setProperty(XMLConnectorStateImpl.FILE_CACHE_LOCATION,
UnitTestUtil.getTestScratchPath()+"/test/cache");//$NON-NLS-1$
- testHTTPProps.setProperty(XMLConnectorStateImpl.MAX_IN_MEMORY_STRING_SIZE,
"10"); //$NON-NSL-1$
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$
@@ -142,11 +133,7 @@
public static Properties getDefaultHttpProps() {
Properties testHTTPProps = new Properties();
- testHTTPProps.put(XMLConnectorStateImpl.CACHE_TIMEOUT, new
String("5000"));
- testHTTPProps.put(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE, new
String("5000"));
- testHTTPProps.put(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE, new
String("5000"));
testHTTPProps.put(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE);
- testHTTPProps.put(XMLConnectorStateImpl.FILE_CACHE_LOCATION,
UnitTestUtil.getTestScratchPath()+"/test/cache");
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(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS,
"com.metamatrix.connector.xml.base.NoQueryPreprocessing");
Modified:
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java
===================================================================
---
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java 2009-09-02
15:28:03 UTC (rev 1304)
+++
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java 2009-09-02
18:20:57 UTC (rev 1305)
@@ -60,20 +60,10 @@
}
public void testInitMethod() {
- //init test environment
XMLConnector connector = new XMLConnector();
try {
connector.start(m_env);
assertNotNull("state is null", connector.getState());
- XMLConnectorState state = connector.getState();
- Properties testFileProps = ProxyObjectFactory.getDefaultFileProps();
- assertEquals(state.getMaxMemoryCacheSizeKB(),
- Integer.parseInt((String)
testFileProps.get(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE)));
- assertEquals(state.getMaxFileCacheSizeKB(),
- Integer.parseInt((String)
testFileProps.get(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE)));
- assertEquals(state.getCacheLocation(), (String)
testFileProps.get(XMLConnectorStateImpl.FILE_CACHE_LOCATION));
- int expectedTimeout = Integer.parseInt((String)
testFileProps.get(XMLConnectorStateImpl.CACHE_TIMEOUT));
- assertEquals(state.getCacheTimeoutSeconds(), expectedTimeout);
assertNotNull("Logger is null", connector.getLogger());
} catch (ConnectorException ex) {
ex.printStackTrace();
@@ -138,11 +128,7 @@
XMLConnector connector = new XMLConnector();
try {
Properties testFileProps = new Properties();
- testFileProps.put(XMLConnectorStateImpl.CACHE_TIMEOUT, new
String("5000"));
- testFileProps.put(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE, new
String("50"));
- testFileProps.put(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE, new
String("50"));
testFileProps.put(XMLConnectorStateImpl.CACHE_ENABLED, Boolean.TRUE);
- testFileProps.put(XMLConnectorStateImpl.FILE_CACHE_LOCATION, new
String("./test/cache"));
testFileProps.setProperty(XMLConnectorState.STATE_CLASS_PROP,
"sure.to.Fail");
testFileProps.put(FileConnectorState.FILE_NAME,
"state_college.xml");
Modified:
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java
===================================================================
---
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java 2009-09-02
15:28:03 UTC (rev 1304)
+++
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java 2009-09-02
18:20:57 UTC (rev 1305)
@@ -54,12 +54,7 @@
@Override
public void setUp() {
m_testFileProps = new Properties();
- m_testFileProps.setProperty(XMLConnectorStateImpl.CACHE_TIMEOUT, new
String("5000"));
- m_testFileProps.setProperty(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE, new
String("50"));
- m_testFileProps.setProperty(XMLConnectorStateImpl.MAX_IN_MEMORY_STRING_SIZE, new
String("1280"));
- m_testFileProps.setProperty(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE, new
String("50"));
m_testFileProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, new
String("true"));
- m_testFileProps.setProperty(XMLConnectorStateImpl.FILE_CACHE_LOCATION, new
String("./test/cache"));
m_testFileProps.setProperty(XMLConnectorStateImpl.SAX_FILTER_PROVIDER_CLASS,
"com.metamatrix.connector.xml.base.NoExtendedFilters");
m_testFileProps.setProperty(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS,
"com.metamatrix.connector.xml.base.NoQueryPreprocessing");
m_testFileProps.put(XMLConnectorStateImpl.CONNECTOR_CAPABILITES,
"com.metamatrix.connector.xml.base.XMLCapabilities");
@@ -81,14 +76,6 @@
fail(ce.getMessage());
}
assertNotNull(state.getState());
- assertEquals(m_testFileProps.getProperty(XMLConnectorStateImpl.CACHE_TIMEOUT),
- state.getState().getProperty(XMLConnectorStateImpl.CACHE_TIMEOUT));
- assertEquals(m_testFileProps.getProperty(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE),
- state.getState().getProperty(XMLConnectorStateImpl.MAX_FILE_CACHE_SIZE));
-
assertEquals(m_testFileProps.getProperty(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE),
- state.getState().getProperty(XMLConnectorStateImpl.MAX_MEMORY_CACHE_SIZE));
- assertEquals(m_testFileProps.getProperty(XMLConnectorStateImpl.FILE_CACHE_LOCATION),
- state.getState().getProperty(XMLConnectorStateImpl.FILE_CACHE_LOCATION));
}
private class TestXMLConnectorStateImpl extends XMLConnectorStateImpl {