com.sun.portal.wireless.taglibs.util
Class UtilContext

java.lang.Object
  extended byContext
      extended bycom.sun.portal.wireless.taglibs.util.UtilContext

public class UtilContext
extends Context

Context class for tracking user state across multiple requests.

See Also:
ContextCache, Serialized Form

Field Summary
protected static java.lang.String CONTEXT_CACHE_CLASS_NAME
          The util context cache class name.
protected static java.lang.String CONTEXT_CLASS_NAME
          The util context class name.
protected static java.lang.String CONTEXT_TYPE
          The util context type.
 
Constructor Summary
UtilContext()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Gets a context attribute.
 java.lang.String getClientAttribute(HttpServletRequest request, java.lang.String serviceName, java.lang.String attributeName)
          Gets a client-dependent profile attribute.
 Compressor getCompressor()
          Gets the compressor for this session.
static UtilContext getContext(PageContext pageContext)
          Gets a UtilContext for this session.
 java.lang.String getCounterName()
          Gets the counter name bean property.
 java.lang.String getCounterString()
          Gets a cache-defeating counter.
 java.lang.String getEscapeClassName()
          Gets the class name of the Encoder used for EntityEscaping for this client type.
 java.lang.String getParmDelimiter()
          Gets the parameter delimiter bean property.
 boolean getRfc2396()
          Indicates whether or not RFC2396 style URL escaping should be applied when forming a URL parameter using the parm tag.
 java.lang.String getURL(PageContext pageContext, java.lang.String fileName, java.lang.String compName, java.lang.String parms)
          Gets a client-aware URL.
 java.lang.String getURL(java.lang.String path, java.lang.String parms)
          Gets a client-aware URL.
 boolean getUrlAmpEntity()
          Indicates whether or not the & character used to delimit parameters in a query string should be represented as a & or &.
 void init(HttpServletRequest request)
          Initializes a context when there is no session.
 void init(HttpServletRequest request, com.iplanet.sso.SSOToken session, SSOAdapter ssoAdapter)
          Initializes a context with the specified session.
 void removeAttribute(java.lang.String name)
          Removes the specified attribute from this context.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets a context attribute with the specified name and value.
 void setCounterName(java.lang.String s)
          Sets the counter name bean property.
 void setEscapeClassName(java.lang.String escapeClassNameParam)
          Sets the class name of the Encoder used for EntityEscaping for this client type.
 void setParmDelimiter(java.lang.String s)
          Sets the parameter delimiter bean property.
 void setRfc2396(boolean b)
          Sets a boolean indicating whether or not RFC2396 style URL escaping should be applied when forming a URL parameter using the parm tag.
 void setUrlAmpEntity(boolean b)
          Sets a boolean indicating whether or not the & character used to delimit parameters in a query string should be represented as a & or &.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_CLASS_NAME

protected static final java.lang.String CONTEXT_CLASS_NAME
The util context class name. The value of this field is: "com.sun.portal.wireless.taglibs.util.UtilContext"

See Also:
Constant Field Values

CONTEXT_CACHE_CLASS_NAME

protected static final java.lang.String CONTEXT_CACHE_CLASS_NAME
The util context cache class name. The value of this field is "com.sun.portal.wireless.taglibs.util.UtilContextCache"

See Also:
Constant Field Values

CONTEXT_TYPE

protected static final java.lang.String CONTEXT_TYPE
The util context type. The value of this field is: "Util".

See Also:
Constant Field Values
Constructor Detail

UtilContext

public UtilContext()
Method Detail

init

public void init(HttpServletRequest request)
          throws java.lang.Exception
Initializes a context when there is no session.

Parameters:
request - the HTTP servlet request
Throws:
java.lang.Exception

init

public void init(HttpServletRequest request,
                 com.iplanet.sso.SSOToken session,
                 SSOAdapter ssoAdapter)
          throws java.lang.Exception
Initializes a context with the specified session.

Parameters:
request - the HTTP servlet request
session - the specified session
ssoAdapter - the SSOAdapter
Throws:
java.lang.Exception

getContext

public static UtilContext getContext(PageContext pageContext)
                              throws java.lang.Exception
Gets a UtilContext for this session. Note: UtilContext.getContext() will always try to return a UtilContext, even in the absence of a valid session. This is necessary to enable minimal taglib functionality in the case of a session timeout.

Parameters:
pageContext - the page context
Returns:
the UtilContext for this session.
Throws:
java.lang.Exception

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Gets a context attribute.

Parameters:
name - the attribute name
Returns:
a context attribute as an Object.
See Also:
setAttribute(String,Object)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets a context attribute with the specified name and value.

Parameters:
name - the attribute name
value - the attribute value
See Also:
getAttribute(String)

removeAttribute

public void removeAttribute(java.lang.String name)
Removes the specified attribute from this context.

Parameters:
name - the attribute name
See Also:
setAttribute(String,Object)

getURL

public java.lang.String getURL(PageContext pageContext,
                               java.lang.String fileName,
                               java.lang.String compName,
                               java.lang.String parms)
Gets a client-aware URL.

Parameters:
pageContext - the page context
fileName -
compName -
parms - optional parameters, appended to the URL
Returns:
the generated client-aware URL as a String
See Also:
getURL(String,String)

getURL

public java.lang.String getURL(java.lang.String path,
                               java.lang.String parms)
Gets a client-aware URL.

Parameters:
path - the specified path
parms - optional parameters, appended to the URL
Returns:
the generated client-aware URL as a String
See Also:
getURL(PageContext,String,String,String)

getCompressor

public Compressor getCompressor()
Gets the compressor for this session.

Returns:
the compressor for this session

getClientAttribute

public java.lang.String getClientAttribute(HttpServletRequest request,
                                           java.lang.String serviceName,
                                           java.lang.String attributeName)
Gets a client-dependent profile attribute.

Parameters:
request - the HTTP servlet request
serviceName - the specified service name
attributeName - the specified attribute name
Returns:
the client-dependent profile attribute

getCounterString

public java.lang.String getCounterString()
Gets a cache-defeating counter.

Returns:
the hex counter value as a String

setRfc2396

public void setRfc2396(boolean b)
Sets a boolean indicating whether or not RFC2396 style URL escaping should be applied when forming a URL parameter using the parm tag.

Parameters:
b - true if so, false if not

getRfc2396

public boolean getRfc2396()
Indicates whether or not RFC2396 style URL escaping should be applied when forming a URL parameter using the parm tag.

Returns:
true if so, false if not
See Also:
setRfc2396(boolean)

setUrlAmpEntity

public void setUrlAmpEntity(boolean b)
Sets a boolean indicating whether or not the & character used to delimit parameters in a query string should be represented as a & or &.

Parameters:
b - true if so, false if not

getUrlAmpEntity

public boolean getUrlAmpEntity()
Indicates whether or not the & character used to delimit parameters in a query string should be represented as a & or &.

Returns:
true if so, false if not

setCounterName

public void setCounterName(java.lang.String s)
Sets the counter name bean property.

Parameters:
s - the new name
See Also:
getCounterName()

getCounterName

public java.lang.String getCounterName()
Gets the counter name bean property.

Returns:
the counter name as a String
See Also:
setCounterName(String)

setParmDelimiter

public void setParmDelimiter(java.lang.String s)
Sets the parameter delimiter bean property.

Parameters:
s - the new parameter delimiter value
See Also:
getParmDelimiter()

getParmDelimiter

public java.lang.String getParmDelimiter()
Gets the parameter delimiter bean property.

Returns:
the parameter delimiter as a String
See Also:
setParmDelimiter(String)

setEscapeClassName

public void setEscapeClassName(java.lang.String escapeClassNameParam)
Sets the class name of the Encoder used for EntityEscaping for this client type.

Parameters:
escapeClassNameParam - a class that implements the com.sun.portal.desktop.encode.TypeEncode interface.

getEscapeClassName

public java.lang.String getEscapeClassName()
Gets the class name of the Encoder used for EntityEscaping for this client type.

Returns:
the escape class name