Package org.sblim.wbem.http
Class HttpClient
- java.lang.Object
-
- org.sblim.wbem.http.HttpClient
-
- All Implemented Interfaces:
java.util.EventListener
,javax.net.ssl.HandshakeCompletedListener
public class HttpClient extends java.lang.Object implements javax.net.ssl.HandshakeCompletedListener
-
-
Constructor Summary
Constructors Constructor Description HttpClient(java.net.URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
static java.lang.String
convertToHexString(byte[] digest)
protected static java.lang.String
dequote(java.lang.String str)
void
disconnect()
void
finalize()
protected AuthInfo
getAuthentication(boolean proxy, AuthInfo prevAuthInfo, java.lang.String authenticate)
java.lang.String
getCipherSuite()
static HttpClient
getClient(java.net.URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
java.lang.String
getHeaderField(int index)
java.lang.String
getHeaderField(java.lang.String name)
java.lang.String
getHeaderFieldKey(int index)
java.io.InputStream
getInputStream()
java.io.OutputStream
getOutputStream()
java.lang.String
getRequestMethod()
java.lang.String
getRequestProperty(java.lang.String key)
int
getResponseCode()
java.lang.String
getResponseMessage()
protected static void
handleRsp(java.lang.String authInfo, AuthInfo prevAuthInfo)
void
handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
boolean
isConnected()
Returns connectedprotected static byte[]
parseHex(java.lang.String hex)
void
reset()
void
setRequestMethod(java.lang.String method)
void
setRequestProperty(java.lang.String key, java.lang.String value)
void
streamFinished()
void
streamFinished(boolean keep)
void
useHttp11(boolean bool)
boolean
usingProxy()
-
-
-
Constructor Detail
-
HttpClient
public HttpClient(java.net.URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
-
-
Method Detail
-
convertToHexString
public static java.lang.String convertToHexString(byte[] digest)
-
getClient
public static HttpClient getClient(java.net.URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
-
dequote
protected static java.lang.String dequote(java.lang.String str)
-
handleRsp
protected static void handleRsp(java.lang.String authInfo, AuthInfo prevAuthInfo) throws java.io.IOException
- Throws:
java.io.IOException
-
parseHex
protected static byte[] parseHex(java.lang.String hex)
-
connect
public void connect() throws java.io.IOException
- Throws:
java.io.IOException
-
disconnect
public void disconnect()
-
finalize
public void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
getCipherSuite
public java.lang.String getCipherSuite()
-
getHeaderField
public java.lang.String getHeaderField(int index)
-
getHeaderField
public java.lang.String getHeaderField(java.lang.String name)
-
getHeaderFieldKey
public java.lang.String getHeaderFieldKey(int index)
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
- Throws:
java.io.IOException
-
getRequestMethod
public java.lang.String getRequestMethod()
-
getRequestProperty
public java.lang.String getRequestProperty(java.lang.String key)
-
getResponseCode
public int getResponseCode() throws java.io.IOException
- Throws:
java.io.IOException
-
getResponseMessage
public java.lang.String getResponseMessage()
-
handshakeCompleted
public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
- Specified by:
handshakeCompleted
in interfacejavax.net.ssl.HandshakeCompletedListener
-
reset
public void reset()
-
setRequestMethod
public void setRequestMethod(java.lang.String method)
-
setRequestProperty
public void setRequestProperty(java.lang.String key, java.lang.String value)
-
streamFinished
public void streamFinished()
-
streamFinished
public void streamFinished(boolean keep)
-
useHttp11
public void useHttp11(boolean bool)
-
usingProxy
public boolean usingProxy()
-
getAuthentication
protected AuthInfo getAuthentication(boolean proxy, AuthInfo prevAuthInfo, java.lang.String authenticate) throws HttpParseException, java.security.NoSuchAlgorithmException
- Throws:
HttpParseException
java.security.NoSuchAlgorithmException
-
isConnected
public boolean isConnected()
Returns connected- Returns:
- The value of connected.
-
-