    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.protocol.http.Request

    java.lang.Object
       |
       +----w3c.www.http.HttpMessage
               |
               +----w3c.www.http.HttpEntityMessage
                       |
                       +----w3c.www.http.HttpRequestMessage
                               |
                               +----w3c.www.protocol.http.Request

public class Request
extends HttpRequestMessage

The client side idea of a request. Requests are created only by the HttpManager, by cloning its template request that defines the default (application wide) request settings.

##

allowuserinteraction
  Are we allowed to interact with the user ?
interrupted
  Has this request been interrupted ?
manager
  The manager that created this request.
observer
  The observer for the request, if any.
output
  The request output stream, to PUT or POST data.
pipeline
  Can we pipeline that request, if appropriate support is detected ?
server
  The server currently running the request, if any.

##

endEmit(OutputStream, int)
  End of header emiting, continue by sending optional output stream.
getAllowUserInteraction()
  Are we allowed to do some user interaction to run this request.
getManager()
  Get this request's manager.
getObserver()
  Get the observer for this request.
getOutputStream()
  Get the input stream to read that request body.
hasOutputStream()
  Does this request has an associated input stream ?
interruptRequest()
  Interrupt that request processing.
isInterrupted()
  Has this request been interrupted ?
makeReply(int)
  Create a Reply instance matching this request.
setAllowUserInteraction(boolean)
  Decide wether we are allowed to interact wit hthe user.
setObserver(RequestObserver)
  Set the observer for this request.
setOutputStream(InputStream)
  Set this request output stream.
setPipeline(boolean)
  Enable/disable pipelining for that request.
setServer(HttpServer)
  Mark that request has being run by given server.
unsetServer()
  Mark that request as no longer attached to a server object.

##

manager

     protected HttpManager manager

  The manager that created this request.

allowuserinteraction

     protected boolean allowuserinteraction

  Are we allowed to interact with the user ?

output

     protected InputStream output

  The request output stream, to PUT or POST data.

observer

     protected RequestObserver observer

  The observer for the request, if any.

pipeline

     protected boolean pipeline

  Can we pipeline that request, if appropriate support is detected ?

interrupted

     protected boolean interrupted

  Has this request been interrupted ?

server

     protected HttpServer server

  The server currently running the request, if any.

##

setServer

     protected synchronized void setServer(HttpServer server)

  Mark that request has being run by given server.

  Parameters:
    server - The server in charge for that request.

unsetServer

     protected synchronized void unsetServer()

  Mark that request as no longer attached to a server object.

setPipeline

     public void setPipeline(boolean onoff)

  Enable/disable pipelining for that request. By default, this HTTP implementation tries it's best to use pipelining, if you take manual control over it, you're responsible for damages.

  Parameters:
    onoff - The pipelining toggle.

endEmit

     protected void endEmit(OutputStream out,
                            int what) throws IOException

  End of header emiting, continue by sending optional output stream.

  Parameters:
    out - The output stream to write to.
  Overrides:
    endEmit in class HttpMessage

getAllowUserInteraction

     public boolean getAllowUserInteraction()

  Are we allowed to do some user interaction to run this request.

  Returns:
    A boolean, true if user interaction is allowed false otherwise.

setAllowUserInteraction

     public void setAllowUserInteraction(boolean onoff)

  Decide wether we are allowed to interact wit hthe user.

  Parameters:
    onoff - A boolean, true if interaction is allowed.

interruptRequest

     public synchronized void interruptRequest()

  Interrupt that request processing. Do whatever it takes to interrupt that request processing, as soon as possible.

isInterrupted

     public boolean isInterrupted()

  Has this request been interrupted ?

  Returns:
    A boolean.

getManager

     public HttpManager getManager()

  Get this request's manager.

  Returns:
    The instance of the manager taking care of this request.

setOutputStream

     public void setOutputStream(InputStream in)

  Set this request output stream. As a side effect, setting the body of the request will disable pipelining. If you know what you're doing, you can turn it on again by using the `setPipeline` method.

  Parameters:
    in - The data to send to the server.

hasOutputStream

     public boolean hasOutputStream()

  Does this request has an associated input stream ?

  Returns:
    A boolean true of it has.

getOutputStream

     public InputStream getOutputStream()

  Get the input stream to read that request body. Warning it is up to the caller to make sure to:
  - Reset the content length if any bytes is read out of the stream before the request is sent.
  - Reset the entire stream is the filter acting upon it just want to peek it (without consuming it).

  Returns:
    An InputStream instance, or null if the request has no body.

makeReply

     public Reply makeReply(int status)

  Create a Reply instance matching this request.

setObserver

     public void setObserver(RequestObserver observer)

  Set the observer for this request.

  Parameters:
    observer - The observer.

getObserver

     public RequestObserver getObserver()

  Get the observer for this request.

  Returns:
    An instance of RequestObserver, or null if undefined.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index