org.enhydra.servlet.connectionMethods.EnhydraDirector
Class DirectorHttpRequest

java.lang.Object
  extended byorg.mortbay.http.HttpMessage
      extended byorg.mortbay.http.HttpRequest
          extended byorg.enhydra.servlet.connectionMethods.EnhydraDirector.DirectorHttpRequest

public class DirectorHttpRequest
extends org.mortbay.http.HttpRequest

Author:
Milin Radivoj

Nested Class Summary
 
Nested classes inherited from class org.mortbay.http.HttpMessage
org.mortbay.http.HttpMessage.HeaderWriter
 
Field Summary
 
Fields inherited from class org.mortbay.http.HttpRequest
__CONNECT, __DELETE, __GET, __HEAD, __maxFormContentSize, __maxLineLength, __methodCache, __MOVE, __OPTIONS, __POST, __PUT, __TRACE, __versionCache
 
Fields inherited from class org.mortbay.http.HttpMessage
__HTTP_0_9, __HTTP_1_0, __HTTP_1_1, __HTTP_1_X, __MSG_BAD, __MSG_EDITABLE, __MSG_RECEIVED, __MSG_SENDING, __MSG_SENT, __SCHEME, __SSL_SCHEME, __state, _attributes, _characterEncoding, _connection, _dotVersion, _header, _mimeType, _state, _version, _wrapper
 
Constructor Summary
DirectorHttpRequest(EnhydraDirectorConnection conn, EnhydraConnection base)
           
 
Method Summary
 void addDateField(java.lang.String name, java.util.Date date)
          Adds the value of a date field.
 void addDateField(java.lang.String name, long date)
          Add the value of a date field.
 void addField(java.lang.String name, java.lang.String value)
          Add to a multi-value field value.
 void addIntField(java.lang.String name, int value)
          Adds the value of an integer field.
 boolean containsField(java.lang.String name)
           
 void destroy()
          Destroy the message.
 java.lang.Object getAttribute(java.lang.String name)
          Get a request attribute.
 java.util.Enumeration getAttributeNames()
          Get Attribute names.
 java.lang.String getAuthType()
           
 java.lang.String getAuthUser()
           
 java.lang.String getCharacterEncoding()
          Character Encoding.
 int getContentLength()
           
 java.lang.String getContentType()
           
 javax.servlet.http.Cookie[] getCookies()
          Extract received cookies from a header.
 long getDateField(java.lang.String name)
          Get a header as a date value.
 java.lang.String getEncodedPath()
          Get the encoded request path.
 EnhydraDirectorConnection getEnhydraDirectorConnection()
           
 java.lang.String getField(java.lang.String name)
          Get a value of header.
 java.util.Enumeration getFieldNames()
          Get Header Names.
 java.util.Enumeration getFieldValues(java.lang.String name)
          Get a values of header.
 java.util.Enumeration getFieldValues(java.lang.String name, java.lang.String separators)
          Get a values of header.
 org.mortbay.http.HttpFields getHeader()
           
 java.lang.String getHost()
           
 java.io.InputStream getInputStream()
           
 int getIntField(java.lang.String name)
          Get a field as an integer value.
 java.lang.String getMethod()
          Get the HTTP method for this request.
 java.io.OutputStream getOutputStream()
           
 java.lang.String getParameter(java.lang.String name)
          Get a parameter value.
 java.util.Set getParameterNames()
          Get the set of parameter names.
 org.mortbay.util.MultiMap getParameters()
           
 java.util.Map getParameterStringArrayMap()
           
 java.util.List getParameterValues(java.lang.String name)
          Get multi valued paramater.
 java.lang.String getPath()
          Get the request path.
 int getPort()
          Get the request port.
 java.lang.String getProtocol()
           
 java.lang.String getQuery()
          Get the request query.
 java.lang.String getRemoteAddr()
           
 java.lang.String getRemoteHost()
           
 java.lang.StringBuffer getRequestURL()
          Reconstructs the URL the client used to make the request.
 java.lang.StringBuffer getRootURL()
          Reconstructs the URL the client used to make the request.
 java.lang.String getScheme()
          Get the request Scheme.
 java.lang.String getServerName()
           
 int getServerPort()
           
 org.mortbay.util.URI getURI()
          Get the full URI.
 boolean isCommitted()
           
 boolean isDirty()
           
 boolean isHandled()
           
 void removeAttribute(java.lang.String name)
          Remove a request attribute.
 java.lang.String removeField(java.lang.String name)
          Remove a field.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object attribute)
          Set a request attribute.
 void setAuthType(java.lang.String a)
           
 void setAuthUser(java.lang.String user)
           
 void setCharacterEncoding(java.lang.String encoding, boolean setField)
          Set Character Encoding.
 void setContentLength(int len)
           
 void setContentType(java.lang.String contentType)
           
 void setDateField(java.lang.String name, java.util.Date date)
          Sets the value of a date field.
 void setDateField(java.lang.String name, long date)
          Sets the value of a date field.
 void setField(java.lang.String name, java.util.List value)
          Set a multi-value field value.
 java.lang.String setField(java.lang.String name, java.lang.String value)
          Set a field value.
 void setIntField(java.lang.String name, int value)
          Sets the value of an integer field.
 void setMethod(java.lang.String method)
           
 void setPath(java.lang.String path)
           
 void setQuery(java.lang.String q)
           
 java.lang.String toString()
           
 
Methods inherited from class org.mortbay.http.HttpRequest
getAcceptableTransferCodings, getHttpResponse, getRequestLine, getResponse, getTimeStamp, getTimeStampStr, getUserPrincipal, getVersion, hasUserPrincipal, isConfidential, isIntegral, isUserInRole, readHeader, setHandled, setTimeStamp, setUserPrincipal, writeHeader, writeRequestLine
 
Methods inherited from class org.mortbay.http.HttpMessage
getDotVersion, getHttpConnection, getMimeType, getState, getWrapper, reset, setState, setVersion, setWrapper, updateMimeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectorHttpRequest

public DirectorHttpRequest(EnhydraDirectorConnection conn,
                           EnhydraConnection base)
Method Detail

getEnhydraDirectorConnection

public EnhydraDirectorConnection getEnhydraDirectorConnection()

getInputStream

public java.io.InputStream getInputStream()

getOutputStream

public java.io.OutputStream getOutputStream()

getFieldNames

public java.util.Enumeration getFieldNames()
Get Header Names.

Returns:
Enumeration of Header Names

containsField

public boolean containsField(java.lang.String name)

getField

public java.lang.String getField(java.lang.String name)
Get a value of header.

Parameters:
name -
Returns:
field value or null

getFieldValues

public java.util.Enumeration getFieldValues(java.lang.String name)
Get a values of header.

Parameters:
name -
Returns:
Enumeration of field values or null

getFieldValues

public java.util.Enumeration getFieldValues(java.lang.String name,
                                            java.lang.String separators)
Get a values of header.

Parameters:
name -
separators - String of separators.
Returns:
Enumeration of values or null

setField

public java.lang.String setField(java.lang.String name,
                                 java.lang.String value)
Set a field value.

Parameters:
name - Name of field
value - New value of field
Returns:
Old value of field

setField

public void setField(java.lang.String name,
                     java.util.List value)
Set a multi-value field value.

Parameters:
name - Name of field
value - New values of field

addField

public void addField(java.lang.String name,
                     java.lang.String value)
              throws java.lang.IllegalStateException
Add to a multi-value field value.

Parameters:
name - Name of field
value - New value to add to the field
Throws:
java.lang.IllegalStateException - Not editable or sending 1.1 with trailers

getIntField

public int getIntField(java.lang.String name)
Get a field as an integer value.

Parameters:
name - the case-insensitive field name

setIntField

public void setIntField(java.lang.String name,
                        int value)
Sets the value of an integer field.

Parameters:
name - the field name
value - the field integer value

addIntField

public void addIntField(java.lang.String name,
                        int value)
Adds the value of an integer field.

Parameters:
name - the field name
value - the field integer value

getDateField

public long getDateField(java.lang.String name)
Get a header as a date value.

Parameters:
name - the case-insensitive field name

setDateField

public void setDateField(java.lang.String name,
                         java.util.Date date)
Sets the value of a date field.

Parameters:
name - the field name
date - the field date value

addDateField

public void addDateField(java.lang.String name,
                         java.util.Date date)
Adds the value of a date field.

Parameters:
name - the field name
date - the field date value

setDateField

public void setDateField(java.lang.String name,
                         long date)
Sets the value of a date field.

Parameters:
name - the field name
date - the field date value

addDateField

public void addDateField(java.lang.String name,
                         long date)
Add the value of a date field.

Parameters:
name - the field name
date - the field date value
Throws:
java.lang.IllegalStateException - Not editable or sending 1.1 with trailers

removeField

public java.lang.String removeField(java.lang.String name)
                             throws java.lang.IllegalStateException
Remove a field.

Parameters:
name - Name of field
Returns:
Old value of field
Throws:
java.lang.IllegalStateException

getHeader

public org.mortbay.http.HttpFields getHeader()

getContentLength

public int getContentLength()

setContentLength

public void setContentLength(int len)

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Character Encoding.

Returns:
Character Encoding

setCharacterEncoding

public void setCharacterEncoding(java.lang.String encoding,
                                 boolean setField)
Set Character Encoding.


getContentType

public java.lang.String getContentType()

setContentType

public void setContentType(java.lang.String contentType)

destroy

public void destroy()
Destroy the message. Help the garbage collector by nulling everything that we can.


toString

public java.lang.String toString()

isCommitted

public boolean isCommitted()

isDirty

public boolean isDirty()

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Get a request attribute.

Parameters:
name - Attribute name
Returns:
Attribute value

setAttribute

public java.lang.Object setAttribute(java.lang.String name,
                                     java.lang.Object attribute)
Set a request attribute.

Parameters:
name - Attribute name
attribute - Attribute value
Returns:
Previous Attribute value

getAttributeNames

public java.util.Enumeration getAttributeNames()
Get Attribute names.

Returns:
Enumeration of Strings

removeAttribute

public void removeAttribute(java.lang.String name)
Remove a request attribute.

Parameters:
name - Attribute name

getMethod

public java.lang.String getMethod()
Get the HTTP method for this request.

Returns:
The method

setMethod

public void setMethod(java.lang.String method)

getProtocol

public java.lang.String getProtocol()

getRootURL

public java.lang.StringBuffer getRootURL()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and, but it does not include a path.

Returns:
"scheme://host:port"

getRequestURL

public java.lang.StringBuffer getRequestURL()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

Returns:
a StringBuffer object containing the reconstructed URL

getURI

public org.mortbay.util.URI getURI()
Get the full URI.

Returns:
the request URI

getScheme

public java.lang.String getScheme()
Get the request Scheme.

Returns:
The request scheme (eg. "http", "https", etc.)

getHost

public java.lang.String getHost()

getPort

public int getPort()
Get the request port.

Returns:
The port. 0 should be interpreted as the default port.

getPath

public java.lang.String getPath()
Get the request path.

Returns:
The URI path of the request.

setPath

public void setPath(java.lang.String path)

getEncodedPath

public java.lang.String getEncodedPath()
Get the encoded request path.

Returns:
The path with % encoding.

getQuery

public java.lang.String getQuery()
Get the request query.

Returns:
the request query excluding the '?'

setQuery

public void setQuery(java.lang.String q)

getParameters

public org.mortbay.util.MultiMap getParameters()
Returns:
Map of parameters

getParameterNames

public java.util.Set getParameterNames()
Get the set of parameter names.

Returns:
Set of parameter names.

getParameter

public java.lang.String getParameter(java.lang.String name)
Get a parameter value.

Parameters:
name - Parameter name
Returns:
Parameter value

getParameterValues

public java.util.List getParameterValues(java.lang.String name)
Get multi valued paramater.

Parameters:
name - Parameter name
Returns:
Parameter values

getParameterStringArrayMap

public java.util.Map getParameterStringArrayMap()
Returns:
Parameters as a map of String arrays

getCookies

public javax.servlet.http.Cookie[] getCookies()
Extract received cookies from a header.

Returns:
Array of Cookies.

getAuthType

public java.lang.String getAuthType()

setAuthType

public void setAuthType(java.lang.String a)

getAuthUser

public java.lang.String getAuthUser()

setAuthUser

public void setAuthUser(java.lang.String user)

isHandled

public boolean isHandled()

getRemoteAddr

public java.lang.String getRemoteAddr()

getRemoteHost

public java.lang.String getRemoteHost()

getServerName

public java.lang.String getServerName()

getServerPort

public int getServerPort()