oracle.portal.provider.v1.http
Class ServletProviderUser

java.lang.Object
  |
  +--oracle.portal.provider.v1.ProviderUser
        |
        +--oracle.portal.provider.v1.http.ServletProviderUser

public class ServletProviderUser
extends ProviderUser

Represents the Portal user. Additionally provides the methods for establishing and reaquiring the user's session. This class used to be stored in the HttpSession but now it accesses the ServletProviderSession on an as-needed basis to prevent memory leaks. Some Providers have a distinct notion users. Providers are able to configure the Portal (using a login server) to map between the Portal user and the application (Provider) user. The ProviderUser interface provides access to both the Portal user information and this mapped information.

The portal runs in a default public mode. This occurs when a user accesses the portal without logging in. This is represented by a special ProviderUser whose portal user name is defined by the String ProviderUser.PUBLIC. The convenience method isPublicUser() is provided to simplify this check. Note: since this object retains a reference to the HttpRequest, it should not be placed in the HttpSession (or ProviderSession). Each request that is potentially user-based includes information to create a new user object


Fields inherited from class oracle.portal.provider.v1.ProviderUser
AUTH_LEVEL_NOT_SUPPORTED, AUTH_NOT_DETERMINED, NOT_AUTHENTICATED, PORTAL_PUBLIC, PUBLIC, PUBLIC_STRONG_AUTH, PUBLIC_USERNAME, PUBLIC_WEAK_AUTH, USER_STRONG_AUTH, USER_WEAK_AUTH
 
Constructor Summary
ServletProviderUser(ServletProviderRequest request, int servletSessionTimeout)
           
ServletProviderUser(ServletProviderRequest request, java.lang.String name308, java.lang.String name309, java.lang.String subscriberId, java.lang.String companyName, int authenticationLevel, java.lang.String mappedUserName, java.lang.String loginTime, java.lang.String sessionId, int servletSessionTimeout)
          Constructor This version of the constructor is used for creating a user object from a SOAP message.
 
Method Summary
 int getAuthenticationLevel()
           
 java.lang.String getCompanyName()
           
 javax.servlet.http.Cookie[] getCookies()
          Gets an array of all the cookies established between this user and the provider, or a null value if the user currently has no cookies.
 UserLocation getLocation()
           
 java.util.Calendar getLoginTime()
           
 java.lang.String getMappedName()
           
 java.security.Principal getMappedPrincipal()
           
 java.lang.String getName()
           
 java.lang.String getPortalSessionId()
           
 java.security.Principal getPrincipal()
           
 java.lang.String getQualifiedName()
           
 ProviderSession getSession()
          gets a reference to the attached ServletProviderSession object.
 ProviderSession getSession(boolean create)
          gets a reference to the attached ServletProviderSession object.
 java.lang.String getSubscriberId()
           
 boolean isLoggedOn()
           
 boolean isPublicUser()
          Tests whether we are running in public mode.
 boolean isWeaklyAuthenticated()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletProviderUser

public ServletProviderUser(ServletProviderRequest request,
                           int servletSessionTimeout)

ServletProviderUser

public ServletProviderUser(ServletProviderRequest request,
                           java.lang.String name308,
                           java.lang.String name309,
                           java.lang.String subscriberId,
                           java.lang.String companyName,
                           int authenticationLevel,
                           java.lang.String mappedUserName,
                           java.lang.String loginTime,
                           java.lang.String sessionId,
                           int servletSessionTimeout)
Constructor This version of the constructor is used for creating a user object from a SOAP message. The information is all available in the soap message and does not need to be decoded User location is always sent as Http Headers so it is never passed into the constructor. It will be read and constructed as needed.
Method Detail

getPrincipal

public java.security.Principal getPrincipal()
Overrides:
getPrincipal in class ProviderUser
Returns:
the portal user.

getMappedPrincipal

public java.security.Principal getMappedPrincipal()
Overrides:
getMappedPrincipal in class ProviderUser
Returns:
the mapped application user. null if there is no mapped user.

getName

public java.lang.String getName()
Overrides:
getName in class ProviderUser
Returns:
the portal username. Convenience method for getPrincipal().getName()

getSubscriberId

public java.lang.String getSubscriberId()
Overrides:
getSubscriberId in class ProviderUser
Returns:
the subscriber id. Convenience method for getPrincipal().getSubscriberId()

getCompanyName

public java.lang.String getCompanyName()
Overrides:
getCompanyName in class ProviderUser
Returns:
the company name. Convenience method for getPrincipal().getCompanyName()

getMappedName

public java.lang.String getMappedName()
Overrides:
getMappedName in class ProviderUser
Returns:
the mapped application username. Convenience method for getMappedPrincipal().getName()

getQualifiedName

public java.lang.String getQualifiedName()
Overrides:
getQualifiedName in class ProviderUser
Returns:
the qulaified username, ie username appended with company name separator is "@@"

getLoginTime

public java.util.Calendar getLoginTime()
Overrides:
getLoginTime in class ProviderUser
Returns:
the time when this user logged into the Portal

getPortalSessionId

public java.lang.String getPortalSessionId()
Overrides:
getPortalSessionId in class ProviderUser
Returns:
the Portal session ID for this user. Portlet developers can use this ID to map to their in memory "session" state vs. using a cookie based mechanism. The benefit is performance. If the provider doesn't use cookies the portal can communicate more efficiently with it.

getAuthenticationLevel

public int getAuthenticationLevel()
Overrides:
getAuthenticationLevel in class ProviderUser
Returns:
the authentication level for the user

isLoggedOn

public boolean isLoggedOn()
Overrides:
isLoggedOn in class ProviderUser
Returns:
true if the user has logged onto the portal in the current session. A user who is weakly authentication has not logged on to the portal in the current session so this method will return false.

isWeaklyAuthenticated

public boolean isWeaklyAuthenticated()
Overrides:
isWeaklyAuthenticated in class ProviderUser
Returns:
true if the current user is at least weakly authenticated

isPublicUser

public boolean isPublicUser()
Tests whether we are running in public mode. ie the user has not logged in and is not weakly authenticated based on a prior login
Overrides:
isPublicUser in class ProviderUser
Returns:
true if the user is accessing the portal in public mode.

getSession

public ProviderSession getSession(boolean create)
                           throws java.lang.IllegalStateException
gets a reference to the attached ServletProviderSession object. Optionally create a new ServletProviderSession if create = true.
Overrides:
getSession in class ProviderUser
Parameters:
create - create a new ServletProviderSession if one is not already associated with the current request
Returns:
attached ServletProviderSession or NULL if this request is not associated with an active ServletProviderSession and "create" is false

getSession

public ProviderSession getSession()
                           throws java.lang.IllegalStateException
gets a reference to the attached ServletProviderSession object.
Overrides:
getSession in class ProviderUser
Returns:
attached ServletProviderSession or NULL if this request is not associated with an active ServletProviderSession

getLocation

public UserLocation getLocation()
Overrides:
getLocation in class ProviderUser
Tags copied from class: ProviderUser
Returns:
the user's location. Value is allowed to be null. This means the information is not available.

getCookies

public javax.servlet.http.Cookie[] getCookies()
Gets an array of all the cookies established between this user and the provider, or a null value if the user currently has no cookies. Cookies must be established in the Provider's initSession method.
Returns:
an array of all this user's cookies or null if the user currently has no cookies.