|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sun.net.NetworkClient sun.net.www.http.HttpClient com.sun.faban.driver.transport.sunhttp.HttpClient
public class HttpClient
Implementation of the HttpClient for the Faban driver framework.
It relies heavily on the sun.net implementation. The only
difference is actually the use of SocketFactory instead
of plainly creating new sockets. The HttpClient supports both
http and https protocols.
Derived from code contributed by Scott Oaks.
Field Summary | |
---|---|
protected boolean |
inCache
Superclass' inCache is private. |
Fields inherited from class sun.net.www.http.HttpClient |
---|
cachedHttpClient, cookieHandler, host, kac, port, proxyDisabled, reuse, url, usingProxy |
Fields inherited from class sun.net.NetworkClient |
---|
connectTimeout, defaultConnectTimeout, defaultSoTimeout, encoding, proxy, readTimeout, serverInput, serverOutput, serverSocket |
Constructor Summary | |
---|---|
protected |
HttpClient(URL url,
Proxy proxy,
int to)
Subclass constructor for the client. |
Method Summary | |
---|---|
protected Socket |
doConnect(String server,
int port)
Return a socket connected to the server, with any appropriate options pre-established. |
static HttpClient |
New(URL url,
Proxy p,
int to,
boolean useCache)
Instantiates a HttpClient. |
static HttpClient |
New(URL url,
String proxyHost,
int proxyPort,
boolean useCache,
int timeout)
Instantiates a HttpClient. |
protected void |
putInKeepAliveCache()
|
protected static void |
setSocketFactory(SocketFactory sf)
Sets the socket factory for creating sockets used by this client. |
Methods inherited from class sun.net.www.http.HttpClient |
---|
afterConnect, closeIdleConnection, closeServer, finalize, finished, getDefaultPort, getHttpKeepAliveSet, getInputStream, getOutputStream, getProxyHostUsed, getProxyPortUsed, getURLFile, isCachedConnection, isInKeepAliveCache, isKeepingAlive, needsTunneling, New, New, New, New, newHttpProxy, openServer, openServer, parseHTTP, resetProperties, setCacheRequest, setDoNotRetry, setTimeout, toString, writeRequests, writeRequests |
Methods inherited from class sun.net.NetworkClient |
---|
getConnectTimeout, getLocalAddress, getReadTimeout, serverIsOpen, setConnectTimeout, setReadTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean inCache
Constructor Detail |
---|
protected HttpClient(URL url, Proxy proxy, int to) throws IOException
url
- The URLproxy
- Proxies, if anyto
- The connect timeout
IOException
- If an error occursMethod Detail |
---|
public static HttpClient New(URL url, String proxyHost, int proxyPort, boolean useCache, int timeout) throws IOException
url
- The URL to connectproxyHost
- The proxy server, null if no proxyproxyPort
- The proxy server portuseCache
- Whether to use a client from cache or nottimeout
- The connect timeout, -1 if no timeout
IOException
- An I/O error occurredpublic static HttpClient New(URL url, Proxy p, int to, boolean useCache) throws IOException
url
- The URL to connectp
- The proxy server, null if no proxyto
- The connect timeout, -1 if no timeoutuseCache
- Whether to use a client from cache or not
IOException
- An I/O error occurredprotected void putInKeepAliveCache()
putInKeepAliveCache
in class sun.net.www.http.HttpClient
protected Socket doConnect(String server, int port) throws IOException, UnknownHostException
doConnect
in class sun.net.NetworkClient
server
- The server to connect toport
- The port to connect to
IOException
- Communication error
UnknownHostException
- The host cannot be foundprotected static void setSocketFactory(SocketFactory sf)
sf
- The socket factory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |