com.metamatrix.connector.xml.http
Class HTTPExecutor

java.lang.Object
  extended by com.metamatrix.connector.xml.http.HTTPExecutor
All Implemented Interfaces:
ResultProducer
Direct Known Subclasses:
SOAPExecutor

public class HTTPExecutor
extends java.lang.Object
implements ResultProducer


Field Summary
protected  XMLExecution execution
           
protected  HTTPRequestor m_requestor
           
static java.lang.String PARM_INPUT_NAMESPACE_TABLE_PROPERTY_NAME
           
static java.lang.String PARM_INPUT_XPATH_TABLE_PROPERTY_NAME
           
protected  org.apache.commons.httpclient.HttpMethod request
           
 
Constructor Summary
HTTPExecutor(XMLConnectorState state, XMLExecution execution, ExecutionInfo exeInfo)
           
 
Method Summary
protected  void addGetValues(org.apache.commons.httpclient.NameValuePair[] pairs, org.apache.commons.httpclient.HttpMethod method)
           
protected  void addPostValues(org.apache.commons.httpclient.NameValuePair[] pairs, org.apache.commons.httpclient.methods.PostMethod method)
           
 java.io.InputStream addStreamFilters(java.io.InputStream response, ConnectorLogger logger)
           
protected  void attemptConditionalLog(java.lang.String message)
           
protected  org.jdom.Document buildInputXMLDocument(java.util.List parameters, java.lang.String inputParmsXPath)
           
protected  java.lang.String buildRawUriString()
           
protected  java.lang.String buildUriString()
           
 boolean cannotProjectParameter(CriteriaDesc parmCriteria)
           
static boolean checkIfRequestIsNeeded(ExecutionInfo info)
          Examines the Query to determine if a request to a source is needed.
 void closeStreams()
           
protected  org.apache.commons.httpclient.NameValuePair[] createNameValuePairs(java.util.List paramPairs)
           
protected  org.jdom.Document createXMLRequestDoc(java.util.List parameterPairs)
           
protected  java.lang.String createXMLRequestDocString(java.util.List parameterPairs)
           
protected  org.apache.commons.httpclient.NameValuePair[] generatePairs(java.lang.String pairString)
           
 boolean getAllowHttp500()
           
protected  java.lang.String getCacheKey()
           
protected  java.io.InputStream getDocumentStream()
           
protected  ExecutionInfo getExeInfo()
           
protected  ConnectorLogger getLogger()
           
 java.io.Serializable getRequestObject(int i)
           
protected  HTTPConnectorState getState()
           
 java.util.Iterator<Document> getXMLDocuments()
          Gets all the InputStreams for a single ExecutionInfo instance.
protected  void modifyRequest(org.apache.commons.httpclient.HttpClient client, org.apache.commons.httpclient.HttpMethod method)
           
protected  void releaseDocumentStream()
           
protected  java.lang.String removeAngleBrackets(java.lang.String uri)
           
protected  void setRequests(java.util.List params, java.lang.String bindingURIValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

execution

protected XMLExecution execution

m_requestor

protected HTTPRequestor m_requestor

request

protected org.apache.commons.httpclient.HttpMethod request

PARM_INPUT_XPATH_TABLE_PROPERTY_NAME

public static final java.lang.String PARM_INPUT_XPATH_TABLE_PROPERTY_NAME
See Also:
Constant Field Values

PARM_INPUT_NAMESPACE_TABLE_PROPERTY_NAME

public static final java.lang.String PARM_INPUT_NAMESPACE_TABLE_PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

HTTPExecutor

public HTTPExecutor(XMLConnectorState state,
                    XMLExecution execution,
                    ExecutionInfo exeInfo)
             throws ConnectorException
Parameters:
state -
execution -
exeInfo -
Throws:
ConnectorException
Method Detail

releaseDocumentStream

protected void releaseDocumentStream()

getCacheKey

protected java.lang.String getCacheKey()
                                throws ConnectorException
Throws:
ConnectorException

getDocumentStream

protected java.io.InputStream getDocumentStream()
                                         throws ConnectorException
Throws:
ConnectorException

getXMLDocuments

public java.util.Iterator<Document> getXMLDocuments()
                                             throws ConnectorException
Description copied from interface: ResultProducer
Gets all the InputStreams for a single ExecutionInfo instance. This could be any number or streams and is implementation dependent.

Specified by:
getXMLDocuments in interface ResultProducer
Returns:
Throws:
ConnectorException

modifyRequest

protected void modifyRequest(org.apache.commons.httpclient.HttpClient client,
                             org.apache.commons.httpclient.HttpMethod method)
                      throws ConnectorException
Throws:
ConnectorException

cannotProjectParameter

public boolean cannotProjectParameter(CriteriaDesc parmCriteria)

buildInputXMLDocument

protected org.jdom.Document buildInputXMLDocument(java.util.List parameters,
                                                  java.lang.String inputParmsXPath)
                                           throws ConnectorException
Throws:
ConnectorException

createNameValuePairs

protected org.apache.commons.httpclient.NameValuePair[] createNameValuePairs(java.util.List paramPairs)
                                                                      throws ConnectorException
Throws:
ConnectorException

setRequests

protected void setRequests(java.util.List params,
                           java.lang.String bindingURIValue)
                    throws ConnectorException
Throws:
ConnectorException

addGetValues

protected void addGetValues(org.apache.commons.httpclient.NameValuePair[] pairs,
                            org.apache.commons.httpclient.HttpMethod method)
                     throws ConnectorException
Throws:
ConnectorException

addPostValues

protected void addPostValues(org.apache.commons.httpclient.NameValuePair[] pairs,
                             org.apache.commons.httpclient.methods.PostMethod method)
                      throws ConnectorException
Throws:
ConnectorException

createXMLRequestDoc

protected org.jdom.Document createXMLRequestDoc(java.util.List parameterPairs)
                                         throws ConnectorException
Throws:
ConnectorException

createXMLRequestDocString

protected java.lang.String createXMLRequestDocString(java.util.List parameterPairs)
                                              throws ConnectorException
Throws:
ConnectorException

generatePairs

protected org.apache.commons.httpclient.NameValuePair[] generatePairs(java.lang.String pairString)

getRequestObject

public java.io.Serializable getRequestObject(int i)
                                      throws ConnectorException
Throws:
ConnectorException

getAllowHttp500

public boolean getAllowHttp500()

closeStreams

public void closeStreams()
Specified by:
closeStreams in interface ResultProducer

getExeInfo

protected ExecutionInfo getExeInfo()

getState

protected HTTPConnectorState getState()

buildUriString

protected java.lang.String buildUriString()

getLogger

protected ConnectorLogger getLogger()

buildRawUriString

protected java.lang.String buildRawUriString()

addStreamFilters

public java.io.InputStream addStreamFilters(java.io.InputStream response,
                                            ConnectorLogger logger)
                                     throws ConnectorException
Throws:
ConnectorException

checkIfRequestIsNeeded

public static boolean checkIfRequestIsNeeded(ExecutionInfo info)
                                      throws ConnectorException
Examines the Query to determine if a request to a source is needed. If any of the request parameters is a ResponseIn, then we don't need to make a request because it has already been made by another call to Execution.execute()

Throws:
ConnectorException

removeAngleBrackets

protected java.lang.String removeAngleBrackets(java.lang.String uri)

attemptConditionalLog

protected void attemptConditionalLog(java.lang.String message)


Copyright © 2009. All Rights Reserved.