|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.GenericServer SK.gnome.dwarf.thread.ThreadServer SK.gnome.dwarf.http.RAMSessionManager
This class provides the memory-based session management.
It implements the SessionManager
interface. The sessions are stored and
maintained in the operational memory only. This class provides the automatic session
expiration, too.
Field Summary | |
protected boolean |
checkAddress
Whether or not to check the client's IP address. |
Fields inherited from class SK.gnome.dwarf.thread.ThreadServer |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
RAMSessionManager(java.lang.String name)
Creates a new SessionManager. |
Method Summary | |
protected boolean |
enableThread()
|
Session |
getSession(Request request,
java.lang.String id,
boolean create)
Returns the session for the given request. |
void |
init(SK.gnome.dwarf.Server parent)
|
protected void |
loop()
Checks for the session expiration. |
java.lang.String |
report()
Returns the service report. |
void |
setCheckAddress(boolean enable)
Enables or disables checking of the client's IP address. |
void |
shutdown()
Shuts down the service. |
Methods inherited from class SK.gnome.dwarf.thread.ThreadServer |
finish, run, setDaemon, start, stop |
Methods inherited from class SK.gnome.dwarf.GenericServer |
addService, addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface SK.gnome.dwarf.Service |
getFullName, getName, getState, log, log, login, logout |
Field Detail |
protected boolean checkAddress
If enabled the client's IP address will be compared to the address of the
client, which initiated the session creation, each time a session is requested
via the getSession
method. This
should prevent a possible session-stealing attacks.
Default value: true
setCheckAddress(boolean)
Constructor Detail |
public RAMSessionManager(java.lang.String name)
Method Detail |
public void setCheckAddress(boolean enable)
enable
- true to enable the address checkingcheckAddress
public void init(SK.gnome.dwarf.Server parent) throws SK.gnome.dwarf.ServiceException
init
in interface SK.gnome.dwarf.Service
SK.gnome.dwarf.ServiceException
public void shutdown()
It invalidates all sessions currently stored before returning from the method.
shutdown
in interface SK.gnome.dwarf.Service
public java.lang.String report()
Returns a detailed information about sessions currently stored in the session manager.
report
in interface SK.gnome.dwarf.Reportable
public Session getSession(Request request, java.lang.String id, boolean create)
SessionManager
A new session should be created if no session exists with the given id if the create argument is true.
getSession
in interface SessionManager
request
- the requestid
- the session idcreate
- whether to create a new session if no session with the given id exists
protected boolean enableThread()
protected void loop()
It periodically checks for the expired sessions, invalidates them and removes from the session store.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |