|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--agonism.dovetail.site.DummyRequestContext
Inner Class Summary | |
static class |
DummyRequestContext.Location
|
Constructor Summary | |
DummyRequestContext()
|
|
DummyRequestContext(java.util.Hashtable parameters,
java.util.Hashtable cookies,
java.util.Hashtable session,
java.io.PrintWriter writer)
|
|
DummyRequestContext(java.util.Hashtable parameters,
java.util.Hashtable cookies,
java.io.PrintWriter writer)
|
|
DummyRequestContext(java.io.PrintWriter writer)
|
Method Summary | |
java.lang.String |
encodeURL(java.lang.String url)
Encode a URL with the SessionID. |
void |
forward(Page page)
Forward a request to a new Page. |
void |
freeConnection()
Free the database connection obtained from the getConnection() method. |
java.sql.Connection |
getConnection()
Get the database connection. |
java.lang.String |
getCookieValue(java.lang.String name)
Get the value of a browser cookie. |
java.util.Collection |
getErrors()
Get a Collection of all the errors that have occured in this request. |
DummyRequestContext.Location |
getLocation()
|
DummyRequestContext.Location |
getNextLocation()
|
agonism.dovetail.db.IParameterSource |
getParameterSource()
Get an object that implements IParameterSource |
java.lang.String |
getParameterValue(java.lang.String name)
Get the value of a request parameter. |
DummyRequestContext.Location |
getPrevLocation()
|
java.lang.String |
getReferer()
Get the URL that the request was sent from |
java.lang.Object |
getRequestValue(java.lang.String key)
Get a value that has been stored in the Request. |
java.lang.Object |
getSessionValue(java.lang.String key)
Get a value that has been stored in the Session. |
Site |
getSite()
Get the root Site object. |
java.io.PrintWriter |
getWriter()
Get the PrintWriter which is writing the response. |
boolean |
hasBeenRedirected()
|
void |
include(Page page)
Inculde another page in the response for this page. |
void |
init(Site site)
Initialize the IRequestContext with a Site . |
DummyRequestContext |
processRequest(Form submitForm,
java.util.Hashtable parameters,
java.util.Hashtable cookies)
Process a form request with a set of form parameters and return a new DummyRequestContext. |
void |
reportError(RequestError error)
Report a request processing error. |
void |
sendRedirect(Link link)
Redirect the request to a new Link. |
void |
sendRedirect(Page page)
Redirect the request to a new Page. |
void |
sendRedirect(java.lang.String url)
Redirect the request to a new URL. |
void |
setFormValue(java.lang.String name,
java.lang.Object value)
|
void |
setLocation(Page page)
If the client of the DummyRequestContext is using SQL database connections, setting the Location will help provide better diagnostic information in case the connections are not properly freed. |
void |
setParameterValue(java.lang.String name,
java.lang.String value)
|
void |
setParent(IRequestContext context)
Set the parent context of the DummyRequestContext. |
void |
setRequestValue(java.lang.String key,
java.lang.Object value)
Put a value into the Request state. |
void |
setSessionValue(java.lang.String key,
java.lang.Object value)
Put a value into the Session state. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DummyRequestContext()
public DummyRequestContext(java.io.PrintWriter writer)
public DummyRequestContext(java.util.Hashtable parameters, java.util.Hashtable cookies, java.io.PrintWriter writer)
public DummyRequestContext(java.util.Hashtable parameters, java.util.Hashtable cookies, java.util.Hashtable session, java.io.PrintWriter writer)
Method Detail |
public DummyRequestContext processRequest(Form submitForm, java.util.Hashtable parameters, java.util.Hashtable cookies)
public void setLocation(Page page)
public DummyRequestContext.Location getPrevLocation()
public DummyRequestContext.Location getLocation()
public DummyRequestContext.Location getNextLocation()
public void setFormValue(java.lang.String name, java.lang.Object value)
public void setParent(IRequestContext context)
getConnection()
or freeConnection()
have been called.
The parent context is used to manage the database Connection of this context. In this way, clients which are using different contexts can share the same connection.
public void init(Site site)
IRequestContext
Site
.init
in interface IRequestContext
public java.sql.Connection getConnection()
IRequestContext
IRequestContext.freeConnection()
method.
Whenever you call this method, you must always pair it with a call to IRequestContext.freeConnection()
, otherwise
the Connection will not be promptly returned to the connection pool. If you fail to
free connections, the ConnectionHelper.finalize()
method will write diagnostic information to the WARN log.
getConnection
in interface IRequestContext
public void freeConnection()
IRequestContext
IRequestContext.getConnection()
method.
Whenever you call IRequestContext.getConnection()
, you must always pair it with a call to IRequestContext.freeConnection()
, otherwise
the Connection will not be promptly returned to the connection pool. If you fail to
free connections, the ConnectionHelper.finalize()
method will write diagnostic information to the WARN log.
freeConnection
in interface IRequestContext
public java.lang.String encodeURL(java.lang.String url)
IRequestContext
encodeURL
in interface IRequestContext
public void sendRedirect(Page page)
IRequestContext
sendRedirect
in interface IRequestContext
public void sendRedirect(Link link)
IRequestContext
sendRedirect
in interface IRequestContext
public void sendRedirect(java.lang.String url)
IRequestContext
sendRedirect
in interface IRequestContext
public boolean hasBeenRedirected()
hasBeenRedirected
in interface IRequestContext
agonism.dovetail.site.IRequestContext
sendRedirect
method has been invoked on this request.public void forward(Page page)
IRequestContext
forward
in interface IRequestContext
public void include(Page page)
IRequestContext
include
in interface IRequestContext
public java.io.PrintWriter getWriter()
IRequestContext
getWriter
in interface IRequestContext
public Site getSite()
IRequestContext
Site
object.getSite
in interface IRequestContext
public agonism.dovetail.db.IParameterSource getParameterSource()
IRequestContext
IParameterSource
getParameterSource
in interface IRequestContext
public void setParameterValue(java.lang.String name, java.lang.String value)
public java.lang.String getParameterValue(java.lang.String name)
IRequestContext
getParameterValue
in interface IRequestContext
public java.lang.String getCookieValue(java.lang.String name)
IRequestContext
getCookieValue
in interface IRequestContext
public java.lang.Object getSessionValue(java.lang.String key)
IRequestContext
getSessionValue
in interface IRequestContext
public void setSessionValue(java.lang.String key, java.lang.Object value)
IRequestContext
setSessionValue
in interface IRequestContext
public java.lang.Object getRequestValue(java.lang.String key)
IRequestContext
getRequestValue
in interface IRequestContext
public void setRequestValue(java.lang.String key, java.lang.Object value)
IRequestContext
setRequestValue
in interface IRequestContext
public void reportError(RequestError error)
IRequestContext
reportError
in interface IRequestContext
public java.util.Collection getErrors()
IRequestContext
getErrors
in interface IRequestContext
agonism.dovetail.site.IRequestContext
RequestError
objects.public java.lang.String getReferer()
IRequestContext
getReferer
in interface IRequestContext
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |