|
||||||||||
| 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(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 |
protected 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HttpClient(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 String convertToHexString(byte[] digest)
digest - The byte array
public static HttpClient getClient(URI url,
HttpClientPool clientPool,
AuthorizationHandler auth_handler)
url - The url to connect toclientPool - The client poolauth_handler - The authentication handler to use
protected static String dequote(String str)
protected static void handleRsp(String authInfo,
AuthorizationInfo prevAuthInfo)
throws IOException
IOExceptionprotected static byte[] parseHex(String hex)
public void connect()
throws IOException
IOExceptionpublic void disconnect()
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic String getHeaderFieldValue(int index)
index - The index
public String getHeaderField(String name)
name - The name
public String getHeaderFieldName(int index)
index - The index
public InputStream getInputStream()
throws IOException
IOExceptionpublic OutputStream getOutputStream()
public String getRequestMethod()
public String getRequestProperty(String key)
key - The key
public int getResponseCode()
throws IOException
IOExceptionpublic String getResponseMessage()
public void handshakeCompleted(HandshakeCompletedEvent event)
handshakeCompleted in interface HandshakeCompletedListenerpublic void reset()
public void setRequestMethod(String method)
method - The request method
public void setRequestProperty(String key,
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,
String authenticate)
throws HttpParseException,
NoSuchAlgorithmException
HttpParseException
NoSuchAlgorithmExceptionpublic boolean isConnected()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||