IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.servlet
Class HttpURLConnectionThin

java.lang.Object
  extended by com.ibm.btt.cs.servlet.HttpURLConnectionThin

public class HttpURLConnectionThin
extends java.lang.Object

The HttpURLConnectionThin class is used to establish a client/server connection.


Field Summary
(package private) static byte[] Base64EncMap
           
protected  java.lang.String charEncoding
          Character encoding used in the HTTP message body sent in C/S requests.
(package private)  boolean connected
           
(package private)  java.lang.String connection
           
(package private)  int contentLength
           
(package private)  java.lang.String file
           
(package private)  boolean getInputStreamCalled
           
(package private)  java.lang.String host
           
(package private)  java.net.Socket hostSocket
           
(package private)  java.io.DataInputStream is
           
(package private)  java.io.InputStream originalIS
           
(package private)  java.io.DataOutputStream os
           
(package private)  int port
           
(package private)  java.lang.String protocol
           
(package private)  java.lang.String proxyCredentials
           
(package private)  java.lang.String proxyHost
           
(package private)  int proxyPort
           
(package private)  int rc
           
(package private)  java.lang.String serverCredentials
           
protected  boolean sslEnabled
           
protected  SSLEnabler sslEnabler
           
(package private)  java.lang.String status
           
(package private)  java.net.URL theURL
           
 
Constructor Summary
HttpURLConnectionThin()
          This constructor creates a HttpURLConnectionThin object.
HttpURLConnectionThin(java.net.URL u, SSLEnabler anSSLEnabler, boolean aKeepAlive, CSConnectionCookies conCookies)
          This constructor creates a HttpURLConnectionThin object.
HttpURLConnectionThin(java.net.URL u, SSLEnabler anSSLEnabler, boolean aKeepAlive, java.lang.String aCSClientName, CSConnectionCookies conCookies)
          This constructor creates a HttpURLConnectionThin object.
 
Method Summary
static java.lang.String base64Encode(java.lang.String str)
          This method encodes the given string using the base64-encoding specified in RFC-2045 (Section 6.8).
 void connect()
          Opens a connection with the server.
 void disconnect()
          Disconnects with the server.
 java.lang.String getCharEncoding()
          Obtains the charEncoding attribute.
 int getContentLength()
          Gets the contentLength property (int) value.
 java.io.DataInputStream getInputStream()
          Gets the is property (DataInputStream) value.
 java.io.DataOutputStream getOutputStream()
          Gets the os property (DataOutputStream) value.
 java.lang.String getSessionID()
          Gets the session id property (String) value.
 SSLEnabler getSSLEnabler()
          Returns the sslEnabler.
 java.lang.String getUserAgent()
          Gets the fieldUserAgent property (String) value.
 boolean isSSLEnabled()
          Returns the sslEnabled.
 void readHeaders()
          Reads the headers of the response.
 java.lang.String readLine()
          Reads a line of the response.
 void reset()
          reset this connection
 void setBasicAuthenticationHeader(java.lang.String userAndPasswordId)
          Sets the serverCredentials property (String) value.
 void setCharEncoding(java.lang.String c)
          Sets the charEncoding attribute.
 void setContentLength(int length)
          Sets the contentLength property (int) value.
 void setProxy(java.lang.String aProxyHost, int aProxyPort)
          Sets the proxyHost and proxyPort properties values.
 void setProxyBasicAuthenticationHeader(java.lang.String userAndPasswordId)
          Sets the proxyCredentials property (String) value.
 void setSessionId(java.lang.String sessionId)
          Sets the fieldSessionId property (String) value.
 void setSSLEnabled(boolean sslEnabled)
          Sets the sslEnabled.
 void setSSLEnabler(SSLEnabler sslEnabler)
          Sets the sslEnabler.
 void setUserAgent(java.lang.String userAgent)
          Sets the fieldUserAgent property (String) value.
 boolean usingCookies()
          Returns true if cookies are used.
 boolean usingProxy()
          Returns true if proxy is used.
 void writeHeaders()
          Writes the headers of the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theURL

java.net.URL theURL

protocol

java.lang.String protocol

host

java.lang.String host

port

int port

file

java.lang.String file

hostSocket

java.net.Socket hostSocket

os

java.io.DataOutputStream os

is

java.io.DataInputStream is

getInputStreamCalled

boolean getInputStreamCalled

status

java.lang.String status

rc

int rc

contentLength

int contentLength

connection

java.lang.String connection

connected

boolean connected

sslEnabled

protected boolean sslEnabled

sslEnabler

protected SSLEnabler sslEnabler

originalIS

java.io.InputStream originalIS

proxyHost

java.lang.String proxyHost

proxyPort

int proxyPort

serverCredentials

java.lang.String serverCredentials

proxyCredentials

java.lang.String proxyCredentials

Base64EncMap

static byte[] Base64EncMap

charEncoding

protected java.lang.String charEncoding
Character encoding used in the HTTP message body sent in C/S requests.

Constructor Detail

HttpURLConnectionThin

public HttpURLConnectionThin()
This constructor creates a HttpURLConnectionThin object.


HttpURLConnectionThin

public HttpURLConnectionThin(java.net.URL u,
                             SSLEnabler anSSLEnabler,
                             boolean aKeepAlive,
                             CSConnectionCookies conCookies)
This constructor creates a HttpURLConnectionThin object.

Parameters:
u - java.net.URL
anSSLEnabler - SSLEnabler
aKeepAlive - boolean
conCookies - CSConnectionCookies

HttpURLConnectionThin

public HttpURLConnectionThin(java.net.URL u,
                             SSLEnabler anSSLEnabler,
                             boolean aKeepAlive,
                             java.lang.String aCSClientName,
                             CSConnectionCookies conCookies)
This constructor creates a HttpURLConnectionThin object.

Parameters:
u - java.net.URL
anSSLEnabler - SSLEnabler
aKeepAlive - boolean
conCookies - CSConnectionCookies
Method Detail

base64Encode

public static final java.lang.String base64Encode(java.lang.String str)
This method encodes the given string using the base64-encoding specified in RFC-2045 (Section 6.8). It's used for example in the "Basic" authorization scheme.

Parameters:
str - the string
Returns:
the base64-encoded str

connect

public void connect()
             throws java.lang.Exception
Opens a connection with the server.

Throws:
java.lang.Exception

disconnect

public void disconnect()
Disconnects with the server.


getContentLength

public int getContentLength()
Gets the contentLength property (int) value.

Returns:
int

getInputStream

public java.io.DataInputStream getInputStream()
                                       throws java.io.IOException
Gets the is property (DataInputStream) value.

Returns:
java.io.DataInputStream
Throws:
java.io.IOException

getOutputStream

public java.io.DataOutputStream getOutputStream()
                                         throws java.io.IOException
Gets the os property (DataOutputStream) value.

Returns:
java.io.DataOutputStream
Throws:
java.io.IOException

getSessionID

public java.lang.String getSessionID()
Gets the session id property (String) value.

Returns:
java.lang.String

getUserAgent

public java.lang.String getUserAgent()
Gets the fieldUserAgent property (String) value.

Returns:
java.lang.String

readHeaders

public void readHeaders()
                 throws java.lang.Exception
Reads the headers of the response.

Throws:
java.lang.Exception

readLine

public final java.lang.String readLine()
                                throws java.io.IOException
Reads a line of the response.

Throws:
java.io.IOException

reset

public void reset()
reset this connection


setBasicAuthenticationHeader

public void setBasicAuthenticationHeader(java.lang.String userAndPasswordId)
Sets the serverCredentials property (String) value.

Parameters:
userAndPasswordId - java.lang.String

setContentLength

public void setContentLength(int length)
Sets the contentLength property (int) value.

Parameters:
length - int

setProxy

public void setProxy(java.lang.String aProxyHost,
                     int aProxyPort)
Sets the proxyHost and proxyPort properties values.

Parameters:
proxyHost - String
proxyPort - int

setProxyBasicAuthenticationHeader

public void setProxyBasicAuthenticationHeader(java.lang.String userAndPasswordId)
Sets the proxyCredentials property (String) value.

Parameters:
userAndPasswordId - java.lang.String

setSessionId

public void setSessionId(java.lang.String sessionId)
Sets the fieldSessionId property (String) value.

Parameters:
sessionId - String

setUserAgent

public void setUserAgent(java.lang.String userAgent)
Sets the fieldUserAgent property (String) value.

Parameters:
fieldUserAgent - java.lang.String

usingCookies

public boolean usingCookies()
Returns true if cookies are used.

Returns:
boolean

usingProxy

public boolean usingProxy()
Returns true if proxy is used.

Returns:
boolean

writeHeaders

public void writeHeaders()
                  throws java.io.IOException
Writes the headers of the request. The character encoding is ISO 8859_1. Note: If you are using cookies to maintain the session the cookie must be the first parameter in the request header.

Throws:
java.io.IOException

getSSLEnabler

public SSLEnabler getSSLEnabler()
Returns the sslEnabler.

Returns:
SSLEnabler

setSSLEnabler

public void setSSLEnabler(SSLEnabler sslEnabler)
Sets the sslEnabler.

Parameters:
sslEnabler - The sslEnabler to set

isSSLEnabled

public boolean isSSLEnabled()
Returns the sslEnabled.

Returns:
boolean

setSSLEnabled

public void setSSLEnabled(boolean sslEnabled)
Sets the sslEnabled.

Parameters:
sslEnabled - The sslEnabled to set

getCharEncoding

public java.lang.String getCharEncoding()
Obtains the charEncoding attribute.

Returns:
String

setCharEncoding

public void setCharEncoding(java.lang.String c)
Sets the charEncoding attribute.

Parameters:
c - String

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011