org.sblim.wbem.http

Class HttpClient

Implemented Interfaces:
HandshakeCompletedListener

public class HttpClient
extends java.lang.Object
implements HandshakeCompletedListener

HttpClient.java (C) Copyright IBM Corp. 2005, 2009 THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. You can obtain a current copy of the Eclipse Public License from http://www.opensource.org/licenses/eclipse-1.0.php
Authors:
Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
Chung-hao Tan, IBM ,chungtan@us.ibm.com Change History Flag Date Prog Description ------------------------------------------------------------------------------- 13799 2004-12-07 thschaef Fix chunking support 17620 2005-06-29 thschaef eliminate ASCIIPrintStream1 in import statement 17970 2005-08-11 pineiro5 Logon from z/OS not possible 1353168 2005-11-24 fiuczy Possible NullPointerExcection in HttpClient.streamFinished() 1422316 2006-05-15 lupusalex Disable delayed acknowledgement 1486379 2006-05-29 lupusalex CIM client retries twice when HTTP/1.1 401 is returned 1498130 2006-05-31 lupusalex Selection of xml parser on a per connection basis 1516244 2006-07-10 ebak GCJ support 1536711 2006-08-15 lupusalex NullPointerException causes client call to never return 1535756 2006-08-07 lupusalex Make code warning free 1565091 2006-10-17 ebak ssl handshake exception 1516242 2006-11-27 lupusalex Support of OpenPegasus local authentication 1604329 2006-12-18 lupusalex Fix OpenPegasus auth module 1620526 2007-01-08 lupusalex Socket Leak in HTTPClient.getResponseCode() 1627832 2007-01-08 lupuslaex Incorrect retry behaviour on HTTP 401 1637546 2007-01-27 lupusalex CIMEnumerationImpl has faulty close function 1647148 2007-01-29 lupusalex HttpClient.resetSocket() doesn't set socket timeout 1647159 2007-01-29 lupusalex HttpClientPool runs out of HttpClients 1649595 2007-02-01 lupusalex No chunking requested 1688270 2007-03-26 lupusalex Disable chunking because of trailer issues 1892041 2008-02-13 blaschke-oss Basic/digest authentication problem for Japanese users 1931332 2008-04-01 blaschke-oss In HTTPClient need to get status before closing connection 2219646 2008-11-17 blaschke-oss Fix / clean code to remove compiler warnings 2372679 2008-12-01 blaschke-oss Add property to control synchronized SSL handshaking 2807325 2009-06-22 blaschke-oss Change licensing from CPL to EPL

Constructor Summary

HttpClient(URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)

Method Summary

void
connect()
static String
convertToHexString(byte[] digest)
protected static String
dequote(String str)
void
disconnect()
void
finalize()
protected AuthInfo
getAuthentication(boolean proxy, AuthInfo prevAuthInfo, String authenticate)
String
getCipherSuite()
static HttpClient
getClient(URI url, HttpClientPool clientPool, AuthorizationHandler auth_handler)
String
getHeaderField(String name)
String
getHeaderField(int index)
String
getHeaderFieldKey(int index)
InputStream
getInputStream()
OutputStream
getOutputStream()
String
getRequestMethod()
String
getRequestProperty(String key)
int
getResponseCode()
String
getResponseMessage()
protected static void
handleRsp(String authInfo, AuthInfo prevAuthInfo)
void
handshakeCompleted(HandshakeCompletedEvent event)
boolean
isConnected()
Returns connected
protected static byte[]
parseHex(String hex)
void
reset()
void
setRequestMethod(String method)
void
setRequestProperty(String key, String value)
void
streamFinished()
void
streamFinished(boolean keep)
void
useHttp11(boolean bool)
boolean
usingProxy()

Constructor Details

HttpClient

public HttpClient(URI url,
                  HttpClientPool clientPool,
                  AuthorizationHandler auth_handler)

Method Details

connect

public void connect()
            throws IOException

convertToHexString

public static String convertToHexString(byte[] digest)

dequote

protected static String dequote(String str)

disconnect

public void disconnect()

finalize

public void finalize()

getAuthentication

protected AuthInfo getAuthentication(boolean proxy,
                                     AuthInfo prevAuthInfo,
                                     String authenticate)
            throws HttpParseException,
                   NoSuchAlgorithmException

getCipherSuite

public String getCipherSuite()

getClient

public static HttpClient getClient(URI url,
                                   HttpClientPool clientPool,
                                   AuthorizationHandler auth_handler)

getHeaderField

public String getHeaderField(String name)

getHeaderField

public String getHeaderField(int index)

getHeaderFieldKey

public String getHeaderFieldKey(int index)

getInputStream

public InputStream getInputStream()
            throws IOException

getOutputStream

public OutputStream getOutputStream()
            throws IOException

getRequestMethod

public String getRequestMethod()

getRequestProperty

public String getRequestProperty(String key)

getResponseCode

public int getResponseCode()
            throws IOException

getResponseMessage

public String getResponseMessage()

handleRsp

protected static void handleRsp(String authInfo,
                                AuthInfo prevAuthInfo)
            throws IOException

handshakeCompleted

public void handshakeCompleted(HandshakeCompletedEvent event)

isConnected

public boolean isConnected()
Returns connected
Returns:
The value of connected.

parseHex

protected static byte[] parseHex(String hex)

reset

public void reset()

setRequestMethod

public void setRequestMethod(String method)

setRequestProperty

public void setRequestProperty(String key,
                               String value)

streamFinished

public void streamFinished()

streamFinished

public void streamFinished(boolean keep)

useHttp11

public void useHttp11(boolean bool)

usingProxy

public boolean usingProxy()

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.