|
Femto Web Server V1.4-F | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--dfischer.femtowebserver.httpd.HttpdSession
HTTP sessions can be used to overlay the stateless HTTP protocol with stateful information, valid over the whole surfing session of an user.
The Femto Web Server supports HTTP sessions, if a special HttpdFilter has been added first to the Httpd, which
generates and manages all sessions. Implementing an own HttpdFilter to manage the sessions in
collaboration with the HttpdSessionHashtable is fully supported - but the easier way is to use
the already implemented HttpSessionCookieHandler.
Httpd.addFilter(String, String[]),
HttpdFilter,
HttpdSessionHashtable,
HttpdProperties.getSessionHashtable(),
HttpRequest.getSession(),
HttpResponse.getSession()| Constructor Summary | |
HttpdSession(java.lang.String sessionId)
Creates a new session, initializes the session creation time and sets the access count to 1. |
|
HttpdSession(java.lang.String sessionId,
java.lang.String remoteAddress)
Creates a new session, initializes the session creation time, sets the access count to 1 and sets the TCP/IP remote address. |
|
HttpdSession(java.lang.String sessionId,
java.lang.String remoteAddress,
java.lang.String lastSessionInfo)
Creates a new session, initializes the session creation time, sets the access count to 1, sets the TCP/IP remote address and sets an informational text about the session. |
|
| Method Summary | |
long |
getAccessCount()
Returns the total number a HTTP request which have made during the session. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with a specific name to the session. |
java.util.Enumeration |
getAttributNames()
Returns an Enumeration of Strings of all object names bound to this session. |
long |
getCreationTime()
Returns the time when this session was created. |
java.lang.String |
getId()
Returns the session id. |
long |
getLastAccessTime()
Returns the last time when the user has sent a HTTP request, bound on this session. |
java.lang.String |
getLastSessionInfo()
Returns the informational text about the session. |
java.lang.String |
getRemoteAddress()
Returns the raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd). |
void |
invalidate()
Invalidates the session. |
boolean |
isNew()
Returns true if the session was newly created. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Allows to bind an object to the session, so that it's accessible during the whole HTTP session. |
void |
setLastSessionInfo(java.lang.String lastSessionInfo)
Updates the informational text about the session. |
void |
setRemoteAddress(java.lang.String remoteAddress)
Allows to alternate the remote address of agent (because it has changed: DHCP). |
void |
updateLastAccess(java.lang.String remoteAddress)
Updates the last access time, increments the access count and updates the remote TCP/IP address of the agent. |
void |
updateLastAccess(java.lang.String remoteAddress,
java.lang.String lastSessionInfo)
Updates the last access time, increments the access count, updates the remote TCP/IP address of the agent and updates the informational text about the session. |
void |
updateLastAccessTime()
Updates the last access time and increments the access count. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HttpdSession(java.lang.String sessionId)
sessionId - the new session id. This is the key to the session und must be
unique over all already existing session ids.HttpdProperties.getSessionHashtable(),
HttpdSessionHashtable.addSession(java.lang.String, dfischer.femtowebserver.httpd.HttpdSession)
public HttpdSession(java.lang.String sessionId,
java.lang.String remoteAddress)
sessionId - the new session id. This is the key to the session und must be
unique over all already existing session ids.remoteAddress - raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd) without DNS lookup.HttpdProperties.getSessionHashtable(),
HttpdSessionHashtable.addSession(java.lang.String, dfischer.femtowebserver.httpd.HttpdSession),
getId(),
getRemoteAddress(),
setRemoteAddress(java.lang.String)
public HttpdSession(java.lang.String sessionId,
java.lang.String remoteAddress,
java.lang.String lastSessionInfo)
sessionId - the new session id. This is the key to the session und must be
unique over all already existing session ids.remoteAddress - raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd) without DNS lookup.lastSessionInfo - informational text about the session. Used for debugging or visualizing sessions.HttpdProperties.getSessionHashtable(),
HttpdSessionHashtable.addSession(java.lang.String, dfischer.femtowebserver.httpd.HttpdSession),
getId(),
getRemoteAddress(),
setRemoteAddress(java.lang.String)| Method Detail |
public java.lang.String getId()
HttpdFilter,
HttpdProperties.getSessionHashtable(),
HttpdSessionHashtable.addSession(java.lang.String, dfischer.femtowebserver.httpd.HttpdSession),
HttpdSessionHashtable.getSession(java.lang.String),
HttpdSessionHashtable.removeSession(java.lang.String)public java.lang.String getRemoteAddress()
setRemoteAddress(java.lang.String)public void setRemoteAddress(java.lang.String remoteAddress)
remoteAddress - new raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd) without DNS lookup.getRemoteAddress()public boolean isNew()
public void invalidate()
The session will only be removed from the HttpdSessionHashtable if (thereafter) one of the methods dropInactiveSessions() or dropLongSessions() is called.
HttpdSessionHashtable.dropInactiveSessions(int),
HttpdSessionHashtable.dropLongSessions(int)public long getCreationTime()
HttpdSessionHashtable.dropLongSessions(int),
getLastAccessTime(),
getAccessCount()public long getLastAccessTime()
HttpdSessionHashtable.dropInactiveSessions(int),
getCreationTime(),
updateLastAccess(java.lang.String),
updateLastAccessTime(),
getAccessCount()public void updateLastAccess(java.lang.String remoteAddress)
remoteAddress - the current raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd) without DNS lookup.HttpdFilter,
HttpdSessionHashtable,
updateLastAccessTime(),
getLastAccessTime(),
getAccessCount(),
getRemoteAddress()
public void updateLastAccess(java.lang.String remoteAddress,
java.lang.String lastSessionInfo)
remoteAddress - the current raw TCP/IP remote address of agent (aaa.bbb.ccc.ddd) without DNS lookup.lastSessionInfo - informational text about the session. Used for debugging or visualizing sessions.HttpdFilter,
HttpdSessionHashtable,
updateLastAccessTime(),
getLastAccessTime(),
getAccessCount(),
getRemoteAddress()public void updateLastAccessTime()
HttpdFilter,
HttpdSessionHashtable,
getLastAccessTime(),
getAccessCount()public long getAccessCount()
getCreationTime(),
getLastAccessTime()
public void setAttribute(java.lang.String name,
java.lang.Object value)
name - the arbitrary name of the object. If an other object has already been bound
with the same name, the (old) object will be overwritten.value - the object to bindgetAttribute(java.lang.String),
getAttributNames()public java.lang.Object getAttribute(java.lang.String name)
name - the name of the objectsetAttribute(java.lang.String, java.lang.Object),
getAttributNames()public java.util.Enumeration getAttributNames()
setAttribute(java.lang.String, java.lang.Object),
getAttribute(java.lang.String)public void setLastSessionInfo(java.lang.String lastSessionInfo)
lastSessionInfo - informational text about the session. Used for debugging or visualizing sessions.getLastSessionInfo()public java.lang.String getLastSessionInfo()
setLastSessionInfo(java.lang.String)
|
Femto Web Server V1.4-F | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||