org.sakaiproject.component.imsent.user
Class IMSEntUserDirectoryProvider

java.lang.Object
  extended byorg.sakaiproject.component.imsent.user.IMSEntUserDirectoryProvider
All Implemented Interfaces:
UserDirectoryProvider

public class IMSEntUserDirectoryProvider
extends Object
implements UserDirectoryProvider

IMSEntUserDirectoryProvider is a sample UserDirectoryProvider.

Version:
$Revision: 3197 $
Author:
University of Michigan, Sakai Software Development Team

Nested Class Summary
 class IMSEntUserDirectoryProvider.SakaiIMSUser
          UserDirectoryProvider implementation
 
Field Summary
protected  boolean m_autoDdl
          Configuration: to run the ddl on init or not.
protected  SqlService m_sqlService
          Dependency: SqlService
 
Constructor Summary
IMSEntUserDirectoryProvider()
          Construct.
 
Method Summary
 boolean authenticateUser(String userId, UserEdit edit, String password)
          Authenticate a user / password.
 boolean authenticateWithProviderFirst(String id)
          Whether to check provider or internal data first when authenticating a user
 boolean createUserRecord(String id)
          If user record cannot be found in by UserDirectoryService, can the service create the user record?
 void destroy()
          Returns to uninitialized state.
 void destroyAuthentication()
          Remove any authentication traces for the current user / request
 boolean findUserByEmail(UserEdit edit, String email)
          Find a user object who has this email address.
 boolean getUser(UserEdit edit)
          Access a user object.
 void getUsers(Collection users)
          Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
 void init()
          Final initialization, once all dependencies are set.
 IMSEntUserDirectoryProvider.SakaiIMSUser retrieveUser(String userId, boolean isEmail)
           
 void setAutoDdl(String value)
          Configuration: to run the ddl on init or not.
 void setSqlService(SqlService service)
          Dependency: SqlService.
 boolean updateUserAfterAuthentication()
          Will this provider update user records on successfull authentication?
 boolean userExists(String userId)
          See if a user by this id exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_sqlService

protected SqlService m_sqlService
Dependency: SqlService


m_autoDdl

protected boolean m_autoDdl
Configuration: to run the ddl on init or not.

Constructor Detail

IMSEntUserDirectoryProvider

public IMSEntUserDirectoryProvider()
Construct.

Method Detail

setSqlService

public void setSqlService(SqlService service)
Dependency: SqlService.

Parameters:
service - The SqlService.

setAutoDdl

public void setAutoDdl(String value)
Configuration: to run the ddl on init or not.

Parameters:
value - the auto ddl value.

init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Returns to uninitialized state. You can use this method to release resources thet your Service allocated when Turbine shuts down.


retrieveUser

public IMSEntUserDirectoryProvider.SakaiIMSUser retrieveUser(String userId,
                                                             boolean isEmail)

userExists

public boolean userExists(String userId)
See if a user by this id exists.

Specified by:
userExists in interface UserDirectoryProvider
Parameters:
userId - The user id string.
Returns:
true if a user by this id exists, false if not.

getUser

public boolean getUser(UserEdit edit)
Access a user object. Update the object with the information found.

Specified by:
getUser in interface UserDirectoryProvider
Parameters:
edit - The user object (id is set) to fill in.
Returns:
true if the user object was found and information updated, false if not.

getUsers

public void getUsers(Collection users)
Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.

Specified by:
getUsers in interface UserDirectoryProvider
Parameters:
users - The UserEdit objects (with id set) to fill in or remove.

findUserByEmail

public boolean findUserByEmail(UserEdit edit,
                               String email)
Find a user object who has this email address. Update the object with the information found.

Specified by:
findUserByEmail in interface UserDirectoryProvider
Parameters:
email - The email address string.
Returns:
true if the user object was found and information updated, false if not.

authenticateUser

public boolean authenticateUser(String userId,
                                UserEdit edit,
                                String password)
Authenticate a user / password. If the user edit exists it may be modified, and will be stored if...

Specified by:
authenticateUser in interface UserDirectoryProvider
Parameters:
edit - The UserEdit matching the id to be authenticated (and updated) if we have one.
password - The password.
userId - The user id.
Returns:
true if authenticated, false if not.

updateUserAfterAuthentication

public boolean updateUserAfterAuthentication()
Will this provider update user records on successfull authentication? If so, the UserDirectoryService will cause these updates to be stored.

Specified by:
updateUserAfterAuthentication in interface UserDirectoryProvider
Returns:
true if the user record may be updated after successfull authentication, false if not.

destroyAuthentication

public void destroyAuthentication()
Remove any authentication traces for the current user / request

Specified by:
destroyAuthentication in interface UserDirectoryProvider

authenticateWithProviderFirst

public boolean authenticateWithProviderFirst(String id)
Whether to check provider or internal data first when authenticating a user

Specified by:
authenticateWithProviderFirst in interface UserDirectoryProvider
Returns:
true if provider data is checked first, false if otherwise

createUserRecord

public boolean createUserRecord(String id)
If user record cannot be found in by UserDirectoryService, can the service create the user record?

Specified by:
createUserRecord in interface UserDirectoryProvider