Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2.http
Class ServletProviderUser

java.lang.Object
  extended by oracle.webdb.provider.v2.utils.BaseProviderUser
      extended by oracle.portal.provider.v2.ProviderUser
          extended by oracle.portal.provider.v2.http.ServletProviderUser
All Implemented Interfaces:
java.security.Principal

public class ServletProviderUser
extends ProviderUser


Field Summary
 
Fields inherited from class oracle.portal.provider.v2.ProviderUser
AUTH_LEVEL_NOT_DETERMINED, AUTH_LEVEL_NOT_SUPPORTED, DEFAULT_SUBSCRIBER_NAME, NOT_AUTHENTICATED, PORTAL_PUBLIC, PUBLIC, PUBLIC_STRONG_AUTH, PUBLIC_USERNAME, PUBLIC_WEAK_AUTH, USER_STRONG_AUTH, USER_WEAK_AUTH
 
Constructor Summary
ServletProviderUser(javax.servlet.http.HttpServletRequest request)
          Constructs this ServletProviderUser object.
ServletProviderUser(javax.servlet.http.HttpServletRequest request, OidManager oidManager)
          Constructs this ServletProviderUser object.
ServletProviderUser(javax.servlet.http.HttpServletRequest request, java.lang.String name308, java.lang.String name309, java.lang.String subscriberId, java.lang.String companyName, int authLevel, java.lang.String mappedName, java.util.Calendar loginTime, java.lang.String portalSessionId, UserLocation location)
          Constructs this ServletProviderUser object using the information supplied.
ServletProviderUser(javax.servlet.http.HttpServletRequest request, java.lang.String name308, java.lang.String name309, java.lang.String subscriberId, java.lang.String companyName, int authLevel, java.lang.String mappedName, java.util.Calendar loginTime, java.lang.String portalSessionId, UserLocation location, OidManager oidManager, java.lang.String userDN, java.lang.String userGUID, java.lang.String subscriberDN, java.lang.String subscriberGUID)
          Constructs this ServletProviderUser object using the information supplied.
 
Method Summary
 int getAuthenticationLevel()
          Gets the authentication level for the user.
 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.
 java.lang.String getDescription()
          Get the users description
 java.lang.String getDisplayName()
          Get the users display name.
 java.lang.String getEmail()
          Get the portal user's email address.
 java.lang.String getFirstName()
          Get the portal user's first name.
 java.lang.String getFullName()
          Get the users full name.
 java.lang.String getLastName()
          Get the portal user's last name.
 UserLocation getLocation()
          Gets the user's location.
 java.util.Calendar getLoginTime()
          Gets the time when this user logged into the Portal.
 java.lang.String getMappedName()
          Gets the external application username that is mapped to this portal user.
 java.lang.String getName()
          Gets the name of the portal user represented by this object.
 PortalRealm getPortalRealm()
          Get the portal user' realm.
 java.lang.String getPortalSessionId()
          Gets the Portal session ID for this user.
 java.lang.String getPropertyValue(java.lang.String propertyName)
          Get a named property value of the user as stored in OID.
 ProviderSubscription getProviderSubscription()
          Gets subscription information related to this user/request Note, the subscription information is specific to the ProviderInstance the current request was received for.
 ProviderSession getSession()
          Used to create and/or reacquire the user session.
 ProviderSession getSession(boolean create)
          Used to create and/or reacquire the user session.
 java.lang.String getSubscriberDN()
          Get the portal user's Subscription distinguished name.
 java.lang.String getSubscriberGUID()
          Get the portal user's subscriber GUID.
 java.lang.String getSubscriberName()
          Get the portal user's subscriber name.
 java.lang.String getUserDN()
          Get the portal user's distinguished name.
 java.lang.String getUserGUID()
          Get the portal user's GUID.
 boolean isDeactivated()
          Returns if the user is deactivated This method is not actually implemented.
 boolean isLDAPEnabled()
          Determine if the OidManager is configured.
 boolean isUserInGroup(java.lang.String groupName)
          check if this user is a member of a group.
 void setDeactivated(boolean deactivate)
          Sets the user to be deactivated This method is not actually implemented.
 
Methods inherited from class oracle.portal.provider.v2.ProviderUser
getProviderSubscriptionKey, getQualifiedName, isLoggedOn, isPublicUser, isWeaklyAuthenticated
 
Methods inherited from class oracle.webdb.provider.v2.utils.BaseProviderUser
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServletProviderUser

public ServletProviderUser(javax.servlet.http.HttpServletRequest request)
Constructs this ServletProviderUser object. For performance, parameters will only be read from the given HttpServletRequest object when required.

Parameters:
request - a HttpServletRequest.

ServletProviderUser

public ServletProviderUser(javax.servlet.http.HttpServletRequest request,
                           OidManager oidManager)
Constructs this ServletProviderUser object. For performance, parameters will only be read from the given HttpServletRequest object when required. Used in version 9.0.2.6

Parameters:
request - a HttpServletRequest.

ServletProviderUser

public ServletProviderUser(javax.servlet.http.HttpServletRequest request,
                           java.lang.String name308,
                           java.lang.String name309,
                           java.lang.String subscriberId,
                           java.lang.String companyName,
                           int authLevel,
                           java.lang.String mappedName,
                           java.util.Calendar loginTime,
                           java.lang.String portalSessionId,
                           UserLocation location)
Constructs this ServletProviderUser object using the information supplied.


ServletProviderUser

public ServletProviderUser(javax.servlet.http.HttpServletRequest request,
                           java.lang.String name308,
                           java.lang.String name309,
                           java.lang.String subscriberId,
                           java.lang.String companyName,
                           int authLevel,
                           java.lang.String mappedName,
                           java.util.Calendar loginTime,
                           java.lang.String portalSessionId,
                           UserLocation location,
                           OidManager oidManager,
                           java.lang.String userDN,
                           java.lang.String userGUID,
                           java.lang.String subscriberDN,
                           java.lang.String subscriberGUID)
Constructs this ServletProviderUser object using the information supplied. Used in version 9.0.2.6

Method Detail

getName

public java.lang.String getName()
Gets the name of the portal user represented by this object.

Specified by:
getName in interface java.security.Principal
Specified by:
getName in class ProviderUser
Returns:
the portal user name.

getMappedName

public java.lang.String getMappedName()
Gets the external application username that is mapped to this portal user.

Specified by:
getMappedName in class ProviderUser
Returns:
the mapped application user. null if there is no mapped user.

getProviderSubscription

public ProviderSubscription getProviderSubscription()
Gets subscription information related to this user/request Note, the subscription information is specific to the ProviderInstance the current request was received for.

Specified by:
getProviderSubscription in class ProviderUser
Returns:
ProviderSubscription object representing the subscription info or null if there is no subscription info.

getPortalRealm

public PortalRealm getPortalRealm()
Get the portal user' realm. This method returns the Provider framework specific PortalRealm implementation.

Specified by:
getPortalRealm in class ProviderUser

getLoginTime

public java.util.Calendar getLoginTime()
Gets the time when this user logged into the Portal.

Specified by:
getLoginTime in class ProviderUser
Returns:
the login time.

getLocation

public UserLocation getLocation()
Gets the user's location. Value is allowed to be null, which means the information is not available.

Specified by:
getLocation in class ProviderUser
Returns:
a UserLocation object representing the user's location.

getPortalSessionId

public java.lang.String getPortalSessionId()
Gets 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.

Specified by:
getPortalSessionId in class ProviderUser
Returns:
the Portal session ID for this user.

getAuthenticationLevel

public int getAuthenticationLevel()
Gets the authentication level for the user.

Specified by:
getAuthenticationLevel in class ProviderUser
Returns:
the authentication level.

getSession

public ProviderSession getSession(boolean create)
Description copied from class: ProviderUser
Used to create and/or reacquire the user session. If running as a Servlet and sessions are maintained via cookies then the sessions must only be created in Provider.initSession().

Note: this method can throw an llegalStateException. This occurs if the user object has become stale. I.e. no longer contains the state that it needs to acquire/create the session.

As all Provider/Portlet APIs give you access to the User object per request you should not (need to) retain the user object via reference in cross-request object (like the session itself). This only leads to possibilities of memory leaks.

Specified by:
getSession in class ProviderUser
Parameters:
create - if true then a session is created for the user if it doesn't currently exist.
Returns:
the session object for this user. null if create is false and the session doesn't already exist.

getSession

public ProviderSession getSession()
Description copied from class: ProviderUser
Used to create and/or reacquire the user session. Always creates a session if it doesn't currently exist. The same as calling getSession(true).

If running as a Servlet and sessions are maintained via cookies then the sessions must only be created in Provider.initSession().

Note: this method can throw an llegalStateException. This occurs if the user object has become stale. I.e. no longer contains the state that it needs to acquire/create the session.

As all Provider/Portlet APIs give you access to the User object per request you should not (need to) retain the user object via reference in cross-request object (like the session itself). This only leads to possibilities of memory leaks.

Specified by:
getSession in class ProviderUser
Returns:
the session object for this user.

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.

getUserDN

public java.lang.String getUserDN()
Get the portal user's distinguished name. This method returns the users distinguished name as stored in OID.

Specified by:
getUserDN in class ProviderUser
Returns:
the portal user's distinguished name.

getSubscriberName

public java.lang.String getSubscriberName()
Get the portal user's subscriber name. This method returns the user's subscriber name as stored in OID

Specified by:
getSubscriberName in class ProviderUser
Returns:
the portal user's subscriber name.

getSubscriberDN

public java.lang.String getSubscriberDN()
Get the portal user's Subscription distinguished name. This method returns the user's subscriber distinguished name as stored in OID.

Specified by:
getSubscriberDN in class ProviderUser
Returns:
the portal user's subscriber distinguished name.

getUserGUID

public java.lang.String getUserGUID()
Get the portal user's GUID. This method returns the user's GUID as stored in OID.

Specified by:
getUserGUID in class ProviderUser
Returns:
the portal user's GUID.

getSubscriberGUID

public java.lang.String getSubscriberGUID()
Get the portal user's subscriber GUID. This method returns the user's Subscriber GUID as stored in OID.

Specified by:
getSubscriberGUID in class ProviderUser
Returns:
the portal user's subscriber GUID.

getFirstName

public java.lang.String getFirstName()
Get the portal user's first name. This method returns the user's first name as stored in OID.

Specified by:
getFirstName in class ProviderUser
Returns:
the portal user's first name.

getLastName

public java.lang.String getLastName()
Get the portal user's last name. This method returns the user's last name as stored in OID.

Specified by:
getLastName in class ProviderUser
Returns:
the portal user's last name.

getEmail

public java.lang.String getEmail()
Get the portal user's email address. This method returns the user's email address as stored in OID.

Specified by:
getEmail in class ProviderUser
Returns:
the portal user's email address.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String propertyName)
Get a named property value of the user as stored in OID. Any property associated with the user can be queried that is stored in the OID user repository. Use the Oracle Directory Manager tool to find out all the properties available. Some of the commonly used property names are defined in OidManager class

Specified by:
getPropertyValue in class ProviderUser
Parameters:
propertyName - of a user property
Returns:
the portal user's named property.

isUserInGroup

public boolean isUserInGroup(java.lang.String groupName)
check if this user is a member of a group. The users, groups and group membership are stored in OID

Specified by:
isUserInGroup in class ProviderUser
Parameters:
groupName - the name of the group
Returns:
the whether or not this user is a member of the named group

isLDAPEnabled

public boolean isLDAPEnabled()
Determine if the OidManager is configured. This is needed because the methods return null if there is no Oid Manager or there is no data this method enables the caller to determine the reason why null was returned

Specified by:
isLDAPEnabled in class ProviderUser
Returns:
whether the oid manager is configured.

getFullName

public java.lang.String getFullName()
Get the users full name. Get the users full name eg First name, Last name

Returns:
the users full name

getDisplayName

public java.lang.String getDisplayName()
Get the users display name.

Returns:
the users display name

getDescription

public java.lang.String getDescription()
Get the users description

Returns:
the users description

isDeactivated

public boolean isDeactivated()
Returns if the user is deactivated This method is not actually implemented.

Returns:
true if the user is deactivated.

setDeactivated

public void setDeactivated(boolean deactivate)
Sets the user to be deactivated This method is not actually implemented.


Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.