com.dynamide.util
Class SessionDatabase

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.util.SessionDatabase
All Implemented Interfaces:
IGet

public class SessionDatabase
extends DynamideObject


Field Summary
 int CLEAN_WHICH_ALL
           
 int CLEAN_WHICH_EXPIRED
           
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Constructor Summary
SessionDatabase()
           
SessionDatabase(DynamideObject owner)
           
 
Method Summary
 java.lang.String addSession(java.lang.Object sessionData)
           
 boolean addSession(java.lang.String id, java.lang.Object sessionData)
           
 void cleanSessionTable(int which)
           
 void clear()
           
 void clearTemplateCache()
           
 void finalize()
           
 java.lang.String formatSessionItemUptime(ISessionTableItem sd)
           
 java.lang.String formatSessionList(java.lang.String userName, ISessionTableItem current)
           
 java.lang.String formatSessionTable(java.lang.String userName)
           
 java.lang.String formatSessionTable(java.lang.String userName, boolean htmlOutput)
           
 java.lang.String formatSessionTable(java.lang.String userName, java.lang.String detailTemplate, java.lang.String closelinkTemplate)
           
 java.lang.String formatSessionTable(java.lang.String userName, java.lang.String hdr, java.lang.String hdre, java.lang.String ns, java.lang.String ts, java.lang.String te, java.lang.String rs, java.lang.String re, java.lang.String tdtd, java.lang.String ds, java.lang.String de, java.lang.String detailTemplate, java.lang.String closelinkTemplate)
           
 int getCacheCount()
           
 java.lang.String getCachedString(java.lang.String key)
           
 int getCriticalItemCount()
           
 java.lang.String getNextSessionID()
           
 java.lang.Object getSession(java.lang.String sessionID)
           
 java.util.Enumeration getSessions()
           
static SessionDatabase getSharedDB()
          You use this to get the singleton object database for cached web extensions.
 boolean getWantCache()
           
 boolean isDetailItemLocked(java.lang.String key)
           
 boolean isSessionNull(java.lang.String id)
           
 void killSessionsStartingWith(java.lang.String sessionPrefix)
           
 void lockDetailItem(java.lang.String key)
          If an item should not be viewable by a hacker, lock it against toString() with this function.
 java.lang.String printSessionKeys()
           
 java.lang.String printSessions()
           
 void putCachedString(java.lang.String key, java.lang.String value)
           
 java.lang.String rebindSession(java.lang.String id, java.lang.Object sessionData)
           
 void removeSession(java.lang.String sessionID)
          Safe to call if sessionID has already been removed.
 void removeSessionObject(java.lang.Object removeMe)
           
 void setWantCache(boolean new_wantCache)
           
 java.lang.String showObjectDetail(java.lang.String id)
           
 java.lang.String showSessions(java.lang.String baseUrl, java.lang.String username)
           
 void shutdown()
           
 void shutdownSession(ISessionItem item)
           
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, dump, dumpHTML, expand, findParentExpander, findParentPage, findParentSession, findTopParentPage, get, getCategoryID, getDotName, getID, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setID, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLEAN_WHICH_ALL

public int CLEAN_WHICH_ALL

CLEAN_WHICH_EXPIRED

public int CLEAN_WHICH_EXPIRED
Constructor Detail

SessionDatabase

public SessionDatabase(DynamideObject owner)

SessionDatabase

public SessionDatabase()
Method Detail

shutdown

public void shutdown()

lockDetailItem

public void lockDetailItem(java.lang.String key)
If an item should not be viewable by a hacker, lock it against toString() with this function. All items not locked will have toString called when showSessionObjects formats the showSessionObjectDetail link.


isDetailItemLocked

public boolean isDetailItemLocked(java.lang.String key)

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class DynamideObject
Throws:
java.lang.Throwable

getNextSessionID

public java.lang.String getNextSessionID()

clear

public void clear()

addSession

public java.lang.String addSession(java.lang.Object sessionData)

rebindSession

public java.lang.String rebindSession(java.lang.String id,
                                      java.lang.Object sessionData)

addSession

public boolean addSession(java.lang.String id,
                          java.lang.Object sessionData)

removeSession

public void removeSession(java.lang.String sessionID)
Safe to call if sessionID has already been removed. If you have been called by ISessionItem.shutdown(), you don't need to call this method, though.


killSessionsStartingWith

public void killSessionsStartingWith(java.lang.String sessionPrefix)

removeSessionObject

public void removeSessionObject(java.lang.Object removeMe)

shutdownSession

public void shutdownSession(ISessionItem item)

getSession

public java.lang.Object getSession(java.lang.String sessionID)

isSessionNull

public boolean isSessionNull(java.lang.String id)

getSessions

public java.util.Enumeration getSessions()

printSessions

public java.lang.String printSessions()

printSessionKeys

public java.lang.String printSessionKeys()

showSessions

public java.lang.String showSessions(java.lang.String baseUrl,
                                     java.lang.String username)

showObjectDetail

public java.lang.String showObjectDetail(java.lang.String id)

getCriticalItemCount

public int getCriticalItemCount()

clearTemplateCache

public void clearTemplateCache()

getCacheCount

public int getCacheCount()

getWantCache

public boolean getWantCache()

setWantCache

public void setWantCache(boolean new_wantCache)

getCachedString

public java.lang.String getCachedString(java.lang.String key)

putCachedString

public void putCachedString(java.lang.String key,
                            java.lang.String value)

cleanSessionTable

public void cleanSessionTable(int which)

formatSessionTable

public java.lang.String formatSessionTable(java.lang.String userName)

formatSessionTable

public java.lang.String formatSessionTable(java.lang.String userName,
                                           java.lang.String detailTemplate,
                                           java.lang.String closelinkTemplate)

formatSessionTable

public java.lang.String formatSessionTable(java.lang.String userName,
                                           boolean htmlOutput)

formatSessionTable

public java.lang.String formatSessionTable(java.lang.String userName,
                                           java.lang.String hdr,
                                           java.lang.String hdre,
                                           java.lang.String ns,
                                           java.lang.String ts,
                                           java.lang.String te,
                                           java.lang.String rs,
                                           java.lang.String re,
                                           java.lang.String tdtd,
                                           java.lang.String ds,
                                           java.lang.String de,
                                           java.lang.String detailTemplate,
                                           java.lang.String closelinkTemplate)

formatSessionItemUptime

public java.lang.String formatSessionItemUptime(ISessionTableItem sd)

formatSessionList

public java.lang.String formatSessionList(java.lang.String userName,
                                          ISessionTableItem current)

getSharedDB

public static SessionDatabase getSharedDB()
You use this to get the singleton object database for cached web extensions. Be careful when you retrieve objects from the database. The database can be used to store objects of different types. The objects do not persist after run-time, however, so each invocation of the Java VM will mean a fresh database. The database's store method: addSession() will return you a unique ID for each object stored.



Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.