|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.deltava.jdbc.ConnectionContext
org.deltava.commands.HTTPContext
public abstract class HTTPContext
An abstract class to share command data between different HTTP command contexts.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.deltava.jdbc.ConnectionContext |
|---|
ConnectionContext.ConnectionPoolException |
| Field Summary | |
|---|---|
static String |
ADDRINFO_ATTR_NAME
|
static String |
SU_ATTR_NAME
|
static String |
USER_ATTR_NAME
|
| Constructor Summary | |
|---|---|
HTTPContext(HttpServletRequest req,
HttpServletResponse rsp)
Creates a new Command context from an HTTP Servlet Request/Resposne pair. |
|
| Method Summary | |
|---|---|
Object |
getCmdParameter(int prmType,
Object defaultValue)
Returns one of the special command parameters. |
Cookie |
getCookie(String name)
Returns an HTTP cookie. |
FileUpload |
getFile(String name)
Returns the value of an uploaded file object. |
String |
getParameter(String pName)
Returns the value of a request parameter. |
Collection<String> |
getParameters(String pName)
Returns the values of a collection of request parameters. |
HttpServletRequest |
getRequest()
Returns the current HTTP Servlet Request. |
HttpServletResponse |
getResponse()
Returns the current HTTP Servlet Response. |
Collection<String> |
getRoles()
Returns the list of roles for the user. |
HttpSession |
getSession()
Returns the current HTTP session. |
Person |
getUser()
Returns the authenticated user object. |
boolean |
isAuthenticated()
Returns if this command is being invoked by an authenticated user. |
boolean |
isSuperUser()
Returns whether an Administrator is impersonating another user. |
boolean |
isUserInRole(String roleName)
Returns if the currently logged in user is a member of a particular role. |
void |
setAttribute(String name,
Object value,
Command.Scope scope)
Sets an attribute in a particular context. |
void |
setUser(Person p)
Updates the User executing this operation. |
| Methods inherited from class org.deltava.jdbc.ConnectionContext |
|---|
commitTX, getConnection, release, rollbackTX, startTX |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ADDRINFO_ATTR_NAME
public static final String USER_ATTR_NAME
public static final String SU_ATTR_NAME
| Constructor Detail |
|---|
public HTTPContext(HttpServletRequest req,
HttpServletResponse rsp)
req - the Servlet Requestrsp - the Servlet Response| Method Detail |
|---|
public HttpSession getSession()
public HttpServletRequest getRequest()
getRequest in interface SecurityContextpublic HttpServletResponse getResponse()
public Person getUser()
getUser in interface SecurityContextisAuthenticated(),
isUserInRole(String)public void setUser(Person p)
p - the User object, or null if anonymouspublic boolean isAuthenticated()
isAuthenticated in interface SecurityContextgetUser(),
getRoles()public boolean isSuperUser()
public Collection<String> getRoles()
getRoles in interface SecurityContextisAuthenticated(),
getUser()public boolean isUserInRole(String roleName)
HttpServletRequest.isUserInRole(String)
method, which may be overriden by a custom request handler.
isUserInRole in interface SecurityContextroleName - the role name
public String getParameter(String pName)
pName - the parameter name
public Collection<String> getParameters(String pName)
pName - the parameter name
public FileUpload getFile(String name)
name - the file name
public Cookie getCookie(String name)
name - the cookie name
public void setAttribute(String name,
Object value,
Command.Scope scope)
name - the name of the attributevalue - the attribute valuescope - the scope (application, session or request)Command.REQUEST,
Command.SESSION
public Object getCmdParameter(int prmType,
Object defaultValue)
prmType - the Parameter typedefaultValue - the value to return if parameter not specified in the request
Command.ID,
Command.OPERATION
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||