org.sblim.cimclient.internal.http
Class HttpUrlConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by org.sblim.cimclient.internal.http.HttpUrlConnection

public class HttpUrlConnection
extends HttpURLConnection

Class HttpUrlConnection encapsulates a http connection


Field Summary
protected  URI iUrl
           
 
Fields inherited from class java.net.HttpURLConnection
chunkLength, fixedContentLength, HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, method, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
HttpUrlConnection(URI pUri, HttpClientPool pHttpClientPool, AuthorizationHandler pAuthHandler)
          Ctor.
 
Method Summary
 void close()
          Closes the client pool
 void connect()
           
 void disconnect()
           
 String getHeaderField(int index)
           
 String getHeaderField(String name)
           
 String getHeaderFieldKey(int index)
           
 HttpClient getHttpClient()
          Returns the http client
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 Permission getPermission()
           
 String getRequestMethod()
           
 String getRequestProperty(String key)
           
 int getResponseCode()
           
 String getResponseMessage()
           
 void reset()
          Resets the http client
 void setRequestMethod(String pMethod)
           
 void setRequestProperty(String key, String value)
           
 String toString()
           
 void useHttp11(boolean pUse11)
          Enables/Disables the use of http 1.1
 boolean usingProxy()
           
 
Methods inherited from class java.net.HttpURLConnection
getErrorStream, getFollowRedirects, getHeaderFieldDate, getInstanceFollowRedirects, setChunkedStreamingMode, setFixedLengthStreamingMode, setFollowRedirects, setInstanceFollowRedirects
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldInt, getHeaderFields, getIfModifiedSince, getLastModified, getReadTimeout, getRequestProperties, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setUseCaches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iUrl

protected URI iUrl
Constructor Detail

HttpUrlConnection

public HttpUrlConnection(URI pUri,
                         HttpClientPool pHttpClientPool,
                         AuthorizationHandler pAuthHandler)
Ctor.

Parameters:
pUri - The host URI
pHttpClientPool - The client pool
pAuthHandler - The authentication handler
Method Detail

toString

public String toString()
Overrides:
toString in class URLConnection

getPermission

public Permission getPermission()
Overrides:
getPermission in class HttpURLConnection

connect

public void connect()
             throws IOException
Specified by:
connect in class URLConnection
Throws:
IOException

setRequestMethod

public void setRequestMethod(String pMethod)
Overrides:
setRequestMethod in class HttpURLConnection

setRequestProperty

public void setRequestProperty(String key,
                               String value)
Overrides:
setRequestProperty in class URLConnection

disconnect

public void disconnect()
Specified by:
disconnect in class HttpURLConnection

close

public void close()
Closes the client pool


getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws RuntimeException
Overrides:
getOutputStream in class URLConnection
Throws:
RuntimeException

usingProxy

public boolean usingProxy()
Specified by:
usingProxy in class HttpURLConnection

getHttpClient

public HttpClient getHttpClient()
Returns the http client

Returns:
The http client

getHeaderField

public String getHeaderField(String name)
Overrides:
getHeaderField in class URLConnection

getHeaderFieldKey

public String getHeaderFieldKey(int index)
Overrides:
getHeaderFieldKey in class HttpURLConnection

getHeaderField

public String getHeaderField(int index)
Overrides:
getHeaderField in class HttpURLConnection

getRequestProperty

public String getRequestProperty(String key)
Overrides:
getRequestProperty in class URLConnection

getRequestMethod

public String getRequestMethod()
Overrides:
getRequestMethod in class HttpURLConnection

reset

public void reset()
Resets the http client


getResponseCode

public int getResponseCode()
                    throws IOException
Overrides:
getResponseCode in class HttpURLConnection
Throws:
IOException

getResponseMessage

public String getResponseMessage()
Overrides:
getResponseMessage in class HttpURLConnection

useHttp11

public void useHttp11(boolean pUse11)
Enables/Disables the use of http 1.1

Parameters:
pUse11 - If true http 1.1 is enabled.


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