|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--ORG.oclc.jassi.UserStateObject
The UserStateObject class contains persistent user state data that is maintained for the user's session. Temporary user state data is maintained only for the current thread transaction. There is one UserStateObject object per user in the system.
The UserStateObject class extends Hashtable, which maps keys to values. Any non-null object can be used as a key or as a value.
The UserStateObject class provides methods that allow for the storage and retreival of objects from the hashtable.
These examples show how to store and retreive user state objects:
(1) The first example shows the storage of the key dbname in the hashtable with the associated WorldCat String value. An entity &dbname; can be set in an HTML page and will be substituted the the corresponding hashtable String value WorldCat.
user.put("dbname", "WorldCat");
String currentdbname = (String) user.get("dbname");
(2) The second example shows the storage of the key recordnumber in the hashtable with the associated integer value 10.
user.put("recordnumber", 10);
int currentRecordNum = user.getInt("recordnumber");
(3) The third example shows the storage of the key tmpHash in the hashtable with the associated Hashtable object. This example demonstrates that any type of object can be stored in the user state hashtable.
Hashtable t = new Hashtable(10);
user.put("tmpHash", t);
Hashtable tHash = (Hashtable) user.get("tmpHash");
JaSSI
,
UserApplicationContext
,
UserHistory
,
Verb
,
UserLog
, Serialized FormField Summary | |
Log |
out
Log object for writing JaSSI user logs. |
static int |
PROTECTED
|
static int |
RONLY
|
static int |
UNPROTECTED
|
String |
userId
String containing the user's sessionid. |
Constructor Summary | |
UserStateObject(String sessionId)
Constructs a UserStateObject object using the input parameter sessionid. |
Method Summary | |
Hashtable |
applicationContext()
Returns a hashtable containing the UserApplicationContext objects. |
boolean |
containsKey(Object name)
Tests if the specified object is a key in this hashtable. |
void |
delete()
Removes this user and all associated data with this user from the system. |
Object |
get(Object name)
Returns the value to which the specified input key is mapped in this hashtable. |
Object |
get(Object name,
RequestManager rMngr)
|
boolean |
getBoolean(Object name)
Returns the boolean value to which the specified input key is mapped in this hashtable. |
DataPairs |
getHttpMsg()
Returns a DataPairs object containing the user's current transaction HTTP request. |
int |
getInt(Object name)
Returns the integer value to which the specified input key is mapped in this hashtable. |
int |
getInt(Object name,
int defaultVal)
Returns the integer value to which the specified input key is mapped in this hashtable or a default integer value if the key is not mapped to any value. |
long |
getLastTxnTime()
Returns the long value of the user's last transaction timestamp. |
Vector |
getPUP()
Returns a Vector containing the names of all the persistent user profile items |
Object |
getSync(String key)
Returns the syncronization state for the User for a particular Thread. |
int |
getSyncInt(String key)
Returns the syncronization state for the User for a particular Thread. |
String |
getSyncString(String key)
Returns the syncronization state for the User for a particular Thread as a String. |
String |
getTempSessionDir()
Returns the String value of the directory root for temporary files used during a session. |
static int |
getTraceLevel()
Returns the current trace level (i.e. |
Vector |
history()
Returns the Vector object containing the list of UserHistory objects. |
boolean |
isSync(String key,
int syncMode)
Sets the syncronization state for the User for a particular Thread. |
void |
openLog(int traceLevel)
Opens the user log file if it is not already opened and sets the trace level to the specified input integer value. |
Log |
out()
Returns the user Log object. |
Object |
put(Object name,
boolean value)
Maps the specified input key to the specified input boolean value. |
Object |
put(Object name,
int value)
Maps the specified input key to the specified input integer value. |
Object |
put(Object name,
Object obj)
Maps the specified input key to the specified input object value. |
Object |
putPUD(String name,
DataDir d)
Deprecated. Use putPUP method instead. |
Object |
putPUD(String name,
String obj)
Deprecated. Use putPUP method instead. |
Object |
putPUP(Object name,
Object obj)
Adds the name of a piece of profile data to the pups (a list of names of profile data) and also puts the piece of data into the UserStateObject with the name supplied. |
Object |
remove(Object name)
Removes the specified input key and its corresponding value from this hashtable. |
Object |
removePUD(String name)
Deprecated. Use removePUP method instead. |
Object |
removePUP(Object name)
Removes the name of a piece of profile data from the pups (a list of names of profile data). |
void |
removeSync(String key)
Removes the syncronization state for the User for a particular Thread. |
static void |
setCapacity(int c)
Sets the initial UserStateObject hashtable size to the specified input integer value. |
void |
setLastTxnTime()
Sets the user's last transaction timestamp to the current millisecond. |
static void |
setLogClass(String c)
Sets the user log file class to the specified input class name. |
static void |
setLogDir(String d)
Sets the user log file directory to the specified input directory. |
static void |
setLogName(String name)
Sets the user log file name to the specified input name. |
void |
setOverrideHash(Hashtable oh)
Sets the value of overrideHash |
void |
setSync(String key,
int syncMode)
Sets the syncronization state for the User for a particular Thread. |
static void |
setTempDirRoot(String s)
Sets the directory root for temporary files used during a session to the specified input directory root. |
void |
setTimeout(int t)
Sets the timeout period for user idle session timeouts using the integer input parameter t. |
void |
setTimeout(long t)
Sets the timeout period for user idle session timeouts using the long input parameter t. |
static void |
setTraceLevel(int t)
Sets the user trace level to the specified input integer value. |
int |
tempSizeData()
Returns the integer size of the temporary thread hashtable for this user's current transaction thread. |
long |
timeout()
Returns an integer containing the timeout period for the user. |
String |
toString()
Generates the String representation of this object. |
String |
toString(String separator)
Generates the String representation of this object given the specified input String separator value used to terminate each entry. |
void |
writeStats()
Invokes the write method in the user stats object and passes the user and the user's history objects to it. |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsValue,
elements,
entrySet,
equals,
hashCode,
isEmpty,
keys,
keySet,
putAll,
rehash,
size,
values |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public Log out
public String userId
public static final int RONLY
public static final int PROTECTED
public static final int UNPROTECTED
Constructor Detail |
public UserStateObject(String sessionId)
sessionId
- the sessionid for this user.Method Detail |
public Object getSync(String key)
key
- the lock string (e.g., threadId).public int getSyncInt(String key)
key
- the lock string (e.g., threadId).public String getSyncString(String key)
key
- the lock string (e.g., threadId).public boolean isSync(String key, int syncMode)
key
- the lock string (e.g., threadId).syncMode
- the mode to place the user in RONLY, PROTECETED, or
UNPROTECTED.public void removeSync(String key)
key
- the lock string (e.g., threadId).public void setSync(String key, int syncMode)
key
- the lock string (e.g., threadId).syncMode
- the mode to place the user in RONLY, PROTECETED, or
UNPROTECTED.public Vector history()
public final Log out()
public static final void setCapacity(int c)
c
- the initial size of the UserStateObject hashtable.public final void setTimeout(int t)
t
- the number of seconds for the idle session timeout period.public final long timeout()
public final void setTimeout(long t)
t
- the number of milliseconds for the idle session timeout period.public final void setLastTxnTime()
public final long getLastTxnTime()
public static final void setLogName(String name)
name
- the user log file name.public static final void setLogDir(String d)
d
- the user log file directory.public static final void setLogClass(String c)
c
- the user log file class name.public static final void setTempDirRoot(String s)
s
- the temporary directory root.public final String getTempSessionDir()
public final DataPairs getHttpMsg()
public static final void setTraceLevel(int t)
t
- the user trace level integer value.public static int getTraceLevel()
public Hashtable applicationContext()
public void openLog(int traceLevel)
traceLevel
- the trace level integer value for the user logs.public void delete()
public final Object put(Object name, Object obj)
name
- the hashtable key.obj
- the value.public final Object put(Object name, int value)
name
- the hashtable key.obj
- the integer value.public final Object put(Object name, boolean value)
name
- the hashtable key.obj
- the boolean value.public Vector getPUP()
public final Object putPUP(Object name, Object obj)
name
- the name of the profile informationobj
- the value of the profile informationpublic final Object removePUP(Object name)
name
- the name of the profile informationpublic final Object removePUD(String name)
name
- the name of the profile informationpublic final Object putPUD(String name, String obj)
name
- the name of the profile informationobj
- the String value of the profile informationpublic final Object putPUD(String name, DataDir d)
name
- the name of the profile informationd
- the DataDir of the profile informationpublic final Object get(Object name)
name
- the hashtable key.public final Object get(Object name, RequestManager rMngr)
public final void setOverrideHash(Hashtable oh)
oh
- overrideHashpublic final int getInt(Object name, int defaultVal)
name
- a key in the hashtable.defValue
- the default integer value.public final int getInt(Object name) throws NullPointerException, ClassCastException
name
- a key in the hashtable.public final boolean getBoolean(Object name)
name
- a key in the hashtable.public final Object remove(Object name)
name
- the key in the hashtable.public boolean containsKey(Object name)
name
- the key in the hashtable.public int tempSizeData()
public String toString(String separator)
entry
- String separator value. (i.e.: break or newline)public String toString()
public final void writeStats()
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |