org.jasig.portal
Class RDBMUserIdentityStore

java.lang.Object
  extended by org.jasig.portal.RDBMUserIdentityStore
All Implemented Interfaces:
IUserIdentityStore

public class RDBMUserIdentityStore
extends Object
implements IUserIdentityStore

SQL implementation for managing creation and removal of User Portal Data

Version:
$Revision: 20478 $
Author:
Susan Bramhall, Yale University (modify by Julien Marchal, University Nancy 2; Eric Dalquist - edalquist@unicon.net)

Nested Class Summary
protected  class RDBMUserIdentityStore.PortalUser
           
protected  class RDBMUserIdentityStore.TemplateUser
           
 
Constructor Summary
RDBMUserIdentityStore()
           
 
Method Summary
protected  int addNewUser(int newUID, IPerson person, RDBMUserIdentityStore.TemplateUser templateUser)
           
protected static void commit(Connection connection)
           
protected  int getNewPortalUID(IPerson person)
           
 int getPortalUID(IPerson person)
          getuPortalUID - return a unique uPortal key for a user.
 int getPortalUID(IPerson person, boolean createPortalData)
          Get the portal user ID for this person object.
protected  RDBMUserIdentityStore.PortalUser getPortalUser(String userName)
          Gets the PortalUser data store object for the specified user name.
 String getPortalUserName(int uPortalUID)
          Gets a portal user name that is associated with the specified portal ID.
protected  String getTemplateName(IPerson person)
           
protected  RDBMUserIdentityStore.TemplateUser getTemplateUser(String templateUserName)
          Gets the TemplateUser data store object for the specified template user name.
 String getUsername(IPerson person)
          Return the username to be used for authorization (exit hook)
 void removePortalUID(int uPortalUID)
          removeuPortalUID
protected static void rollback(Connection connection)
           
protected  void updateUser(int userId, IPerson person, RDBMUserIdentityStore.TemplateUser templateUser)
           
protected  boolean userHasSavedLayout(int userId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBMUserIdentityStore

public RDBMUserIdentityStore()
Method Detail

getPortalUID

public int getPortalUID(IPerson person)
                 throws Exception
getuPortalUID - return a unique uPortal key for a user. calls alternate signature with createPortalData set to false.

Specified by:
getPortalUID in interface IUserIdentityStore
Parameters:
person - the person object
Returns:
uPortalUID number
Throws:
Exception - if no user is found.

removePortalUID

public void removePortalUID(int uPortalUID)
                     throws Exception
removeuPortalUID

Specified by:
removePortalUID in interface IUserIdentityStore
Parameters:
uPortalUID - integer key to uPortal data for a user
Throws:
SQLException - exception if a sql error is encountered
Exception

getUsername

public String getUsername(IPerson person)
Return the username to be used for authorization (exit hook)

Specified by:
getUsername in interface IUserIdentityStore
Parameters:
person -
Returns:
usernmae

getPortalUID

public int getPortalUID(IPerson person,
                        boolean createPortalData)
                 throws AuthorizationException
Get the portal user ID for this person object.

Specified by:
getPortalUID in interface IUserIdentityStore
Parameters:
person -
createPortalData - indicating whether to try to create all uPortal data for this user from template prototype
Returns:
uPortalUID number or -1 if unable to create user.
Throws:
AuthorizationException - if createPortalData is false and no user is found or if a sql error is encountered

getPortalUserName

public String getPortalUserName(int uPortalUID)
Description copied from interface: IUserIdentityStore
Gets a portal user name that is associated with the specified portal ID.

Specified by:
getPortalUserName in interface IUserIdentityStore
Parameters:
uPortalUID - The portal ID to find a user name for.
Returns:
The user name associated with the specified portal id, null if one isn't found.

getNewPortalUID

protected int getNewPortalUID(IPerson person)
                       throws Exception
Throws:
Exception

commit

protected static final void commit(Connection connection)

rollback

protected static final void rollback(Connection connection)

getPortalUser

protected RDBMUserIdentityStore.PortalUser getPortalUser(String userName)
                                                  throws Exception
Gets the PortalUser data store object for the specified user name.

Parameters:
userName - The user's name
Returns:
A PortalUser object or null if the user doesn't exist.
Throws:
Exception

getTemplateName

protected String getTemplateName(IPerson person)

getTemplateUser

protected RDBMUserIdentityStore.TemplateUser getTemplateUser(String templateUserName)
                                                      throws Exception
Gets the TemplateUser data store object for the specified template user name.

Parameters:
templateUserName - The template user's name
Returns:
A TemplateUser object or null if the user doesn't exist.
Throws:
Exception

userHasSavedLayout

protected boolean userHasSavedLayout(int userId)
                              throws Exception
Throws:
Exception

updateUser

protected void updateUser(int userId,
                          IPerson person,
                          RDBMUserIdentityStore.TemplateUser templateUser)
                   throws Exception
Throws:
Exception

addNewUser

protected int addNewUser(int newUID,
                         IPerson person,
                         RDBMUserIdentityStore.TemplateUser templateUser)
                  throws Exception
Throws:
Exception


Copyright © 2010 Jasig. All Rights Reserved.