|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.japano.Session
public class Session
Base class for all session implementations which provides basic
japano functionality.
Subclass implementations must register via an init-parameter in
the web.xml file.
JSP compilation will use its knowledge of that sub type to optimize access.
(e.g. ${pageContext.session.user} is resolved to "((SampleSession)pageContext.getSession()).getUser()" in the JSP code)
The implementation uses a secure random generator from Util.createSecureRandom()
to generate
the session IDs.
Util.createSecureRandom()
,
Serialized FormField Summary | |
---|---|
protected static java.util.Map |
allSessions
maps session ids to Session instances |
protected static java.util.Map |
botSessions
|
static int |
DEFAULT_MAX_INACTIVE_INTERVAL
|
protected JapanoConfig |
japanoConfig
|
protected static int |
SESSION_ID_LENGTH
|
static java.lang.String |
SESSIONS_FILE
|
Constructor Summary | |
---|---|
protected |
Session()
protected Session contstructor |
protected |
Session(java.lang.String sessionId)
Creates a new instance of Session |
Method Summary | |
---|---|
void |
access()
|
void |
addActionParameter(java.lang.String qName,
ActionParameter formContent)
|
protected static Session |
addSession(java.lang.String id,
JapanoConfig japanoConfig)
|
void |
addValidationAttribute(java.lang.String paramName,
java.lang.Object value)
|
void |
addViewMessage(java.lang.String message)
Adds a message to this session's view. |
void |
clearValidationAttributes()
|
PingPongContext |
createPingPongAction(java.lang.String qName)
|
protected static Session |
createSession(JapanoConfig japanoConfig)
Returns a new session with a proven unique session id. |
protected void |
destroy()
Destroys the session when it's removed from the session pool. |
static boolean |
exists(java.lang.String sessionId)
|
ActionConfig |
getActionConfig()
Returns the ActionConfig for the website this session instance belongs to. |
int |
getActionCount()
|
ActionParameter |
getActionParameter(java.lang.String qName)
|
java.lang.Object |
getAttribute(java.lang.String str)
|
java.util.Enumeration |
getAttributeNames()
|
long |
getCreationTime()
|
java.lang.String |
getId()
|
IDMechanism |
getIdMechanism()
Returns how the session id is transported in between client requests. |
long |
getLastAccessedTime()
|
java.util.Locale |
getLocale()
Getter for property locale. |
int |
getMaxInactiveInterval()
|
javax.servlet.ServletContext |
getServletContext()
|
static Session |
getSession(java.lang.String sessionId)
|
javax.servlet.http.HttpSessionContext |
getSessionContext()
|
java.lang.Object |
getValidationAttribute(java.lang.String paramName)
|
java.lang.Object |
getValue(java.lang.String str)
|
java.lang.String[] |
getValueNames()
|
View |
getView()
Returns the current view of this session. |
void |
increaseActionCount()
|
void |
invalidate()
|
boolean |
isBot()
Getter for property bot. |
boolean |
isNew()
|
void |
putValue(java.lang.String str,
java.lang.Object obj)
|
void |
removeAttribute(java.lang.String str)
|
PingPongContext |
removePingPongContext(java.lang.String qName)
|
void |
removeValue(java.lang.String str)
|
void |
setAttribute(java.lang.String str,
java.lang.Object obj)
|
protected void |
setId(java.lang.String id)
|
void |
setIdMechanism(IDMechanism idMechanism)
|
void |
setLocale(java.util.Locale locale)
Setter for property locale. |
void |
setMaxInactiveInterval(int param)
|
View |
setView(java.lang.String URI)
Sets this session to a new view. |
View |
setVolatileView(java.lang.String URI)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_INACTIVE_INTERVAL
public static final java.lang.String SESSIONS_FILE
protected static java.util.Map allSessions
protected static java.util.Map botSessions
protected transient JapanoConfig japanoConfig
protected static final int SESSION_ID_LENGTH
Constructor Detail |
---|
protected Session()
protected Session(java.lang.String sessionId)
Method Detail |
---|
protected void setId(java.lang.String id)
public java.lang.String getId()
getId
in interface javax.servlet.http.HttpSession
public static Session getSession(java.lang.String sessionId)
public static boolean exists(java.lang.String sessionId)
public void access()
protected static Session addSession(java.lang.String id, JapanoConfig japanoConfig)
protected static Session createSession(JapanoConfig japanoConfig)
japanoConfig
- JapanoConfigpublic java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.http.HttpSession
public java.lang.Object getAttribute(java.lang.String str)
getAttribute
in interface javax.servlet.http.HttpSession
public void removeAttribute(java.lang.String str)
removeAttribute
in interface javax.servlet.http.HttpSession
public void setAttribute(java.lang.String str, java.lang.Object obj)
setAttribute
in interface javax.servlet.http.HttpSession
public long getCreationTime()
getCreationTime
in interface javax.servlet.http.HttpSession
public long getLastAccessedTime()
getLastAccessedTime
in interface javax.servlet.http.HttpSession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.http.HttpSession
public javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext
in interface javax.servlet.http.HttpSession
public java.lang.Object getValue(java.lang.String str)
getValue
in interface javax.servlet.http.HttpSession
public java.lang.String[] getValueNames()
getValueNames
in interface javax.servlet.http.HttpSession
public void invalidate()
invalidate
in interface javax.servlet.http.HttpSession
public boolean isNew()
isNew
in interface javax.servlet.http.HttpSession
public void putValue(java.lang.String str, java.lang.Object obj)
putValue
in interface javax.servlet.http.HttpSession
public void removeValue(java.lang.String str)
removeValue
in interface javax.servlet.http.HttpSession
public void setMaxInactiveInterval(int param)
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public int getActionCount()
public void increaseActionCount()
public PingPongContext createPingPongAction(java.lang.String qName)
public PingPongContext removePingPongContext(java.lang.String qName)
public ActionConfig getActionConfig()
public void addValidationAttribute(java.lang.String paramName, java.lang.Object value)
public java.lang.Object getValidationAttribute(java.lang.String paramName)
public void clearValidationAttributes()
public View setView(java.lang.String URI)
URI
- URI of the view
public View setVolatileView(java.lang.String URI)
public View getView()
public void addViewMessage(java.lang.String message)
message
- message to add to the viewpublic void addActionParameter(java.lang.String qName, ActionParameter formContent)
public ActionParameter getActionParameter(java.lang.String qName)
public IDMechanism getIdMechanism()
IDMechanism
public void setIdMechanism(IDMechanism idMechanism)
public boolean isBot()
protected void destroy()
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
locale
- New value of property locale.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |