public class DefaultTurbineRunData extends DefaultPipelineData implements TurbineRunData, org.apache.fulcrum.pool.Recyclable
DefaultTurbineRunData implements the Recyclable interface making it possible to pool its instances for recycling.
| Constructor and Description |
|---|
DefaultTurbineRunData()
Constructs a run data object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(String msg)
Adds the string to message.
|
void |
declareDirectResponse()
Declares that output will be direct to the response stream,
even though getOut() may never be called.
|
void |
dispose()
Disposes a run data object.
|
<A extends org.apache.fulcrum.security.acl.AccessControlList> |
getACL()
Gets the access control list.
|
String |
getAction()
Gets the action.
|
String |
getCharSet()
Gets the charset.
|
String |
getContentType()
Gets the HTTP content type to return.
|
String |
getContextPath()
Gets the cached context path.
|
org.apache.fulcrum.parser.CookieParser |
getCookieParser()
Gets the cookie parser without parsing the cookies.
|
org.apache.fulcrum.parser.CookieParser |
getCookies()
Gets the cookies.
|
Map<String,Object> |
getDebugVariables()
Gets a Map of debug variables.
|
protected String |
getDefaultCharSet()
Gets the default charset defined by a property named
"locale.default.charset" or by the specified locale.
|
protected static Locale |
getDefaultLocale()
Gets the default locale defined by properties named
"locale.default.lang" and "locale.default.country".
|
Map<String,Context> |
getJNDIContexts()
Gets JNDI Contexts.
|
String |
getLayout()
If the Layout has not been defined by the screen then set the
layout to be "DefaultLayout".
|
String |
getLayoutTemplate()
Convenience method for a template info that
returns the layout template being used.
|
Locale |
getLocale()
Gets the locale.
|
String |
getMessage()
Gets the results of an action or another message
to be displayed as a string.
|
String |
getMessageAsHTML()
Gets the results of an action or another message
to be displayed as a string (never null).
|
FormMessages |
getMessages()
Gets a FormMessages object where all the messages to the
user should be stored.
|
PrintWriter |
getOut()
Gets the print writer.
|
org.apache.fulcrum.parser.ParameterParser |
getParameterParser()
Gets the parameter parser without parsing the parameters.
|
org.apache.fulcrum.parser.ParameterParser |
getParameters()
Gets the parameters.
|
String |
getRedirectURI()
Gets the redirect URI.
|
String |
getRemoteAddr()
Gets the IP address of the client that sent the request.
|
String |
getRemoteHost()
Gets the qualified name of the client that sent the request.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the servlet request.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the servlet response.
|
String |
getScreen()
Gets the screen to execute.
|
String |
getScreenTemplate()
Convenience method for a template info that
returns the name of the template being used.
|
String |
getScriptName()
Gets the cached script name.
|
ServerData |
getServerData()
Gets the server data ofy the request.
|
String |
getServerName()
Gets the cached server name.
|
int |
getServerPort()
Gets the cached server port.
|
String |
getServerScheme()
Gets the cached server scheme.
|
javax.servlet.ServletConfig |
getServletConfig()
Gets the servlet configuration used during servlet init.
|
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context used during servlet init.
|
javax.servlet.http.HttpSession |
getSession()
Gets the servlet session information.
|
String |
getStackTrace()
Gets the stack trace if set.
|
Throwable |
getStackTraceException()
Gets the stack trace exception if set.
|
int |
getStatusCode()
Gets the HTTP status code to return.
|
SystemError[] |
getSystemErrors()
Gets an array of system errors.
|
String |
getTemplateEncoding()
Gets the character encoding to use for reading template files.
|
TemplateInfo |
getTemplateInfo()
Gets the template info.
|
String |
getTitle()
Gets the title of the page.
|
<T extends User> |
getUser()
Gets the user.
|
String |
getUserAgent()
Get the user agent for the request.
|
<T extends User> |
getUserFromSession()
Attempts to get the user from the session.
|
static <T extends User> |
getUserFromSession(javax.servlet.http.HttpSession session)
Attempts to get the User object from the session.
|
boolean |
hasAction()
Whether or not an action has been defined.
|
boolean |
hasMessage()
Whether or not a message has been defined.
|
boolean |
hasScreen()
Whether or not a screen has been defined.
|
boolean |
isDisposed()
Checks whether the object is disposed.
|
boolean |
isOutSet()
Deprecated.
no replacement planned, response writer will not be cached
|
void |
populate()
Pulls a user object from the session and increments the access
counter and sets the last access date for the object.
|
void |
recycle()
Recycles the object by removing its disposed flag.
|
boolean |
removeUserFromSession()
Allows one to invalidate the user in the default session.
|
static boolean |
removeUserFromSession(javax.servlet.http.HttpSession session)
Allows one to invalidate the user in a session.
|
void |
save()
Saves a user object into the session.
|
void |
setACL(org.apache.fulcrum.security.acl.AccessControlList acl)
Sets the access control list.
|
void |
setAction(String action)
Sets the action for the request.
|
void |
setCharSet(String charSet)
Sets the charset.
|
void |
setContentType(String contentType)
Sets the HTTP content type to return.
|
protected void |
setContextPath(String contextPath)
Sets the cached context path that is stored in the server data.
|
void |
setDebugVariable(String name,
Object value)
Sets a name/value pair in an internal Map that is accessible from the
Error screen.
|
void |
setJNDIContexts(Map<String,Context> contexts)
Sets JNDI Contexts.
|
void |
setLayout(String layout)
Set the layout for the request.
|
void |
setLayoutTemplate(String layout)
Modifies the layout template for the screen.
|
void |
setLocale(Locale locale)
Sets the locale.
|
void |
setMessage(String msg)
Sets the message for the request as a string.
|
void |
setMessages(FormMessages msgs)
Sets the FormMessages object for the request.
|
protected void |
setOut(PrintWriter out)
Deprecated.
no replacement planned, response writer will not be cached
|
void |
setRedirectURI(String ruri)
Sets the redirect uri.
|
void |
setScreen(String screen)
Sets the screen for the request.
|
void |
setScreenTemplate(String screen)
Sets the screen template for the request.
|
protected void |
setScriptName(String scriptName)
Sets the cached script name that is stored in the server data.
|
protected void |
setServerName(String serverName)
Sets the cached server same that is stored in the server data.
|
protected void |
setServerPort(int port)
Sets the cached server port that is stored in the server data.
|
protected void |
setServerScheme(String serverScheme)
Sets the cached server scheme that is stored in the server data.
|
void |
setStackTrace(String trace,
Throwable exp)
Sets the stack trace.
|
void |
setStatusCode(int statusCode)
Sets the HTTP status code to return.
|
void |
setSystemError(SystemError err)
Adds a critical system error.
|
void |
setTemplateEncoding(String encoding)
Sets the character encoding to use for reading template files.
|
void |
setTitle(String title)
Sets the title of the page.
|
void |
setUser(User user)
Sets the user.
|
void |
unsetMessage()
Unsets the message for the request.
|
boolean |
userExists()
Checks if a user exists in this session.
|
get, get, putclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, get, putpublic DefaultTurbineRunData()
public static <T extends User> T getUserFromSession(javax.servlet.http.HttpSession session)
T - a type extending Usersession - An HttpSession.public static boolean removeUserFromSession(javax.servlet.http.HttpSession session)
session - An HttpSession.protected static Locale getDefaultLocale()
protected String getDefaultCharSet()
public void recycle()
recycle in interface org.apache.fulcrum.pool.Recyclablepublic void dispose()
dispose in interface org.apache.fulcrum.pool.Recyclablepublic org.apache.fulcrum.parser.ParameterParser getParameters()
getParameters in interface RunDatapublic org.apache.fulcrum.parser.CookieParser getCookies()
getCookies in interface RunDatapublic javax.servlet.http.HttpServletRequest getRequest()
getRequest in interface RunDatapublic javax.servlet.http.HttpServletResponse getResponse()
getResponse in interface RunDatapublic javax.servlet.http.HttpSession getSession()
getSession in interface RunDatapublic javax.servlet.ServletConfig getServletConfig()
getServletConfig in interface RunDatapublic javax.servlet.ServletContext getServletContext()
getServletContext in interface RunDatapublic <A extends org.apache.fulcrum.security.acl.AccessControlList> A getACL()
public void setACL(org.apache.fulcrum.security.acl.AccessControlList acl)
TurbineConstants.ACL_SESSION_KEY. Invalidate session, if session persist.public boolean hasAction()
public String getAction()
public String getLayout()
public String getLayoutTemplate()
getLayoutTemplate in interface RunDatapublic void setLayoutTemplate(String layout)
setLayoutTemplate in interface RunDatalayout - a layout template.public boolean hasScreen()
public String getScreenTemplate()
getScreenTemplate in interface RunDatapublic void setScreenTemplate(String screen)
setScreenTemplate in interface RunDatascreen - a screen template.public String getTemplateEncoding()
getTemplateEncoding in interface RunDatapublic void setTemplateEncoding(String encoding)
setTemplateEncoding in interface RunDataencoding - the template encoding.public TemplateInfo getTemplateInfo()
getTemplateInfo in interface RunDatapublic boolean hasMessage()
hasMessage in interface RunDatapublic String getMessage()
getMessage in interface RunDatapublic void setMessage(String msg)
setMessage in interface RunDatamsg - a string.public void addMessage(String msg)
addMessage in interface RunDatamsg - a string.public String getMessageAsHTML()
getMessageAsHTML in interface RunDatapublic void unsetMessage()
unsetMessage in interface RunDatapublic FormMessages getMessages()
getMessages in interface RunDatapublic void setMessages(FormMessages msgs)
setMessages in interface RunDatamsgs - A FormMessages.public boolean userExists()
userExists in interface RunDatapublic <T extends User> T getUserFromSession()
getUserFromSession in interface RunDataT - a type extending Userpublic boolean removeUserFromSession()
removeUserFromSession in interface RunData@Deprecated public boolean isOutSet()
public PrintWriter getOut() throws IOException
getOut in interface RunDataIOException - on failure getting the PrintWriterpublic void declareDirectResponse()
declareDirectResponse in interface RunDatapublic Locale getLocale()
public String getCharSet()
getCharSet in interface RunDatapublic void setCharSet(String charSet)
setCharSet in interface RunDatacharSet - the name of the new charset.public String getContentType()
getContentType in interface RunDatapublic void setContentType(String contentType)
setContentType in interface RunDatacontentType - a string.public String getRedirectURI()
getRedirectURI in interface RunDatapublic void setRedirectURI(String ruri)
setRedirectURI in interface RunDataruri - a string.public int getStatusCode()
getStatusCode in interface RunDatapublic void setStatusCode(int statusCode)
setStatusCode in interface RunDatastatusCode - the status.public SystemError[] getSystemErrors()
getSystemErrors in interface RunDatapublic void setSystemError(SystemError err)
setSystemError in interface RunDataerr - a system error.public Map<String,Context> getJNDIContexts()
getJNDIContexts in interface RunDatapublic void setJNDIContexts(Map<String,Context> contexts)
setJNDIContexts in interface RunDatacontexts - a hashmap.public String getServerScheme()
getServerScheme in interface RunDatapublic String getServerName()
getServerName in interface RunDatapublic int getServerPort()
getServerPort in interface RunDatapublic String getContextPath()
getContextPath in interface RunDatapublic String getScriptName()
getScriptName in interface RunDatapublic ServerData getServerData()
getServerData in interface RunDatapublic String getRemoteAddr()
getRemoteAddr in interface RunDatapublic String getRemoteHost()
getRemoteHost in interface RunDatapublic String getUserAgent()
getUserAgent in interface RunDatapublic void populate()
public void save()
public String getStackTrace()
getStackTrace in interface RunDatapublic Throwable getStackTraceException()
getStackTraceException in interface RunDatapublic void setStackTrace(String trace, Throwable exp)
setStackTrace in interface RunDatatrace - the stack trace.exp - the exception.public void setDebugVariable(String name, Object value)
setDebugVariable in interface RunDataname - name of the variablevalue - value of the variable.public Map<String,Object> getDebugVariables()
getDebugVariables in interface RunDatapublic org.apache.fulcrum.parser.ParameterParser getParameterParser()
getParameterParser in interface TurbineRunDatapublic org.apache.fulcrum.parser.CookieParser getCookieParser()
getCookieParser in interface TurbineRunData@Deprecated protected void setOut(PrintWriter out)
out - a print writer.protected void setServerScheme(String serverScheme)
serverScheme - a string.protected void setServerName(String serverName)
serverName - a string.protected void setServerPort(int port)
port - an int.protected void setContextPath(String contextPath)
contextPath - a string.protected void setScriptName(String scriptName)
scriptName - a string.public boolean isDisposed()
isDisposed in interface org.apache.fulcrum.pool.RecyclableCopyright © 2000–2018 The Apache Software Foundation. All rights reserved.