## org.apache.catalina
Interface Request

All Known Subinterfaces:
  HttpRequest

All Known Implementing Classes:
  HttpRequestBase, HttpRequestWrapper, MappingRequest, RequestBase, RequestWrapper

public interface Request

A Request is the Catalina-internal facade for a `ServletRequest` that is to be processed, in order to produce the corresponding `Response`.

Version:
  $Revision: 1.6 $ $Date: 2004/08/26 22:05:53 $
Author:
  Craig R. McClanahan

Method Summary
`javax.servlet.ServletInputStream` `createInputStream()` Create and return a ServletInputStream to read the content associated with this Request.
`void` `finishRequest()` Perform whatever actions are required to flush and close the input stream or reader, in a single operation.
`java.lang.String` `getAuthorization()` Return the authorization credentials sent with this request.
`Connector` `getConnector()` Return the Connector through which this Request was received.
`Context` `getContext()` Return the Context within which this Request is being processed.
`java.lang.String` `getInfo()` Return descriptive information about this Request implementation and the corresponding version number, in the format `<description>/<version>`.
`java.lang.Object` `getNote(java.lang.String name)` Return the object bound with the specified name to the internal notes for this request, or `null` if no such binding exists.
`java.util.Iterator` `getNoteNames()` Return an Iterator containing the String names of all notes bindings that exist for this request.
`javax.servlet.ServletRequest` `getRequest()` Return the `ServletRequest` for which this object is the facade.
`Response` `getResponse()` Return the Response with which this Request is associated.
`java.net.Socket` `getSocket()` Return the Socket (if any) through which this Request was received.
`java.io.InputStream` `getStream()` Return the input stream associated with this Request.
`Wrapper` `getWrapper()` Return the Wrapper within which this Request is being processed.
`void` `recycle()` Release all object references, and initialize instance variables, in preparation for reuse of this object.
`void` `removeNote(java.lang.String name)` Remove any object bound to the specified name in the internal notes for this request.
`void` `setAuthorization(java.lang.String authorization)` Set the authorization credentials sent with this request.
`void` `setConnector(Connector connector)` Set the Connector through which this Request was received.
`void` `setContentLength(int length)` Set the content length associated with this Request.
`void` `setContentType(java.lang.String type)` Set the content type (and optionally the character encoding) associated with this Request.
`void` `setContext(Context context)` Set the Context within which this Request is being processed.
`void` `setNote(java.lang.String name, java.lang.Object value)` Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.
`void` `setProtocol(java.lang.String protocol)` Set the protocol name and version associated with this Request.
`void` `setRemoteAddr(java.lang.String remote)` Set the remote IP address associated with this Request.
`void` `setResponse(Response response)` Set the Response with which this Request is associated.
`void` `setScheme(java.lang.String scheme)` Set the name of the scheme associated with this request.
`void` `setSecure(boolean secure)` Set the value to be returned by `isSecure()` for this Request.
`void` `setServerName(java.lang.String name)` Set the name of the server (virtual host) to process this request.
`void` `setServerPort(int port)` Set the port number of the server to process this request.
`void` `setSocket(java.net.Socket socket)` Set the Socket (if any) through which this Request was received.
`void` `setStream(java.io.InputStream stream)` Set the input stream associated with this Request.
`void` `setWrapper(Wrapper wrapper)` Set the Wrapper within which this Request is being processed.

Method Detail

### getAuthorization

    public java.lang.String getAuthorization()

  Return the authorization credentials sent with this request.

### setAuthorization

    public void setAuthorization(java.lang.String authorization)

  Set the authorization credentials sent with this request.

  Parameters:
    `authorization` - The new authorization credentials

### getConnector

    public Connector getConnector()

  Return the Connector through which this Request was received.

### setConnector

    public void setConnector(Connector connector)

  Set the Connector through which this Request was received.

  Parameters:
    `connector` - The new connector

### getContext

    public Context getContext()

  Return the Context within which this Request is being processed.

### setContext

    public void setContext(Context context)

  Set the Context within which this Request is being processed. This must be called as soon as the appropriate Context is identified, because it identifies the value to be returned by `getContextPath()`, and thus enables parsing of the request URI.

  Parameters:
    `context` - The newly associated Context

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this Request implementation and the corresponding version number, in the format `<description>/<version>`.

### getRequest

    public javax.servlet.ServletRequest getRequest()

  Return the `ServletRequest` for which this object is the facade.

### getResponse

    public Response getResponse()

  Return the Response with which this Request is associated.

### setResponse

    public void setResponse(Response response)

  Set the Response with which this Request is associated.

  Parameters:
    `response` - The new associated response

### getSocket

    public java.net.Socket getSocket()

  Return the Socket (if any) through which this Request was received. This should only be used to access underlying state information about this Socket, such as the SSLSession associated with an SSLSocket.

### setSocket

    public void setSocket(java.net.Socket socket)

  Set the Socket (if any) through which this Request was received.

  Parameters:
    `socket` - The socket through which this request was received

### getStream

    public java.io.InputStream getStream()

  Return the input stream associated with this Request.

### setStream

    public void setStream(java.io.InputStream stream)

  Set the input stream associated with this Request.

  Parameters:
    `stream` - The new input stream

### getWrapper

    public Wrapper getWrapper()

  Return the Wrapper within which this Request is being processed.

### setWrapper

    public void setWrapper(Wrapper wrapper)

  Set the Wrapper within which this Request is being processed. This must be called as soon as the appropriate Wrapper is identified, and before the Request is ultimately passed to an application servlet.

  Parameters:
    `wrapper` - The newly associated Wrapper

### createInputStream

    public javax.servlet.ServletInputStream createInputStream()
                                                       throws java.io.IOException

  Create and return a ServletInputStream to read the content associated with this Request.

  Throws:
    `java.io.IOException` - if an input/output error occurs

### finishRequest

    public void finishRequest()
                       throws java.io.IOException

  Perform whatever actions are required to flush and close the input stream or reader, in a single operation.

  Throws:
    `java.io.IOException` - if an input/output error occurs

### getNote

    public java.lang.Object getNote(java.lang.String name)

  Return the object bound with the specified name to the internal notes for this request, or `null` if no such binding exists.

  Parameters:
    `name` - Name of the note to be returned

### getNoteNames

    public java.util.Iterator getNoteNames()

  Return an Iterator containing the String names of all notes bindings that exist for this request.

### recycle

    public void recycle()

  Release all object references, and initialize instance variables, in preparation for reuse of this object.

### removeNote

    public void removeNote(java.lang.String name)

  Remove any object bound to the specified name in the internal notes for this request.

  Parameters:
    `name` - Name of the note to be removed

### setContentLength

    public void setContentLength(int length)

  Set the content length associated with this Request.

  Parameters:
    `length` - The new content length

### setContentType

    public void setContentType(java.lang.String type)

  Set the content type (and optionally the character encoding) associated with this Request. For example, `text/html; charset=ISO-8859-4`.

  Parameters:
    `type` - The new content type

### setNote

    public void setNote(java.lang.String name,
                        java.lang.Object value)

  Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.

  Parameters:
    `name` - Name to which the object should be bound
    `value` - Object to be bound to the specified name

### setProtocol

    public void setProtocol(java.lang.String protocol)

  Set the protocol name and version associated with this Request.

  Parameters:
    `protocol` - Protocol name and version

### setRemoteAddr

    public void setRemoteAddr(java.lang.String remote)

  Set the remote IP address associated with this Request. NOTE: This value will be used to resolve the value for `getRemoteHost()` if that method is called.

  Parameters:
    `remote` - The remote IP address

### setScheme

    public void setScheme(java.lang.String scheme)

  Set the name of the scheme associated with this request. Typical values are `http`, `https`, and `ftp`.

  Parameters:
    `scheme` - The scheme

### setSecure

    public void setSecure(boolean secure)

  Set the value to be returned by `isSecure()` for this Request.

  Parameters:
    `secure` - The new isSecure value

### setServerName

    public void setServerName(java.lang.String name)

  Set the name of the server (virtual host) to process this request.

  Parameters:
    `name` - The server name

### setServerPort

    public void setServerPort(int port)

  Set the port number of the server to process this request.

  Parameters:
    `port` - The server port

Copyright ? 2000-2002 Apache Software Foundation. All Rights Reserved.