org.apache.tomcat.core
Interface Request

All Known Implementing Classes:
RequestImpl

public interface Request


Field Summary
static int MAX_INCLUDE
           
static java.lang.String SESSIONID_FROM_COOKIE
           
static java.lang.String SESSIONID_FROM_URL
           
 
Method Summary
 int doRead(byte[] b, int off, int len)
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Enumeration getAttributeNames()
           
 java.lang.String getAuthType()
           
 java.lang.String getCharacterEncoding()
           
 Request getChild()
          During include, a sub-request will be created.
 Container getContainer()
           
 int getContentLength()
           
 java.lang.String getContentType()
           
 Context getContext()
           
 ContextManager getContextManager()
           
 javax.servlet.http.Cookie getCookie(int idx)
           
 int getCookieCount()
           
 javax.servlet.http.HttpServletRequest getFacade()
          One-to-One with Facade
 java.lang.String getHeader(java.lang.String name)
           
 java.util.Enumeration getHeaderNames()
           
 java.util.Enumeration getHeaders(java.lang.String name)
           
 org.apache.tomcat.util.ByteBuffer getInputBuffer()
           
 javax.servlet.ServletInputStream getInputStream()
           
 java.lang.String getJvmRoute()
           
 java.lang.String getLocalHost()
           
 java.lang.String getMethod()
           
 org.apache.tomcat.util.MimeHeaders getMimeHeaders()
           
 java.lang.Object getNote(int pos)
           
 java.lang.String getParameter(java.lang.String name)
           
 java.util.Enumeration getParameterNames()
           
 java.util.Hashtable getParameters()
          Deprecated. internal use only
 java.lang.String[] getParameterValues(java.lang.String name)
          Set query string - will be called by forward
 Request getParent()
          If this is a sub-request, return the parent
 java.lang.String getPathInfo()
          Path Info - set be mappers or from adapter
 java.lang.String getPathTranslated()
          Real Path - should be implemented as a callback ( override it in adapters).
 java.lang.String getProtocol()
           
 java.lang.String getQueryString()
           
 java.io.BufferedReader getReader()
           
 java.lang.String getRemoteAddr()
           
 java.lang.String getRemoteHost()
          Expensive - should be implemented as a callback where possible!
 java.lang.String getRemoteUser()
           
 java.lang.String getRequestedSessionId()
           
 java.lang.String getRequestURI()
           
 java.lang.String[] getRequiredRoles()
          If this request is subject to a security constraint.
 Response getResponse()
          One-to-One with Response
 java.lang.String getScheme()
           
 java.lang.String getServerName()
           
 int getServerPort()
           
 java.lang.String getServletPath()
           
 javax.servlet.http.HttpSession getSession(boolean create)
           
 java.lang.String getSessionIdSource()
          Get the source of the session Id.
 Request getTop()
          This is the top request ( for a sub-request )
 java.security.Principal getUserPrincipal()
           
 java.lang.String[] getUserRoles()
           
 ServletWrapper getWrapper()
          Deprecated. - use Container instead
 boolean isSecure()
           
 boolean isUserInRole(java.lang.String role)
           
 void recycle()
          Support for "pools"
 void removeAttribute(java.lang.String name)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setAuthType(java.lang.String authType)
           
 void setCharEncoding(java.lang.String enc)
           
 void setChild(Request req)
           
 void setContainer(Container handler)
           
 void setContentLength(int len)
           
 void setContentType(java.lang.String type)
           
 void setContext(Context context)
          Context - will be set by contextMap stage of request interceptors
 void setContextManager(ContextManager cm)
          Pointer to the server engine - for errors, etc
 void setInputBuffer(org.apache.tomcat.util.ByteBuffer buf)
           
 void setJvmRoute(java.lang.String route)
           
 void setLocalHost(java.lang.String host)
           
 void setMethod(java.lang.String s)
           
 void setNote(int pos, java.lang.Object value)
          Add a per/request internal attribute.
 void setParameters(java.util.Hashtable h)
          Deprecated. internal use only
 void setParent(Request req)
           
 void setPathInfo(java.lang.String pathInfo)
           
 void setPathTranslated(java.lang.String path)
           
 void setProtocol(java.lang.String p)
           
 void setQueryString(java.lang.String q)
           
 void setRemoteAddr(java.lang.String remote)
           
 void setRemoteHost(java.lang.String s)
           
 void setRemoteUser(java.lang.String s)
           
 void setRequestedSessionId(java.lang.String reqSessionId)
           
 void setRequestURI(java.lang.String s)
           
 void setRequiredRoles(java.lang.String[] roles)
           
 void setResponse(Response response)
           
 void setScheme(java.lang.String r)
           
 void setServerName(java.lang.String serverName)
           
 void setServerPort(int i)
           
 void setServletPath(java.lang.String servletPath)
          Servlet Path
 void setSession(javax.servlet.http.HttpSession serverSession)
           
 void setSessionIdSource(java.lang.String s)
           
 void setUserPrincipal(java.security.Principal p)
           
 void setUserRoles(java.lang.String[] roles)
           
 void setWrapper(ServletWrapper handler)
          Deprecated. - use Container instead
 

Field Detail

SESSIONID_FROM_COOKIE

public static final java.lang.String SESSIONID_FROM_COOKIE

SESSIONID_FROM_URL

public static final java.lang.String SESSIONID_FROM_URL

MAX_INCLUDE

public static final int MAX_INCLUDE
Method Detail

getScheme

public java.lang.String getScheme()

setScheme

public void setScheme(java.lang.String r)

getMethod

public java.lang.String getMethod()

setMethod

public void setMethod(java.lang.String s)

getRequestURI

public java.lang.String getRequestURI()

setRequestURI

public void setRequestURI(java.lang.String s)

getQueryString

public java.lang.String getQueryString()

setQueryString

public void setQueryString(java.lang.String q)

getProtocol

public java.lang.String getProtocol()

setProtocol

public void setProtocol(java.lang.String p)

getServerName

public java.lang.String getServerName()

setServerName

public void setServerName(java.lang.String serverName)

getServerPort

public int getServerPort()

setServerPort

public void setServerPort(int i)

getRemoteAddr

public java.lang.String getRemoteAddr()

setRemoteAddr

public void setRemoteAddr(java.lang.String remote)

getRemoteHost

public java.lang.String getRemoteHost()
Expensive - should be implemented as a callback where possible!

setRemoteHost

public void setRemoteHost(java.lang.String s)

getLocalHost

public java.lang.String getLocalHost()

setLocalHost

public void setLocalHost(java.lang.String host)

getMimeHeaders

public org.apache.tomcat.util.MimeHeaders getMimeHeaders()

getHeader

public java.lang.String getHeader(java.lang.String name)

getHeaderNames

public java.util.Enumeration getHeaderNames()

getHeaders

public java.util.Enumeration getHeaders(java.lang.String name)

getCookie

public javax.servlet.http.Cookie getCookie(int idx)

getCookieCount

public int getCookieCount()

getContentLength

public int getContentLength()

setContentLength

public void setContentLength(int len)

getContentType

public java.lang.String getContentType()

setContentType

public void setContentType(java.lang.String type)

setCharEncoding

public void setCharEncoding(java.lang.String enc)

getCharacterEncoding

public java.lang.String getCharacterEncoding()

setContext

public void setContext(Context context)
Context - will be set by contextMap stage of request interceptors

getContext

public Context getContext()

getPathTranslated

public java.lang.String getPathTranslated()
Real Path - should be implemented as a callback ( override it in adapters). Map interceptor should set it to something reasonable ( context home + path ) MappedPath is similar - it contain mappings inside a context, for normal contexts pathTranslated==context.docBase + mappedPath

setPathTranslated

public void setPathTranslated(java.lang.String path)

getPathInfo

public java.lang.String getPathInfo()
Path Info - set be mappers or from adapter

setPathInfo

public void setPathInfo(java.lang.String pathInfo)

setServletPath

public void setServletPath(java.lang.String servletPath)
Servlet Path

getServletPath

public java.lang.String getServletPath()

getContainer

public Container getContainer()

setContainer

public void setContainer(Container handler)

getAuthType

public java.lang.String getAuthType()

setAuthType

public void setAuthType(java.lang.String authType)

getRemoteUser

public java.lang.String getRemoteUser()

setRemoteUser

public void setRemoteUser(java.lang.String s)

isSecure

public boolean isSecure()

setUserRoles

public void setUserRoles(java.lang.String[] roles)

getUserRoles

public java.lang.String[] getUserRoles()

getRequiredRoles

public java.lang.String[] getRequiredRoles()
If this request is subject to a security constraint. A better way would be to have a "merge" mechanism to add all properties to the container ( like in Apache), but until this is implemented we'll just keep the fields in request.

setRequiredRoles

public void setRequiredRoles(java.lang.String[] roles)

getUserPrincipal

public java.security.Principal getUserPrincipal()

setUserPrincipal

public void setUserPrincipal(java.security.Principal p)

isUserInRole

public boolean isUserInRole(java.lang.String role)

getJvmRoute

public java.lang.String getJvmRoute()

setJvmRoute

public void setJvmRoute(java.lang.String route)

getRequestedSessionId

public java.lang.String getRequestedSessionId()

setRequestedSessionId

public void setRequestedSessionId(java.lang.String reqSessionId)

getSessionIdSource

public java.lang.String getSessionIdSource()
Get the source of the session Id.

setSessionIdSource

public void setSessionIdSource(java.lang.String s)

setSession

public void setSession(javax.servlet.http.HttpSession serverSession)

getSession

public javax.servlet.http.HttpSession getSession(boolean create)

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Set query string - will be called by forward

getParameter

public java.lang.String getParameter(java.lang.String name)

getParameterNames

public java.util.Enumeration getParameterNames()

getAttribute

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

setAttribute

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

removeAttribute

public void removeAttribute(java.lang.String name)

getAttributeNames

public java.util.Enumeration getAttributeNames()

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException

getInputStream

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

doRead

public int doRead(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException

recycle

public void recycle()
Support for "pools"

getResponse

public Response getResponse()
One-to-One with Response

setResponse

public void setResponse(Response response)

getFacade

public javax.servlet.http.HttpServletRequest getFacade()
One-to-One with Facade

setContextManager

public void setContextManager(ContextManager cm)
Pointer to the server engine - for errors, etc

getContextManager

public ContextManager getContextManager()

setParameters

public void setParameters(java.util.Hashtable h)
Deprecated. internal use only


getParameters

public java.util.Hashtable getParameters()
Deprecated. internal use only


getWrapper

public ServletWrapper getWrapper()
Deprecated. - use Container instead

Wrapper - the servlet that will execute the request Similar with "handler" in Apache.

setWrapper

public void setWrapper(ServletWrapper handler)
Deprecated. - use Container instead


getParent

public Request getParent()
If this is a sub-request, return the parent

setParent

public void setParent(Request req)

getChild

public Request getChild()
During include, a sub-request will be created. This represents the current included request

setChild

public void setChild(Request req)

getTop

public Request getTop()
This is the top request ( for a sub-request )

getInputBuffer

public org.apache.tomcat.util.ByteBuffer getInputBuffer()

setInputBuffer

public void setInputBuffer(org.apache.tomcat.util.ByteBuffer buf)

setNote

public void setNote(int pos,
                    java.lang.Object value)
Add a per/request internal attribute. We keep internal attributes in a separate space to prevent servlets from accessing them. We also use indexed access for speed ( as oposed to hashtable lookups ). Get an Id from ContextManager.

getNote

public java.lang.Object getNote(int pos)


Copyright © 2000 Apache Software Foundation. All Rights Reserved.