com.ibm.etill.framework.io
Class HTTPOutputStream

java.lang.Object
  |
  +--com.ibm.etill.framework.io.HTTPOutputStream
All Implemented Interfaces:
HTTPConst

public final class HTTPOutputStream
extends Object
implements HTTPConst

This class defines an HTTP OutputStream. It allows the writing of HTTP request and response messages. It can be extended in the future.
This implementation is based on the SET Advantis payment gateway book.
HOW TO USE IT
- connect this class to a DataOutputStream (done in the constructor)
- write a post statement using writePost()


Fields inherited from interface com.ibm.etill.framework.io.HTTPConst
ACCEPT_ALL, ACCEPT_BITMAP, ACCEPT_GIF, ACCEPT_JPEG, ACCEPT_PJPEG, CA_AGENT, HTTP_ACCEPT, HTTP_CONNECTION, HTTP_EOL, HTTP_USER_AGENT, HTTP_VERSION, KEEP_ALIVE, MAX_SIZE_HTTPHEADER, POST, RC_BAD_REQUEST, RC_FORBIDDEN, RC_INTERNAL_SERVER_ERROR, RC_NOT_IMPLEMENTED, RC_OK, RC_SERVICE_UNAVAILABLE, RC_UNAUTHORIZED, RC_WRONG, RCS_BAD_REQUEST, RCS_FORBIDDEN, RCS_INTERNAL_SERVER_ERROR, RCS_NOT_IMPLEMENTED, RCS_OK, RCS_SERVICE_UNAVAILABLE, RCS_UNAUTHORIZED, responseCodeTable, UNKNOWN
 
Constructor Summary
HTTPOutputStream(DataOutputStream dos)
          Creates a new HTTP output stream to write data to a DataOutputStream.
 
Method Summary
 void setAccept(String acceptValue)
           
 void setConnection(String connectionValue)
           
 void setUserAgent(String userAgentValue)
           
 void writePost(String URL)
          Writes an HTTP POST statement that sends an URL.
 void writeRequest(String method, String URL)
          Writes an HTTP request statement that sends an URL.
 void writeResponse(int responseCode)
          Writes an HTTP response banner statement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPOutputStream

public HTTPOutputStream(DataOutputStream dos)
Creates a new HTTP output stream to write data to a DataOutputStream.
Parameters:
os - the DataOutput stream
Method Detail

writePost

public void writePost(String URL)
               throws IOException
Writes an HTTP POST statement that sends an URL.
Parameters:
URL - The URL address of the application one wants to talk to.

writeRequest

public void writeRequest(String method,
                         String URL)
                  throws IOException
Writes an HTTP request statement that sends an URL.
Parameters:
HTTP - Request Method
URL - The URL address of the application one wants to talk to.

writeResponse

public void writeResponse(int responseCode)
                   throws IOException
Writes an HTTP response banner statement.
Parameters:
Response - Code

setAccept

public void setAccept(String acceptValue)

setConnection

public void setConnection(String connectionValue)

setUserAgent

public void setUserAgent(String userAgentValue)