|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sblim.cimclient.internal.http.HttpClient
public class HttpClient
Class HttpClient implements a HTTP client
| Constructor Summary | |
|---|---|
HttpClient(java.net.URI url,
HttpClientPool clientPool,
AuthorizationHandler auth_handler)
Ctor. |
|
| Method Summary | |
|---|---|
void |
connect()
Connects to the http server |
static java.lang.String |
convertToHexString(byte[] digest)
Converts a byte array to a String of hex digits |
protected static java.lang.String |
dequote(java.lang.String str)
|
void |
disconnect()
Disconnects the session |
void |
finalize()
|
protected AuthorizationInfo |
getAuthentication(boolean proxy,
AuthorizationInfo prevAuthInfo,
java.lang.String authenticate)
|
static HttpClient |
getClient(java.net.URI url,
HttpClientPool clientPool,
AuthorizationHandler auth_handler)
Returns a client from a http client pool |
java.lang.String |
getHeaderField(java.lang.String name)
Returns the http header field for a given name |
java.lang.String |
getHeaderFieldName(int index)
Return the http header field name for a given index |
java.lang.String |
getHeaderFieldValue(int index)
Returns the http header field value for a given index |
java.io.InputStream |
getInputStream()
Returns the input stream of this http connection |
java.io.OutputStream |
getOutputStream()
Returns the output stream of this http connection |
java.lang.String |
getRequestMethod()
Returns the request method |
java.lang.String |
getRequestProperty(java.lang.String key)
Returns the request property for a given key |
int |
getResponseCode()
Returns the response code |
java.lang.String |
getResponseMessage()
Returns the response message |
protected static void |
handleRsp(java.lang.String authInfo,
AuthorizationInfo prevAuthInfo)
|
void |
handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
|
boolean |
isConnected()
Returns connected |
protected static byte[] |
parseHex(java.lang.String hex)
|
void |
reset()
Resets state |
void |
setRequestMethod(java.lang.String method)
Sets the request method |
void |
setRequestProperty(java.lang.String key,
java.lang.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 |
java.lang.String |
toString()
|
void |
useHttp11(boolean bool)
Enables/Disables use of http 1.1 |
boolean |
usingProxy()
Returns if a proxy is used |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HttpClient(java.net.URI url,
HttpClientPool clientPool,
AuthorizationHandler auth_handler)
url - The url to connect toclientPool - The associated client poolauth_handler - The authentication handler| Method Detail |
|---|
public static java.lang.String convertToHexString(byte[] digest)
digest - The byte array
public static HttpClient getClient(java.net.URI url,
HttpClientPool clientPool,
AuthorizationHandler auth_handler)
url - The url to connect toclientPool - The client poolauth_handler - The authentication handler to use
protected static java.lang.String dequote(java.lang.String str)
protected static void handleRsp(java.lang.String authInfo,
AuthorizationInfo prevAuthInfo)
throws java.io.IOException
java.io.IOExceptionprotected static byte[] parseHex(java.lang.String hex)
public void connect()
throws java.io.IOException
java.io.IOExceptionpublic void disconnect()
public void finalize()
finalize in class java.lang.Objectpublic java.lang.String getHeaderFieldValue(int index)
index - The index
public java.lang.String getHeaderField(java.lang.String name)
name - The name
public java.lang.String getHeaderFieldName(int index)
index - The index
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOutputStream()
public java.lang.String getRequestMethod()
public java.lang.String getRequestProperty(java.lang.String key)
key - The key
public int getResponseCode()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getResponseMessage()
public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
handshakeCompleted in interface javax.net.ssl.HandshakeCompletedListenerpublic void reset()
public void setRequestMethod(java.lang.String method)
method - The request method
public void setRequestProperty(java.lang.String key,
java.lang.String value)
key - The property namevalue - The valuepublic void streamFinished()
public void streamFinished(boolean keep)
keep - if true return to the pool, if false
drop.public void useHttp11(boolean bool)
bool - if true http 1.1 is enabled.public boolean usingProxy()
true if a proxy is used
protected AuthorizationInfo getAuthentication(boolean proxy,
AuthorizationInfo prevAuthInfo,
java.lang.String authenticate)
throws HttpParseException,
java.security.NoSuchAlgorithmException
HttpParseException
java.security.NoSuchAlgorithmExceptionpublic boolean isConnected()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||