|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelma.framework.core.Session
public class Session
This represents a session currently using the Hop application. This includes anybody who happens to request a page from this application. Depending on whether the user is logged in or not, the session holds a persistent user node.
Field Summary | |
---|---|
protected Application |
app
|
protected INode |
cacheNode
|
protected java.lang.StringBuffer |
debugBuffer
|
protected long |
lastModified
|
protected long |
lastTouched
|
protected java.lang.String |
message
|
protected long |
onSince
|
protected java.lang.String |
sessionId
|
protected java.lang.String |
uid
|
protected java.util.HashMap |
uploads
|
protected NodeHandle |
userHandle
|
Constructor Summary | |
---|---|
Session(java.lang.String sessionId,
Application app)
Creates a new Session object. |
Method Summary | |
---|---|
void |
commit(RequestEvaluator reval)
Called after a request has been handled. |
protected UploadStatus |
createUpload(java.lang.String uploadId)
|
Application |
getApp()
Get this session's application |
INode |
getCacheNode()
Gets the transient cache node. |
java.lang.StringBuffer |
getDebugBuffer()
Return the debug buffer that is to be displayed upon the next request within this session. |
java.lang.String |
getMessage()
Return the message that is to be displayed upon the next request within this session. |
java.lang.String |
getSessionId()
Return this session's id. |
java.lang.String |
getUID()
Get the persistent user id of a registered user. |
protected UploadStatus |
getUpload(java.lang.String uploadId)
|
NodeHandle |
getUserHandle()
Get the Node handle for the current user, if logged in. |
INode |
getUserNode()
Gets the user Node from this Application's NodeManager. |
boolean |
isLoggedIn()
Returns true if this session is currently associated with a user object. |
long |
lastModified()
Returns the time this session was last modified, meaning the last time its user status changed or its cache node was modified. |
long |
lastTouched()
Returns the time this session was last touched. |
void |
login(INode usernode)
Attach the given user node to this session. |
boolean |
login(java.lang.String userName,
java.lang.String password)
Try logging in this session given the userName and password. |
void |
logout()
Remove this sessions's user node. |
long |
onSince()
Return the time this session was created. |
protected void |
pruneUploads()
|
void |
recoverResponseMessages(ResponseTrans res)
Set the user and debug messages over from a previous response. |
void |
setApp(Application app)
Set this session's application |
void |
setCacheNode(INode node)
Set the cache node for this session. |
void |
setDebugBuffer(java.lang.StringBuffer buffer)
Set the debug buffer to be displayed to this session's user. |
void |
setLastModified(java.util.Date date)
Set the last modified time on this session. |
void |
setMessage(java.lang.String msg)
Set a message to be displayed to this session's user. |
void |
setUserHandle(NodeHandle handle)
Set the user handle for this session. |
void |
storeResponseMessages(ResponseTrans res)
Remember the response's user and debug messages for a later response. |
java.lang.String |
toString()
Return a string representation for this session. |
void |
touch()
Called at the beginning of a request to let the session know it's being used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient Application app
protected java.lang.String sessionId
protected java.lang.String uid
protected NodeHandle userHandle
protected INode cacheNode
protected long onSince
protected long lastTouched
protected long lastModified
protected java.lang.String message
protected java.lang.StringBuffer debugBuffer
protected java.util.HashMap uploads
Constructor Detail |
---|
public Session(java.lang.String sessionId, Application app)
sessionId
- ...app
- ...Method Detail |
---|
public void login(INode usernode)
public boolean login(java.lang.String userName, java.lang.String password)
userName
- password
-
public void logout()
public boolean isLoggedIn()
public void setUserHandle(NodeHandle handle)
public NodeHandle getUserHandle()
public INode getUserNode()
public void setCacheNode(INode node)
public INode getCacheNode()
public Application getApp()
public void setApp(Application app)
app
- ...public java.lang.String getSessionId()
public void touch()
public void commit(RequestEvaluator reval)
reval
- the request evaluator that handled the requestpublic long lastTouched()
public long lastModified()
public void setLastModified(java.util.Date date)
date
- ...public long onSince()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getUID()
public void recoverResponseMessages(ResponseTrans res)
res
- the response to set the messages onpublic void storeResponseMessages(ResponseTrans res)
res
- the response to retrieve the messages frompublic java.lang.String getMessage()
public void setMessage(java.lang.String msg)
msg
- the messagepublic java.lang.StringBuffer getDebugBuffer()
public void setDebugBuffer(java.lang.StringBuffer buffer)
buffer
- the bufferprotected UploadStatus createUpload(java.lang.String uploadId)
protected UploadStatus getUpload(java.lang.String uploadId)
protected void pruneUploads()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |