|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.wcm.toolkit.server.util.WcmDataStore
WcmDataStore is a utility class that holds data across requests for a client session.
Nested Class Summary | |
protected static class |
WcmDataStore.DummyOutputStream
|
Field Summary | |
static java.lang.String |
BASE_LOCALPATH_KEY
Deprecated. use |
static java.lang.String |
BASE_URL_KEY
The application's base URL as computed from the request. |
static int |
BASIC_VALIDATION
|
protected java.util.Map |
datastoreTable
|
protected boolean |
initialized
|
static int |
NO_VALIDATION
|
static int |
THOROUGH_VALIDATION
|
static java.lang.String |
URL_HOST_KEY
The URL_HOST_KEY contains the host name that appears on the URL. |
static java.lang.String |
URL_PORT_KEY
The URL_PORT_KEY contains the port number part, if any. |
static java.lang.String |
URL_ROOT_KEY
The URL_ROOT_KEY contains the web application name part. |
static java.lang.String |
USER_CREDENTIALS_KEY
A web session's user credentials that can be retrieved easily. |
protected static int |
validateMode
|
Constructor Summary | |
WcmDataStore()
|
Method Summary | |
static void |
clear(javax.servlet.http.HttpServletRequest request)
|
boolean |
containsKey(java.lang.String key)
Check to see if the named key exists in the Data Store. |
static WcmDataStore |
get(javax.servlet.http.HttpServletRequest request)
Get the datastore instance for this user session, skip initialization & just return it. |
static WcmDataStore |
get(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request)
Static factory method for getting a Data Store for the current session. |
static WcmDataStore |
get(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
boolean forceInit)
Static factory method for getting a Data Store for the current session. |
java.util.Locale |
getClientLocale()
|
java.util.Set |
getKeys()
Returns all keys in the Data Store. |
java.util.List |
getKeysStartingWith(java.lang.String sStartsWith,
boolean bReturnUniqueParts)
Returns keys in the Data Store that start with a specified string. |
WcmServerCredentials |
getServerCredentials()
Shortcut to (WcmDataStoreCredentials) dataStore.getValue(WcmDataStore.USER_CREDENTIALS_KEY); |
java.lang.Object |
getValue(java.lang.String key)
Method for retrieving the corresponding value associated with a key from the Data Store. |
java.lang.Object |
getValue(java.lang.String key,
java.lang.Object defaultValue)
|
void |
init(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request)
Initialize globals |
java.lang.Object |
remove(java.lang.String key)
Method for removing a key and corresponding value from the Data Store. |
static void |
setValidateMode(int mode)
For application testing, enables validation of incoming objects to verify that they are serializable. |
java.lang.Object |
setValue(java.lang.String key,
java.lang.Object value)
Method for adding a key with associated value into the Data Store. |
java.lang.Object |
setValue(java.lang.String key,
java.lang.Object value,
boolean bForCache)
Method for adding a key with associated value into the Data Store. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent event)
This is a stubbed implementation in order to support the HttpSessionBindingListener interface. |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
This is an implementation of HttpSessionBindingListener.valueUnbound. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String BASE_URL_KEY
public static final java.lang.String URL_PORT_KEY
public static final java.lang.String URL_ROOT_KEY
public static final java.lang.String URL_HOST_KEY
public static final java.lang.String BASE_LOCALPATH_KEY
public static final java.lang.String USER_CREDENTIALS_KEY
WcmServerCredentials
,
Constant Field Valuespublic static final int NO_VALIDATION
public static final int BASIC_VALIDATION
public static final int THOROUGH_VALIDATION
protected static int validateMode
protected transient java.util.Map datastoreTable
protected boolean initialized
Constructor Detail |
public WcmDataStore()
Method Detail |
public void init(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request)
public static WcmDataStore get(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request)
application
- ServletContext objectrequest
- HttpServletRequest object
public static WcmDataStore get(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, boolean forceInit)
application
- ServletContext objectrequest
- HttpServletRequest objectforceInit
- Set to "true" to force initialization of global keys.
public static WcmDataStore get(javax.servlet.http.HttpServletRequest request)
request
-
public static void clear(javax.servlet.http.HttpServletRequest request)
public java.lang.Object getValue(java.lang.String key)
key
- A string representing a key into the Data Store.
The Data Store initially contains the following global keys:WcmServerCredentials
public java.lang.Object getValue(java.lang.String key, java.lang.Object defaultValue)
key
- A string representing a key into the Data Store.defaultValue
- return value, if the value for the given key is not found in the Data Store
getValue(String)
public java.lang.Object setValue(java.lang.String key, java.lang.Object value) throws WcmException
key
- If key does not exist, a new key is added and value is associated.
If key already exists, value will be overwritten without error.value
- Any non-null object can be provided as value. If key or value is
null, then WcmException is thrown.
WcmException
public java.lang.Object setValue(java.lang.String key, java.lang.Object value, boolean bForCache) throws WcmException
key
- If key does not exist, a new key is added and value is associated.
If key already exists, value will be overwritten without error.value
- Any non-null object can be provided as value. If key or value is
null, then WcmException is thrown.bForCache
- if this is true, the value will be added as a Soft Reference.
That means, if the memory gets low, the value will be automatically removed.
WcmException
public static void setValidateMode(int mode)
mode
- public java.lang.Object remove(java.lang.String key)
key
- A string representing a key into the Data Store.
public boolean containsKey(java.lang.String key)
key
- A string representing a key into the Data Store.
public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
event
- A reference to the associated HttpSessionBindingEvent.public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
event
- A reference to the associated HttpSessionBindingEvent.public java.util.Set getKeys()
public WcmServerCredentials getServerCredentials()
public java.util.List getKeysStartingWith(java.lang.String sStartsWith, boolean bReturnUniqueParts)
sStartsWith
- keys must start with this string to be included.bReturnUniqueParts
- true if you want only unique keys returned.
For example, if you have keys named a.b.c and a.b.x in the Data Store,
with bReturnUniqueParts = true and sStartsWith = "a.b." the method will
return a list with "c" and "x". Otherwise it would return a list with
"a.b.c" and "a.b.x".
public java.util.Locale getClientLocale()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |