org.apache.xmlrpc.client
Class XmlRpcSunHttpTransport

java.lang.Object
  extended by org.apache.xmlrpc.client.XmlRpcTransportImpl
      extended by org.apache.xmlrpc.client.XmlRpcStreamTransport
          extended by org.apache.xmlrpc.client.XmlRpcHttpTransport
              extended by org.apache.xmlrpc.client.XmlRpcSunHttpTransport
All Implemented Interfaces:
XmlRpcTransport

public class XmlRpcSunHttpTransport
extends XmlRpcHttpTransport

Default implementation of an HTTP transport, based on the HttpURLConnection class.


Field Summary
 
Fields inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
USER_AGENT
 
Constructor Summary
XmlRpcSunHttpTransport(XmlRpcClient pClient)
          Creates a new instance.
 
Method Summary
protected  void closeConnection(java.lang.Object pConnection)
          Closes the connection object.
protected  java.lang.String getUserAgent()
           
protected  boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig, java.lang.Object pConnection)
          Returns, whether the response is gzip compressed.
protected  java.lang.Object newConnection(XmlRpcStreamRequestConfig pConfig)
          Creates the connection object.
protected  java.io.InputStream newInputStream(XmlRpcStreamRequestConfig pConfig, java.lang.Object pConnection)
          Creates a new input stream for reading the response.
protected  java.io.InputStream newInputStream(XmlRpcStreamRequestConfig pConfig, java.lang.Object pConnection, byte[] pContent)
          Creates a new input stream for reading the response.
protected  java.io.OutputStream newOutputStream(XmlRpcStreamRequestConfig pConfig, java.lang.Object pConnection)
          Creates a new output stream, to which the request may be written.
protected  void setRequestHeader(java.lang.Object pConnection, java.lang.String pHeader, java.lang.String pValue)
           
 
Methods inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
getInputStream, initConnection, isUsingByteArrayOutput, setCompressionHeaders, setContentLength, setCredentials
 
Methods inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
closeInputStream, closeOutputStream, getOutputStream, newXMLReader, readResponse, sendRequest, writeRequest
 
Methods inherited from class org.apache.xmlrpc.client.XmlRpcTransportImpl
getClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcSunHttpTransport

public XmlRpcSunHttpTransport(XmlRpcClient pClient)
Creates a new instance.

Parameters:
pClient - The client controlling this instance.
Method Detail

getUserAgent

protected java.lang.String getUserAgent()
Overrides:
getUserAgent in class XmlRpcHttpTransport

setRequestHeader

protected void setRequestHeader(java.lang.Object pConnection,
                                java.lang.String pHeader,
                                java.lang.String pValue)
Specified by:
setRequestHeader in class XmlRpcHttpTransport

newConnection

protected java.lang.Object newConnection(XmlRpcStreamRequestConfig pConfig)
                                  throws XmlRpcClientException
Description copied from class: XmlRpcStreamTransport
Creates the connection object. The connection object is a factory for output and input stream.

Specified by:
newConnection in class XmlRpcStreamTransport
Throws:
XmlRpcClientException

closeConnection

protected void closeConnection(java.lang.Object pConnection)
                        throws XmlRpcClientException
Description copied from class: XmlRpcStreamTransport
Closes the connection object.

Specified by:
closeConnection in class XmlRpcStreamTransport
Throws:
XmlRpcClientException

newOutputStream

protected java.io.OutputStream newOutputStream(XmlRpcStreamRequestConfig pConfig,
                                               java.lang.Object pConnection)
                                        throws XmlRpcClientException
Description copied from class: XmlRpcStreamTransport
Creates a new output stream, to which the request may be written.

Specified by:
newOutputStream in class XmlRpcStreamTransport
Parameters:
pConfig - Client configuration.
pConnection - Connection being used to send request data.
Returns:
Opened output stream.
Throws:
XmlRpcClientException - An error occurred on the client.

newInputStream

protected java.io.InputStream newInputStream(XmlRpcStreamRequestConfig pConfig,
                                             java.lang.Object pConnection)
                                      throws XmlRpcClientException
Description copied from class: XmlRpcStreamTransport
Creates a new input stream for reading the response.

Specified by:
newInputStream in class XmlRpcStreamTransport
Parameters:
pConfig - The clients configuration.
pConnection - The connection object.
Returns:
Opened input stream for reading data.
Throws:
XmlRpcClientException

newInputStream

protected java.io.InputStream newInputStream(XmlRpcStreamRequestConfig pConfig,
                                             java.lang.Object pConnection,
                                             byte[] pContent)
                                      throws XmlRpcClientException
Description copied from class: XmlRpcStreamTransport
Creates a new input stream for reading the response.

Specified by:
newInputStream in class XmlRpcStreamTransport
Parameters:
pConfig - The clients configuration.
pConnection - The connection object.
pContent - A byte array with the response.
Returns:
Opened input stream for reading data.
Throws:
XmlRpcClientException

isResponseGzipCompressed

protected 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 XmlRpcHttpTransport
Parameters:
pConfig - The clients configuration.
pConnection - The connection object.
Returns:
Whether the response stream is gzip compressed.


Copyright 2001-2001-2006 Apache Software Foundation. All Rights Reserved.