wt.wrmf.transport.httptransport
Class FlaggedHTTPResponse

java.lang.Object
  extended bywt.httpgw.HTTPResponse
      extended bywt.wrmf.transport.httptransport.FlaggedHTTPResponse
All Implemented Interfaces:
Serializable

public class FlaggedHTTPResponse
extends HTTPResponse
implements Serializable

See Also:
Serialized Form

Nested Class Summary
(package private)  class FlaggedHTTPResponse.TrailerOutputStream
           
 
Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
private  HTTPResponse response
           
private  boolean trailerDone
           
private  boolean useHeader
           
private  boolean useTrailer
           
 
Fields inherited from class wt.httpgw.HTTPResponse
respException
 
Constructor Summary
FlaggedHTTPResponse(HTTPResponse response)
           
FlaggedHTTPResponse(HTTPResponse response, boolean useHeader, boolean useTrailer)
           
 
Method Summary
 boolean containsHeader(String str)
          Checks if the response header is present.
 void finish()
           
 Object get(String key)
          Gets the value of this response header key.
 OutputStream getOutputStream()
          Called to get the output stream to write the data to.
 Enumeration keys()
          Gets the response header keys.
 void setDateHeader(String name, long date)
          Sets a date type response header.
 void setHeader(String name, String value)
          Sets a string type response header.
 void setIntHeader(String name, int value)
          Sets a int type response header.
 void setRemoteHost(String remoteHost)
          Setter for the remote host that will be displayed in exception tracebacks.
 void setRespTarget(Method method, Object[] args)
          Setter for the target method that will generate the real response to the output stream.
 void setStatus(int code)
          Sets a simple Status response header.
 void setStatus(int code, String reason)
          Sets a Status response header.
private  void writeFlag(OutputStream os, StreamFlag flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

response

private HTTPResponse response

useHeader

private boolean useHeader

useTrailer

private boolean useTrailer

trailerDone

private boolean trailerDone
Constructor Detail

FlaggedHTTPResponse

public FlaggedHTTPResponse(HTTPResponse response)

FlaggedHTTPResponse

public FlaggedHTTPResponse(HTTPResponse response,
                           boolean useHeader,
                           boolean useTrailer)
Method Detail

finish

public void finish()
            throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Description copied from class: HTTPResponse
Called to get the output stream to write the data to. It also causes the HTTPResponseHeaders object to be written out to the RMI marshal stream.

Supported API: true

Specified by:
getOutputStream in class HTTPResponse
Returns:
OutputStream for writing response body
Throws:
IOException - if not marshaling response in writeObject. the output stream is null until such time. Also, if the response target class or method is null. There is not a proper business class or method to write the response.

writeFlag

private void writeFlag(OutputStream os,
                       StreamFlag flag)
                throws IOException
Throws:
IOException

setStatus

public void setStatus(int code)
Description copied from class: HTTPResponse
Sets a simple Status response header.

Supported API: true

Specified by:
setStatus in class HTTPResponse
Parameters:
code - Integer Status code

setStatus

public void setStatus(int code,
                      String reason)
Description copied from class: HTTPResponse
Sets a Status response header.

Supported API: true

Specified by:
setStatus in class HTTPResponse
Parameters:
code - Integer Status code
reason - String Status reason code

setIntHeader

public void setIntHeader(String name,
                         int value)
Description copied from class: HTTPResponse
Sets a int type response header.

Supported API: true

Specified by:
setIntHeader in class HTTPResponse
Parameters:
name - String name of the header
value - int value to which header is set

containsHeader

public boolean containsHeader(String str)
Description copied from class: HTTPResponse
Checks if the response header is present.

Supported API: true

Specified by:
containsHeader in class HTTPResponse
Parameters:
str - String the header to search for.
Returns:
A boolean if the header is set.

get

public Object get(String key)
Description copied from class: HTTPResponse
Gets the value of this response header key.

Supported API: false

Specified by:
get in class HTTPResponse
Parameters:
key - the key, as a string, to get the value of.
Returns:
the value of this key as an Object.

keys

public Enumeration keys()
Description copied from class: HTTPResponse
Gets the response header keys.

Supported API: false

Specified by:
keys in class HTTPResponse
Returns:
An Enumeration of the header keys.

setDateHeader

public void setDateHeader(String name,
                          long date)
Description copied from class: HTTPResponse
Sets a date type response header.

Supported API: true

Specified by:
setDateHeader in class HTTPResponse
Parameters:
name - String name of the header
date - long value to which header is set value is milliseconds since the epoch.

setHeader

public void setHeader(String name,
                      String value)
Description copied from class: HTTPResponse
Sets a string type response header.

Supported API: true

Specified by:
setHeader in class HTTPResponse
Parameters:
name - String name of the header
value - String value to which header is set

setRemoteHost

public void setRemoteHost(String remoteHost)
Description copied from class: HTTPResponse
Setter for the remote host that will be displayed in exception tracebacks.

Supported API: false

Specified by:
setRemoteHost in class HTTPResponse

setRespTarget

public void setRespTarget(Method method,
                          Object[] args)
Description copied from class: HTTPResponse
Setter for the target method that will generate the real response to the output stream.

Supported API: false

Specified by:
setRespTarget in class HTTPResponse
Parameters:
method - is the target business Method
args - are the object array of arguments needed my the target method.