|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.session.SessionImpl
public class SessionImpl
Implements a HTTP session.
| Field Summary | |
|---|---|
protected SessionManager |
_manager
|
protected java.util.Map<java.lang.String,java.lang.Object> |
_values
|
protected static java.util.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
SessionImpl(SessionManager manager,
java.lang.String id,
long creationTime)
Create a new session object. |
|
| Method Summary | |
|---|---|
boolean |
canLog()
|
protected java.util.Map<java.lang.String,java.lang.Object> |
createValueMap()
Create the map used to objectStore values. |
void |
finish()
Cleaning up session stuff at the end of a request. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attribute from the session. |
java.util.Enumeration |
getAttributeNames()
Return an enumeration of all the sessions' attribute names. |
ServletAuthenticator |
getAuthenticator()
Returns the authenticator |
long |
getCreationTime()
Returns the time the session was created. |
java.lang.String |
getId()
Returns the session identifier. |
long |
getLastAccessedTime()
Returns the last objectAccess time. |
SessionManager |
getManager()
Returns the session manager. |
int |
getMaxInactiveInterval()
Returns the time the session is allowed to be alive. |
ServletContext |
getServletContext()
Returns the servlet context. |
HttpSessionContext |
getSessionContext()
Deprecated. |
java.security.Principal |
getUser()
Returns the user |
java.lang.Object |
getValue(java.lang.String name)
Deprecated. |
java.lang.String[] |
getValueNames()
Deprecated. |
boolean |
inUse()
Returns true if the session is in use. |
void |
invalidate()
Invalidates the session, called by user code. |
void |
invalidateLogout()
Invalidates a session based on a logout. |
void |
invalidateRemote()
Invalidates the session, called by user code. |
boolean |
isEmpty()
Returns true if the session is empty. |
boolean |
isNew()
Returns true if the session is new. |
boolean |
isValid()
Returns true if the session is valid. |
boolean |
load()
Loads the session. |
void |
load(Hessian2Input in)
Loads the object from the input stream. |
void |
load(java.io.ObjectInput in)
Loads the object from the input stream. |
void |
log(java.lang.String value)
|
void |
logout()
Logs out the user |
void |
logout(SessionImpl timeoutSession)
Logs out the user |
void |
passivate()
Passivates the session. |
void |
putValue(java.lang.String name,
java.lang.Object value)
Deprecated. |
void |
removeAttribute(java.lang.String name)
Remove a session attribute. |
void |
removeEvent()
Callback when the session is removed from the session cache, generally because the session cache is full. |
void |
removeValue(java.lang.String name)
Deprecated. |
void |
save()
Saves changes to the session. |
void |
saveAfterRequest()
Flush changes after a request completes. |
void |
saveBeforeFlush()
Save changes before any flush. |
void |
saveBeforeHeaders()
Flush changes before the headers. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a session attribute. |
void |
setMaxInactiveInterval(int value)
Sets the maximum time a session is allowed to be alive. |
void |
setUser(java.security.Principal user)
Sets the user |
void |
store(Hessian2Output out)
Saves the object to the input stream. |
void |
store(java.io.ObjectOutput out)
Saves the object to the input stream. |
java.lang.String |
toString()
|
void |
unbind()
Cleans up the session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.logging.Logger log
protected SessionManager _manager
protected java.util.Map<java.lang.String,java.lang.Object> _values
| Constructor Detail |
|---|
public SessionImpl(SessionManager manager,
java.lang.String id,
long creationTime)
manager - the owning session manager.id - the session identifier.creationTime - the time in milliseconds when the session was created.| Method Detail |
|---|
public long getCreationTime()
getCreationTime in interface HttpSessionpublic java.lang.String getId()
getId in interface HttpSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface HttpSessionpublic void setMaxInactiveInterval(int value)
setMaxInactiveInterval in interface HttpSessionvalue - time allowed to live in secondspublic HttpSessionContext getSessionContext()
getSessionContext in interface HttpSessionpublic ServletContext getServletContext()
getServletContext in interface HttpSessionpublic SessionManager getManager()
public ServletAuthenticator getAuthenticator()
public java.security.Principal getUser()
public void setUser(java.security.Principal user)
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface HttpSessionname - of the attribute.
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface HttpSessionname - the name of the attributevalue - the value of the attributeprotected java.util.Map<java.lang.String,java.lang.Object> createValueMap()
public void removeAttribute(java.lang.String name)
removeAttribute in interface HttpSessionname - the name of the attribute to objectRemovepublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface HttpSessionpublic java.lang.Object getValue(java.lang.String name)
getValue in interface HttpSession
public void putValue(java.lang.String name,
java.lang.Object value)
putValue in interface HttpSessionpublic void removeValue(java.lang.String name)
removeValue in interface HttpSessionpublic java.lang.String[] getValueNames()
getValueNames in interface HttpSessionpublic boolean isNew()
isNew in interface HttpSessionpublic boolean isValid()
public void removeEvent()
removeEvent in interface CacheListenerpublic void invalidate()
invalidate in interface HttpSessionpublic void invalidateLogout()
public void invalidateRemote()
public void logout()
public void logout(SessionImpl timeoutSession)
session - the session in case of timeout and single-signonpublic boolean inUse()
public boolean load()
public void passivate()
public void unbind()
public void finish()
If the session data has changed and we have persistent sessions, save the session. However, if save-on-shutdown is true, only save on a server shutdown.
public final void saveBeforeFlush()
public final void saveBeforeHeaders()
public final void saveAfterRequest()
public final void save()
public boolean isEmpty()
public void load(Hessian2Input in)
throws java.io.IOException
java.io.IOException
public void store(Hessian2Output out)
throws java.io.IOException
java.io.IOException
public void load(java.io.ObjectInput in)
throws java.io.IOException
java.io.IOException
public void store(java.io.ObjectOutput out)
throws java.io.IOException
java.io.IOExceptionpublic boolean canLog()
public void log(java.lang.String value)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||