|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.portal.wireless.taglibs.base.Context
Implements a simple context mechanism for tracking user state across multiple requests. Developers should extend this class to create their own application-specific contexts.
ContextCache
Field Summary | |
protected java.lang.String |
charSetString
The charset for this context. |
protected java.lang.String |
errorCode
The error code for this context. |
protected Context |
parentContext
The parent context. |
protected SSOToken |
session
The user's session for this context. |
protected SSOAdapter |
ssoAdapter
The SSOAdapter that provides access to the backend service
utilized by this context. |
protected java.util.TimeZone |
timezone
The user's time zone. |
Constructor Summary | |
Context()
|
Method Summary | |
java.util.Set |
getAttributeSet(java.lang.String name)
Gets the attribute set from this context. |
java.lang.String |
getAttributeString(java.lang.String name)
Gets an attribute string from this user's profile. |
java.lang.String |
getAttributeString(java.lang.String name,
java.lang.String value)
Gets an attribute string from this user's profile. |
java.lang.String |
getCharset()
Gets the charset of this context. |
java.lang.String |
getClientType()
Gets the client type. |
java.lang.String |
getConfigName()
Gets the name of the SSOAdapter configuration that
selected and configured the SSOAdapter used by this
Context . |
java.lang.String |
getContentType()
Gets the content type for this context. |
static Context |
getContext(PageContext pageContext,
java.lang.String contextClassName,
java.lang.String contextCacheClassName,
java.lang.String contextType)
Gets a service context. |
java.lang.String |
getErrorCode()
Gets the error code for this context. |
java.util.Locale |
getLocale()
Gets the user's locale. |
Context |
getParentContext()
Gets the parent context. |
SSOToken |
getSession()
Gets the user's session from this context. |
SSOTokenID |
getSessionID()
Gets the user's session ID from this context. |
SSOAdapter |
getSSOAdapter()
Gets the SSOAdapter for this context. |
java.util.TimeZone |
getTimeZone()
Gets the user's timezone. |
java.util.Locale |
getUserLocale()
Gets the user locale. |
java.lang.String |
getUserLocaleString()
Gets the user locale string. |
void |
init(HttpServletRequest request,
SSOToken session,
SSOAdapter ssoAdapter)
Initializes this context. |
void |
init(HttpServletRequest request,
SSOToken session,
java.lang.String serviceName,
SSOAdapter ssoAdapter)
Initializes this context and associates it with a specified service. |
void |
setErrorCode(java.lang.String errorCode)
Sets the error code for this context. |
void |
setParentContext(Context context)
Sets the parent context. |
void |
ssoTokenChanged(SSOTokenEvent evt)
Handles events from the Portal Session, and cleans up the context when the session goes invalid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SSOToken session
getSession()
protected java.lang.String charSetString
getCharset()
protected java.util.TimeZone timezone
getTimeZone()
protected java.lang.String errorCode
getErrorCode()
,
setErrorCode(String)
protected SSOAdapter ssoAdapter
SSOAdapter
that provides access to the backend service
utilized by this context.
protected Context parentContext
getParentContext()
,
setParentContext(Context)
Constructor Detail |
public Context()
Method Detail |
public void init(HttpServletRequest request, SSOToken session, java.lang.String serviceName, SSOAdapter ssoAdapter) throws java.lang.Exception
request
- the HTTP servlet requestsession
- the user's sessionserviceName
- the service namessoAdapter
- the SSOAdapter
java.lang.Exception
public void init(HttpServletRequest request, SSOToken session, SSOAdapter ssoAdapter) throws java.lang.Exception
request
- the HTTP servlet requestsession
- the user's sessionssoAdapter
- the SSOAdapter
java.lang.Exception
public void setParentContext(Context context)
context
- the parent contextgetParentContext()
public Context getParentContext()
setParentContext(Context)
public static Context getContext(PageContext pageContext, java.lang.String contextClassName, java.lang.String contextCacheClassName, java.lang.String contextType) throws java.lang.Exception
pageContext
, if not present...
contextCache
, if not present...
<contextClassName>configName
:
Stores the name of the configuration pertinent to the context to be retrieved.
<contextType>
: Stores a context, keyed by categorical name,
e.g., "abcontext", "mailcontext", or "calcontext".
ps.session
: The current SSOToken/session.
pageContext
- the page contextcontextClassName
- the context class namecontextCacheClassName
- the context cache class namecontextType
- the context type
java.lang.Exception
public java.lang.String getAttributeString(java.lang.String name)
name
- the name of the attribute stored within the service associated with this context
public java.lang.String getAttributeString(java.lang.String name, java.lang.String value)
name
- the name of the attribute stored within the service associated with this contextvalue
- a default value to return if the referenced attribute is empty
public java.util.Set getAttributeSet(java.lang.String name)
name
- the name of the attribute stored within the service associated with this contextpublic SSOToken getSession()
SSOToken
objectpublic SSOTokenID getSessionID()
SSOTokenID
object.public java.util.Locale getLocale()
Locale
object.public java.util.TimeZone getTimeZone()
TimeZone
object.public java.lang.String getErrorCode()
errorCode
bean property
provided by the various context tags. A null
string
value (zero-length string) indicates no error. A non-null error code
whose value is a non-empty String
indicates that an error has occurred.
String
object.setErrorCode(String)
public void setErrorCode(java.lang.String errorCode)
errorCode
- the error codegetErrorCode()
public void ssoTokenChanged(SSOTokenEvent evt)
evt
- the session change eventpublic SSOAdapter getSSOAdapter()
ssoAdapter
public java.lang.String getClientType()
String
objectpublic java.lang.String getUserLocaleString()
String
objectpublic java.util.Locale getUserLocale()
Locale
objectpublic java.lang.String getCharset()
String
object.public java.lang.String getContentType()
String
object.public java.lang.String getConfigName()
SSOAdapter
configuration that
selected and configured the SSOAdapter
used by this
Context
.
<Context object>.ssoAdapter.getName()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |