com.bbn.openmap.util.http
Class HttpRequestEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.bbn.openmap.util.http.HttpRequestEvent
All Implemented Interfaces:
java.io.Serializable

public class HttpRequestEvent
extends java.util.EventObject

An event corresponding to a single HTTP request ("GET" command).

Version:
1.0, 06/13/97
Author:
Tom Mitchell
See Also:
Serialized Form

Field Summary
protected  java.io.OutputStream output
           
protected  java.lang.String request
           
protected  java.io.Writer writer
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
HttpRequestEvent(java.lang.Object source, java.lang.String request, java.io.OutputStream out)
          Creates an http request event.
 
Method Summary
 java.io.OutputStream getOutputStream()
          Gets the output stream connected to the http client.
 java.lang.String getRequest()
          Gets the http request, which is the target of the "GET" command.
 java.io.Writer getWriter()
          Get a Writer associated with the output stream connected to the http client.
 boolean isWriterUsed()
          Find out if anyone used the writer.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

request

protected java.lang.String request

output

protected java.io.OutputStream output

writer

protected java.io.Writer writer
Constructor Detail

HttpRequestEvent

public HttpRequestEvent(java.lang.Object source,
                        java.lang.String request,
                        java.io.OutputStream out)
Creates an http request event.

Parameters:
source - the source object
request - the parsed target of the "GET" command
out - the http client output stream
Method Detail

getRequest

public java.lang.String getRequest()
Gets the http request, which is the target of the "GET" command.

For the URL http://www.bbn.com/openmap/docs/index.html

the request string is /openmap/docs/index.html

Returns:
the request string

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream connected to the http client.

Returns:
the OutputStream associated with the http client.

getWriter

public java.io.Writer getWriter()
Get a Writer associated with the output stream connected to the http client. If a writer hasn't been created, then one will be.

Returns:
the Writer associated with the http client.
See Also:
Writer

isWriterUsed

public boolean isWriterUsed()
Find out if anyone used the writer. If it has been used, then, as a HttpServer, you can assume that the listeners were all contributing text into the writer, and you now need to take the Writer buffer, create a string, and write the contents as output.

Returns:
true if the writer has been created.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details