org.mmbase.util
Class scanpage

java.lang.Object
  extended byorg.mmbase.util.scanpage

public class scanpage
extends java.lang.Object

The scanpage is a container class. It holds all information that is needed to identify a user, including servlet objects and MMBase session information. It was introduced to make servscan threadsafe but will probably in the future hold all request related information, because we want to extend the model of offline page generation.

Version:
$Id: scanpage.java,v 1.24 2003/09/01 13:29:47 pierre Exp $
Author:
Daniel Ockeloen
Warning: Will be renamed to:
ScanPage

Field Summary
 java.lang.String body
           
 java.lang.String loadmode
           
 java.lang.String mimetype
           
 java.lang.String name
           
 java.util.Vector params
          The parameters of this page.
 int partlevel
           
 HttpPost poster
          Object for accessing values sent by a form using enctype multipart/form-data.
 ProcessorInterface processor
          The processor set for this page.
 java.lang.String querystring
           
 boolean reload
          Indicates whether elements sucha s 'multilevel' should be reloaded, or whether results stored in cache should be used.
 javax.servlet.http.HttpServletRequest req
          The request object associated with the current page.
 java.lang.String req_line
           
 javax.servlet.http.HttpServletResponse res
          The response object associated with the current page.
 int rstatus
           
 sessionInfo session
          The user's MMBase session object, if available.
 java.lang.String sname
          The session name.
 java.lang.String wantCache
           
 
Constructor Summary
scanpage()
          Empty constructor for code not yet fixed, constructing its own scanpage Should use new constructor if possible.
scanpage(JamesServlet servlet, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, sessionsInterface sessions)
          Construct a scanpage for a servlet
 
Method Summary
 scanpage duplicate()
          Creates a duplicate of this scanpage
 java.lang.String getAddress()
          Extract hostname from scanpage, get address and determine the proxies between it.
 java.lang.String getHeader(java.lang.String name)
          Retrieve a HTTP request header, if available
 java.lang.String getParam(int num)
          Get the parameter specified.
 java.util.Vector getParamsVector()
          Retrieve all parameters of a page.
 java.lang.String getReferer()
          Gets the referrer from the request header.
 java.lang.String getSessionName()
          Return the session name.
 java.lang.String getUrl()
          Return page URL and parameters
 boolean setParamsLine(java.lang.String paramline)
          Manually set the parameterline of a page (as if it was a querystring).
 boolean setParamsVector(java.util.Vector params)
          Manually set the parameters of a page.
 void setReq(javax.servlet.http.HttpServletRequest req)
          Sets the HttpServletRequest.
 void setRes(javax.servlet.http.HttpServletResponse res)
          Sets the HttpServletResponse.
 void setSessionName(java.lang.String name)
          Set the session name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

req

public javax.servlet.http.HttpServletRequest req
The request object associated with the current page.


res

public javax.servlet.http.HttpServletResponse res
The response object associated with the current page.


params

public java.util.Vector params
The parameters of this page. These are either set mnaually using setParamsVector(java.util.Vector), or determined from the page using the req field


processor

public ProcessorInterface processor
The processor set for this page. This values is set and used by scanparser to determine the default processor to call when interpreting LIST tags.


poster

public HttpPost poster
Object for accessing values sent by a form using enctype multipart/form-data.


session

public sessionInfo session
The user's MMBase session object, if available.


sname

public java.lang.String sname
The session name.


name

public java.lang.String name

rstatus

public int rstatus

body

public java.lang.String body

req_line

public java.lang.String req_line

wantCache

public java.lang.String wantCache

mimetype

public java.lang.String mimetype

querystring

public java.lang.String querystring

partlevel

public int partlevel

loadmode

public java.lang.String loadmode

reload

public boolean reload
Indicates whether elements sucha s 'multilevel' should be reloaded, or whether results stored in cache should be used.

Constructor Detail

scanpage

public scanpage()
Empty constructor for code not yet fixed, constructing its own scanpage Should use new constructor if possible.


scanpage

public scanpage(JamesServlet servlet,
                javax.servlet.http.HttpServletRequest req,
                javax.servlet.http.HttpServletResponse res,
                sessionsInterface sessions)
Construct a scanpage for a servlet

Method Detail

setReq

public void setReq(javax.servlet.http.HttpServletRequest req)
Sets the HttpServletRequest. This method is invoked either by the MMBase servlets, or through the MMCI.


setRes

public void setRes(javax.servlet.http.HttpServletResponse res)
Sets the HttpServletResponse. This method is invoked either by the MMBase servlets, or through the MMCI.


getParam

public java.lang.String getParam(int num)
Get the parameter specified.

Parameters:
num - index of the parameter to retrieve
Returns:
the parametervalue

setParamsVector

public boolean setParamsVector(java.util.Vector params)
Manually set the parameters of a page.

Parameters:
params - a Vector of parameter values

getParamsVector

public java.util.Vector getParamsVector()
Retrieve all parameters of a page.

Returns:
a Vector of parameter values

setParamsLine

public boolean setParamsLine(java.lang.String paramline)
Manually set the parameterline of a page (as if it was a querystring).

Parameters:
paramline - a string containing teh parametervalues seperated by '+' characters

getHeader

public java.lang.String getHeader(java.lang.String name)
Retrieve a HTTP request header, if available

Parameters:
name - the name of the header
Returns:
the header, nul if it can not be retrieved

getSessionName

public java.lang.String getSessionName()
Return the session name.


setSessionName

public void setSessionName(java.lang.String name)
Set the session name.


getUrl

public java.lang.String getUrl()
Return page URL and parameters


getAddress

public java.lang.String getAddress()
Extract hostname from scanpage, get address and determine the proxies between it. Needed to determine if user comes from internal or external host, because we use two streaming servers, one for external users and one for internal users.
input : scanpage sp, contains hostname as ipaddress
output : String "clientproxy.clientside.com->dialin07.clientside.com"

uses : VPROProxyName, VPROProxyAddress


getReferer

public java.lang.String getReferer()
Gets the referrer from the request header.

Returns:
a String with the referer, null when reqheader is null.

duplicate

public scanpage duplicate()
Creates a duplicate of this scanpage

Returns:
the duplicate scanpage


MMBase build 1.7.1.20041002