org.sblim.cimclient.internal.http
public class HttpClient extends Object implements HandshakeCompletedListener
| Constructor Summary | |
|---|---|
| HttpClient(URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
Ctor.
| |
| Method Summary | |
|---|---|
| void | connect()
Connects to the http server
|
| static String | convertToHexString(byte[] digest)
Converts a byte array to a String of hex digits
|
| protected static String | dequote(String str) |
| void | disconnect()
Disconnects the session |
| void | finalize() |
| protected AuthorizationInfo | getAuthentication(boolean proxy, AuthorizationInfo prevAuthInfo, String authenticate) |
| static HttpClient | getClient(URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
Returns a client from a http client pool
|
| String | getHeaderField(String name)
Returns the http header field for a given name
|
| String | getHeaderFieldName(int index)
Return the http header field name for a given index
|
| String | getHeaderFieldValue(int index)
Returns the http header field value for a given index
|
| InputStream | getInputStream()
Returns the input stream of this http connection
|
| OutputStream | getOutputStream()
Returns the output stream of this http connection
|
| String | getRequestMethod()
Returns the request method
|
| String | getRequestProperty(String key)
Returns the request property for a given key
|
| int | getResponseCode()
Returns the response code
|
| String | getResponseMessage()
Returns the response message
|
| protected static void | handleRsp(String authInfo, AuthorizationInfo prevAuthInfo) |
| void | handshakeCompleted(HandshakeCompletedEvent event) |
| boolean | isConnected()
Returns connected
|
| protected static byte[] | parseHex(String hex) |
| void | reset()
Resets state |
| void | setRequestMethod(String method)
Sets the request method
|
| void | setRequestProperty(String key, String value)
Sets the request property
|
| void | streamFinished()
Releases the client and returns it to the pool |
| void | streamFinished(boolean keep)
Releases the client and returns it to the pool
|
| String | toString() |
| void | useHttp11(boolean bool)
Enables/Disables use of http 1.1
|
| boolean | usingProxy()
Returns if a proxy is used
|
Parameters: url The url to connect to clientPool The associated client pool auth_handler The authentication handler
Throws: IOException
Parameters: digest The byte array
Returns: The hex string
Parameters: url The url to connect to clientPool The client pool auth_handler The authentication handler to use
Returns: A http client from the pool
Parameters: name The name
Returns: The header field
Parameters: index The index
Returns: The name
Parameters: index The index
Returns: The header field value
Returns: The input stream
Throws: IOException
Returns: The output stream
Returns: The request method
Parameters: key The key
Returns: The property
Returns: The response code
Throws: IOException
Returns: The response message
Returns: The value of connected.
Parameters: method The request method
Parameters: key The property name value The value
Parameters: keep
if true return to the pool, if
false drop.
Parameters: bool
if true http 1.1 is enabled.
Returns: true if a proxy is used