org.jboss.portal.portlet.impl.spi
Class AbstractUserContext

java.lang.Object
  extended by org.jboss.portal.portlet.impl.spi.AbstractUserContext
All Implemented Interfaces:
UserContext

public class AbstractUserContext
extends java.lang.Object
implements UserContext

Version:
$Revision: 1.1 $
Author:
Julien Viet

Constructor Summary
AbstractUserContext()
           
AbstractUserContext(javax.servlet.http.HttpServletRequest clientRequest)
           
AbstractUserContext(java.lang.String id)
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attrKey)
          Returns an attribute related to the user identity.
 java.lang.String getId()
          Returns the user id or null if none was provided.
 java.util.Map<java.lang.String,java.lang.String> getInformations()
          Returns an immutable empty map.
 java.util.Locale getLocale()
          Returns the client request locale or Locale.ENGLISH if no request was provided.
 java.util.List<java.util.Locale> getLocales()
          Returns the client request locales or an empty list if no request was provided.
 void setAttribute(java.lang.String attrKey, java.lang.Object attrValue)
          Set an attribute related to the user identity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUserContext

public AbstractUserContext(javax.servlet.http.HttpServletRequest clientRequest)
                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

AbstractUserContext

public AbstractUserContext(java.lang.String id)
                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

AbstractUserContext

public AbstractUserContext()
Method Detail

getId

public java.lang.String getId()
Returns the user id or null if none was provided.

Specified by:
getId in interface UserContext
Returns:
the user id

getInformations

public java.util.Map<java.lang.String,java.lang.String> getInformations()
Returns an immutable empty map.

Specified by:
getInformations in interface UserContext
Returns:
a map containing user profile informaton
See Also:
org.jboss.portal.common.p3p.P3PConstants

getLocale

public java.util.Locale getLocale()
Returns the client request locale or Locale.ENGLISH if no request was provided.

Specified by:
getLocale in interface UserContext
Returns:
the user locale.

getLocales

public java.util.List<java.util.Locale> getLocales()
Returns the client request locales or an empty list if no request was provided.

Specified by:
getLocales in interface UserContext
Returns:
the locales ordered according to user preference (preferred first).

setAttribute

public void setAttribute(java.lang.String attrKey,
                         java.lang.Object attrValue)
Description copied from interface: UserContext
Set an attribute related to the user identity.

Specified by:
setAttribute in interface UserContext
Parameters:
attrKey - the attribute key
attrValue - the attribute value

getAttribute

public java.lang.Object getAttribute(java.lang.String attrKey)
Description copied from interface: UserContext
Returns an attribute related to the user identity.

Specified by:
getAttribute in interface UserContext
Parameters:
attrKey - the attribute key
Returns:
the attribute value


Copyright © 2008. All Rights Reserved.