railo.runtime.net.http
Class HttpServletRequestDummy

java.lang.Object
  extended by railo.runtime.net.http.HttpServletRequestDummy
All Implemented Interfaces:
Serializable, javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public final class HttpServletRequestDummy
extends Object
implements javax.servlet.http.HttpServletRequest, Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HttpServletRequestDummy(Resource contextRoot, String serverName, String scriptName, String queryString, javax.servlet.http.Cookie[] cookies, Pair[] headers, Pair[] parameters, Struct attributes, javax.servlet.http.HttpSession session)
          constructor of the class
 
Method Summary
 void addHeader(String name, String value)
          add a new header value
 void addParameter(String key, String value)
           
static HttpServletRequestDummy clone(Config config, Resource rootDirectory, javax.servlet.http.HttpServletRequest req)
           
 Object getAttribute(String key)
           
 Enumeration getAttributeNames()
           
 String getAuthType()
           
 String getCharacterEncoding()
           
 int getContentLength()
           
 String getContentType()
           
 String getContextPath()
           
 javax.servlet.http.Cookie[] getCookies()
           
 long getDateHeader(String name)
           
 String getHeader(String name)
           
 Enumeration getHeaderNames()
           
 Enumeration getHeaders(String name)
           
 byte[] getInputData()
           
 javax.servlet.ServletInputStream getInputStream()
           
 int getIntHeader(String name)
           
 Locale getLocale()
           
 Enumeration getLocales()
           
 String getMethod()
           
 String getParameter(String key)
           
 Map getParameterMap()
           
 Enumeration getParameterNames()
           
 String[] getParameterValues(String key)
           
 String getPathInfo()
           
 String getPathTranslated()
           
 String getProtocol()
           
 String getQueryString()
           
 BufferedReader getReader()
           
 String getRealPath(String path)
           
 String getRemoteAddr()
           
 String getRemoteHost()
           
 String getRemoteUser()
           
 javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
           
 String getRequestedSessionId()
           
 String getRequestURI()
           
 StringBuffer getRequestURL()
           
 String getScheme()
           
 String getServerName()
           
 int getServerPort()
           
 String getServletPath()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean arg0)
           
 Principal getUserPrincipal()
           
 boolean isRequestedSessionIdFromCookie()
           
 boolean isRequestedSessionIdFromUrl()
           
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
           
 boolean isSecure()
           
 boolean isUserInRole(String role)
           
 void removeAttribute(String key)
           
 void setAttribute(String key, Object value)
           
 void setAttributes(Struct attributes)
           
 void setAuthType(String authType)
          sets the name of the authentication scheme used to protect the servlet.
 void setCharacterEncoding(String characterEncoding)
           
 void setContentType(String contentType)
          sets the content Type of the Request
 void setContextPath(String contextPath)
          sets the portion of the request URI that indicates the context of the request.
 void setCookies(javax.servlet.http.Cookie[] cookies)
          sets an array containing all of the Cookie objects the client sent with this request.
 void setDateHeader(String name, long value)
           
 void setHeader(String name, String value)
          sets a new header value
 void setInputData(byte[] inputData)
           
 void setLocale(Locale locale)
           
 void setMethod(String method)
          sets the request method
 void setParameter(String key, String value)
           
 void setPathInfo(String pathInfo)
          Sets any extra path information associated with the URL the client sent when it made this request.
 void setPathTranslated(String pathTranslated)
          sets any extra path information after the servlet name but before the query string, translates to a real path.
 void setProtocol(String protocol)
          set the Protocol (Default "http")
 void setQueryString(String queryString)
          sets the query string that is contained in the request URL after the path.
 void setRemoteAddr(String remoteAddr)
           
 void setRemoteHost(String remoteHost)
           
 void setRemoteInetAddress(InetAddress ia)
           
 void setRemoteUser(String remoteUser)
          sets the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
 void setRequestedSessionId(String requestedSessionId)
          sets the session ID specified by the client.
 void setRequestURI(String requestURI)
          sets the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
 void setScheme(String scheme)
           
 void setSecure(boolean secure)
           
 void setServerPort(int port)
           
 void setSession(javax.servlet.http.HttpSession session)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServletRequestDummy

public HttpServletRequestDummy(Resource contextRoot,
                               String serverName,
                               String scriptName,
                               String queryString,
                               javax.servlet.http.Cookie[] cookies,
                               Pair[] headers,
                               Pair[] parameters,
                               Struct attributes,
                               javax.servlet.http.HttpSession session)
constructor of the class

Parameters:
headers -
parameters -
httpSession -
pairs -
cookiess -
Method Detail

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getAuthType()

setAuthType

public void setAuthType(String authType)
sets the name of the authentication scheme used to protect the servlet. All servlet containers support basic, form and client certificate authentication, and may additionally support digest authentication.

Parameters:
authType - authentication type

getCookies

public javax.servlet.http.Cookie[] getCookies()
Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getCookies()

setCookies

public void setCookies(javax.servlet.http.Cookie[] cookies)
sets an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.

Parameters:
cookies -

getDateHeader

public long getDateHeader(String name)
Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getDateHeader(java.lang.String)

setDateHeader

public void setDateHeader(String name,
                          long value)

getHeader

public String getHeader(String name)
Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getHeader(java.lang.String)

setHeader

public void setHeader(String name,
                      String value)
sets a new header value

Parameters:
name - name of the new value
value - header value

addHeader

public void addHeader(String name,
                      String value)
add a new header value

Parameters:
name - name of the new value
value - header value

getHeaders

public Enumeration getHeaders(String name)
Specified by:
getHeaders in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getHeaders(java.lang.String)

getHeaderNames

public Enumeration getHeaderNames()
Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getHeaderNames()

getIntHeader

public int getIntHeader(String name)
Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getIntHeader(java.lang.String)

getMethod

public String getMethod()
Specified by:
getMethod in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getMethod()

setMethod

public void setMethod(String method)
sets the request method

Parameters:
method -

getPathInfo

public String getPathInfo()
Specified by:
getPathInfo in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getPathInfo()

setPathInfo

public void setPathInfo(String pathInfo)
Sets any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string.

Parameters:
pathInfo -

getPathTranslated

public String getPathTranslated()
Specified by:
getPathTranslated in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getPathTranslated()

setPathTranslated

public void setPathTranslated(String pathTranslated)
sets any extra path information after the servlet name but before the query string, translates to a real path. Same as the value of the CGI variable PATH_TRANSLATED.

Parameters:
pathTranslated -

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getContextPath()

setContextPath

public void setContextPath(String contextPath)
sets the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character.

Parameters:
contextPath -

getQueryString

public String getQueryString()
Specified by:
getQueryString in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getQueryString()

setQueryString

public void setQueryString(String queryString)
sets the query string that is contained in the request URL after the path. Same as the value of the CGI variable QUERY_STRING.

Parameters:
queryString -

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getRemoteUser()

setRemoteUser

public void setRemoteUser(String remoteUser)
sets the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER.

Parameters:
remoteUser -

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isUserInRole(java.lang.String)

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getUserPrincipal()

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getRequestedSessionId()

setRequestedSessionId

public void setRequestedSessionId(String requestedSessionId)
sets the session ID specified by the client. This may not be the same as the ID of the actual session in use. For example, if the request specified an old (expired) session ID and the server has started a new session, this method gets a new session with a new ID.

Parameters:
requestedSessionId -

getRequestURI

public String getRequestURI()
Specified by:
getRequestURI in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getRequestURI()

setRequestURI

public void setRequestURI(String requestURI)
sets the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String.

Parameters:
requestURI -

getRequestURL

public StringBuffer getRequestURL()
Specified by:
getRequestURL in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getRequestURL()

getServletPath

public String getServletPath()
Specified by:
getServletPath in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getServletPath()

getSession

public javax.servlet.http.HttpSession getSession(boolean arg0)
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getSession(boolean)

getSession

public javax.servlet.http.HttpSession getSession()
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getSession()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdValid()

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Specified by:
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdFromCookie()

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdFromURL()

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Specified by:
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdFromUrl()

getAttribute

public Object getAttribute(String key)
Specified by:
getAttribute in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getAttribute(java.lang.String)

setAttribute

public void setAttribute(String key,
                         Object value)
Specified by:
setAttribute in interface javax.servlet.ServletRequest
See Also:
ServletRequest.setAttribute(java.lang.String, java.lang.Object)

removeAttribute

public void removeAttribute(String key)
Specified by:
removeAttribute in interface javax.servlet.ServletRequest
See Also:
ServletRequest.removeAttribute(java.lang.String)

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getAttributeNames()

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getCharacterEncoding()

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
                          throws UnsupportedEncodingException
Specified by:
setCharacterEncoding in interface javax.servlet.ServletRequest
Throws:
UnsupportedEncodingException
See Also:
ServletRequest.setCharacterEncoding(java.lang.String)

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getContentLength()

getContentType

public String getContentType()
Specified by:
getContentType in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getContentType()

setContentType

public void setContentType(String contentType)
sets the content Type of the Request

Parameters:
contentType -

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws IOException
Specified by:
getInputStream in interface javax.servlet.ServletRequest
Throws:
IOException
See Also:
ServletRequest.getInputStream()

setParameter

public void setParameter(String key,
                         String value)

addParameter

public void addParameter(String key,
                         String value)

getParameter

public String getParameter(String key)
Specified by:
getParameter in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getParameter(java.lang.String)

getParameterValues

public String[] getParameterValues(String key)
Specified by:
getParameterValues in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getParameterValues(java.lang.String)

getParameterNames

public Enumeration getParameterNames()
Specified by:
getParameterNames in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getParameterNames()

getParameterMap

public Map getParameterMap()
Specified by:
getParameterMap in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getParameterMap()

setProtocol

public void setProtocol(String protocol)
set the Protocol (Default "http")

Parameters:
protocol -

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getProtocol()

getScheme

public String getScheme()
Specified by:
getScheme in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getScheme()

setScheme

public void setScheme(String scheme)
See Also:
ServletRequest.getScheme()

getServerName

public String getServerName()
Specified by:
getServerName in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getServerName()

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getServerPort()

setServerPort

public void setServerPort(int port)
Parameters:
port - The port to set.

getReader

public BufferedReader getReader()
                         throws IOException
Specified by:
getReader in interface javax.servlet.ServletRequest
Throws:
IOException
See Also:
ServletRequest.getReader()

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getRemoteAddr()

setRemoteAddr

public void setRemoteAddr(String remoteAddr)

setRemoteHost

public void setRemoteHost(String remoteHost)

getRemoteHost

public String getRemoteHost()
Specified by:
getRemoteHost in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getRemoteHost()

setRemoteInetAddress

public void setRemoteInetAddress(InetAddress ia)

getLocale

public Locale getLocale()
Specified by:
getLocale in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getLocale()

setLocale

public void setLocale(Locale locale)

getLocales

public Enumeration getLocales()
Specified by:
getLocales in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getLocales()

isSecure

public boolean isSecure()
Specified by:
isSecure in interface javax.servlet.ServletRequest
See Also:
ServletRequest.isSecure()

setSecure

public void setSecure(boolean secure)

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getRequestDispatcher(java.lang.String)

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getRealPath(java.lang.String)

getInputData

public byte[] getInputData()
Returns:
the inputData

setInputData

public void setInputData(byte[] inputData)
Parameters:
inputData - the inputData to set

setSession

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

clone

public static HttpServletRequestDummy clone(Config config,
                                            Resource rootDirectory,
                                            javax.servlet.http.HttpServletRequest req)

setAttributes

public void setAttributes(Struct attributes)


Copyright © 2012 Railo