org.openejb.server.httpd
Interface HttpRequest

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
HttpRequestImpl

public interface HttpRequest
extends java.io.Serializable

An interface to take care of HTTP Requests. It parses headers, content, form and url parameters.


Field Summary
static int CONNECT
          the HTTP CONNECT type
static int DELETE
          the HTTP DELETE type
static int GET
          the HTTP GET type
static int HEAD
          the HTTP HEAD type
static java.lang.String HEADER_ACCEPT
          the Accept header
static java.lang.String HEADER_ACCEPT_ENCODING
          the Accept-Encoding header
static java.lang.String HEADER_ACCEPT_LANGUAGE
          the Accept-Language header
static java.lang.String HEADER_CACHE_CONTROL
          the Cache-Control header
static java.lang.String HEADER_CONNECTION
          the Connection header
static java.lang.String HEADER_CONTENT_LENGTH
          the Content-Length header
static java.lang.String HEADER_CONTENT_TYPE
          the Content-Type header
static java.lang.String HEADER_COOKIE
          the Cookie header
static java.lang.String HEADER_HOST
          the Host header
static java.lang.String HEADER_SET_COOKIE
          the Set-Cookie header
static java.lang.String HEADER_USER_AGENT
          the User-Agent header
static int OPTIONS
          the HTTP OPTIONS type
static int POST
          the HTTP POST type
static int PUT
          the HTTP PUT type
static int TRACE
          the HTTP TRACE type
static int UNSUPPORTED
          the HTTP UNSUPPORTED type
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
           
 int getContentLength()
           
 java.lang.String getContentType()
           
 java.lang.String getHeader(java.lang.String name)
          Gets a header based the header name passed in.
 java.io.InputStream getInputStream()
           
 int getMethod()
          Gets an integer value of the request method.
 java.lang.String getParameter(java.lang.String name)
          Gets a form or URL query parameter based on the name passed in.
 java.util.Map getParameters()
          Gets all the form and URL query parameters
 HttpSession getSession()
          Returns the current session associated with this request, or if the request does not have a session, creates one.
 HttpSession getSession(boolean create)
          Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
 java.net.URI getURI()
          Gets the URI for the current URL page.
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 

Field Detail

OPTIONS

static final int OPTIONS
the HTTP OPTIONS type

See Also:
Constant Field Values

GET

static final int GET
the HTTP GET type

See Also:
Constant Field Values

HEAD

static final int HEAD
the HTTP HEAD type

See Also:
Constant Field Values

POST

static final int POST
the HTTP POST type

See Also:
Constant Field Values

PUT

static final int PUT
the HTTP PUT type

See Also:
Constant Field Values

DELETE

static final int DELETE
the HTTP DELETE type

See Also:
Constant Field Values

TRACE

static final int TRACE
the HTTP TRACE type

See Also:
Constant Field Values

CONNECT

static final int CONNECT
the HTTP CONNECT type

See Also:
Constant Field Values

UNSUPPORTED

static final int UNSUPPORTED
the HTTP UNSUPPORTED type

See Also:
Constant Field Values

HEADER_ACCEPT

static final java.lang.String HEADER_ACCEPT
the Accept header

See Also:
Constant Field Values

HEADER_ACCEPT_ENCODING

static final java.lang.String HEADER_ACCEPT_ENCODING
the Accept-Encoding header

See Also:
Constant Field Values

HEADER_ACCEPT_LANGUAGE

static final java.lang.String HEADER_ACCEPT_LANGUAGE
the Accept-Language header

See Also:
Constant Field Values

HEADER_CONTENT_TYPE

static final java.lang.String HEADER_CONTENT_TYPE
the Content-Type header

See Also:
Constant Field Values

HEADER_CONTENT_LENGTH

static final java.lang.String HEADER_CONTENT_LENGTH
the Content-Length header

See Also:
Constant Field Values

HEADER_CONNECTION

static final java.lang.String HEADER_CONNECTION
the Connection header

See Also:
Constant Field Values

HEADER_CACHE_CONTROL

static final java.lang.String HEADER_CACHE_CONTROL
the Cache-Control header

See Also:
Constant Field Values

HEADER_HOST

static final java.lang.String HEADER_HOST
the Host header

See Also:
Constant Field Values

HEADER_USER_AGENT

static final java.lang.String HEADER_USER_AGENT
the User-Agent header

See Also:
Constant Field Values

HEADER_SET_COOKIE

static final java.lang.String HEADER_SET_COOKIE
the Set-Cookie header

See Also:
Constant Field Values

HEADER_COOKIE

static final java.lang.String HEADER_COOKIE
the Cookie header

See Also:
Constant Field Values
Method Detail

getParameter

java.lang.String getParameter(java.lang.String name)
Gets a form or URL query parameter based on the name passed in.

Parameters:
name -

getParameters

java.util.Map getParameters()
Gets all the form and URL query parameters

Returns:
All the form and URL query parameters

getSession

HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

If create is false and the request has no valid HttpSession, this method returns null.

Parameters:
create - true to create a new session for this request if necessary; false to return null if there's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
See Also:
getSession()

getSession

HttpSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.

Returns:
the HttpSession associated with this request
See Also:
getSession(boolean)

getHeader

java.lang.String getHeader(java.lang.String name)
Gets a header based the header name passed in.

Parameters:
name - The name of the header to get
Returns:
The value of the header

getMethod

int getMethod()
Gets an integer value of the request method. These values are: OPTIONS = 0 GET = 1 HEAD = 2 POST = 3 PUT = 4 DELETE = 5 TRACE = 6 CONNECT = 7 UNSUPPORTED = 8

Returns:
The integer value of the method

getURI

java.net.URI getURI()
Gets the URI for the current URL page.

Returns:
The URI

getContentLength

int getContentLength()

getContentType

java.lang.String getContentType()

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

getAttribute

java.lang.Object getAttribute(java.lang.String name)

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)


Copyright © 1999-2011 OpenEJB. All Rights Reserved.