org.apache.xmlrpc.client
Class XmlRpcHttpTransport
java.lang.Object
org.apache.xmlrpc.client.XmlRpcTransportImpl
org.apache.xmlrpc.client.XmlRpcStreamTransport
org.apache.xmlrpc.client.XmlRpcHttpTransport
- All Implemented Interfaces:
- XmlRpcTransport
- Direct Known Subclasses:
- XmlRpcCommonsTransport, XmlRpcLiteHttpTransport, XmlRpcSunHttpTransport
public abstract class XmlRpcHttpTransport
- extends XmlRpcStreamTransport
Abstract base implementation of an HTTP transport. Base class for the
concrete implementations, like XmlRpcSunHttpTransport
,
or XmlRpcCommonsTransport
.
Field Summary |
static java.lang.String |
USER_AGENT
The user agent string. |
Method Summary |
protected java.io.InputStream |
getInputStream(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection,
byte[] pContent)
|
protected java.lang.String |
getUserAgent()
|
protected void |
initConnection(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection)
Initializes the newly created connection. |
protected abstract boolean |
isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection)
Returns, whether the response is gzip compressed. |
protected boolean |
isUsingByteArrayOutput(XmlRpcStreamRequestConfig pConfig)
If this method returns true, then the method
XmlRpcStreamTransport.newInputStream(XmlRpcStreamRequestConfig, Object, byte[])
will be invoked to create the response. |
protected void |
setCompressionHeaders(XmlRpcHttpClientConfig pConfig,
java.lang.Object pConnection)
|
protected void |
setContentLength(java.lang.Object pConnection,
int pLength)
|
protected void |
setCredentials(XmlRpcHttpClientConfig pConfig,
java.lang.Object pConnection)
|
protected abstract void |
setRequestHeader(java.lang.Object pConnection,
java.lang.String pHeader,
java.lang.String pValue)
|
Methods inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport |
closeConnection, closeInputStream, closeOutputStream, getOutputStream, newConnection, newInputStream, newInputStream, newOutputStream, newXMLReader, readResponse, sendRequest, writeRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USER_AGENT
public static final java.lang.String USER_AGENT
- The user agent string.
- See Also:
- Constant Field Values
XmlRpcHttpTransport
protected XmlRpcHttpTransport(XmlRpcClient pClient)
setRequestHeader
protected abstract void setRequestHeader(java.lang.Object pConnection,
java.lang.String pHeader,
java.lang.String pValue)
setCredentials
protected void setCredentials(XmlRpcHttpClientConfig pConfig,
java.lang.Object pConnection)
throws XmlRpcClientException
- Throws:
XmlRpcClientException
setContentLength
protected void setContentLength(java.lang.Object pConnection,
int pLength)
getInputStream
protected java.io.InputStream getInputStream(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection,
byte[] pContent)
throws XmlRpcException
- Overrides:
getInputStream
in class XmlRpcStreamTransport
- Throws:
XmlRpcException
setCompressionHeaders
protected void setCompressionHeaders(XmlRpcHttpClientConfig pConfig,
java.lang.Object pConnection)
getUserAgent
protected java.lang.String getUserAgent()
initConnection
protected void initConnection(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection)
throws XmlRpcClientException
- Description copied from class:
XmlRpcStreamTransport
- Initializes the newly created connection. For example, the HTTP transport
will use this to set headers.
- Overrides:
initConnection
in class XmlRpcStreamTransport
- Parameters:
pConfig
- The clients configuration.pConnection
- The connection being initialized.
- Throws:
XmlRpcClientException
- A local error on the client occurred.
isResponseGzipCompressed
protected abstract boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig,
java.lang.Object pConnection)
- Description copied from class:
XmlRpcStreamTransport
- Returns, whether the response is gzip compressed.
- Specified by:
isResponseGzipCompressed
in class XmlRpcStreamTransport
- Parameters:
pConfig
- The clients configuration.pConnection
- The connection object.
- Returns:
- Whether the response stream is gzip compressed.
isUsingByteArrayOutput
protected boolean isUsingByteArrayOutput(XmlRpcStreamRequestConfig pConfig)
- Description copied from class:
XmlRpcStreamTransport
- If this method returns true, then the method
XmlRpcStreamTransport.newInputStream(XmlRpcStreamRequestConfig, Object, byte[])
will be invoked to create the response. Otherwise, the methods
XmlRpcStreamTransport.getOutputStream(XmlRpcStreamRequestConfig, Object)
, and
XmlRpcStreamTransport.newInputStream(XmlRpcStreamRequestConfig, Object)
will
be used.
- Overrides:
isUsingByteArrayOutput
in class XmlRpcStreamTransport
- Returns:
- Whether conversion into a byte array is required to create
the response.
Copyright 2001-2001-2006 Apache Software Foundation. All Rights Reserved.