public class FilterUserDirectoryProvider extends Object implements UserDirectoryProvider, ExternalUserSearchUDP, UsersShareEmailUDP, AuthenticationIdUDP, DisplayAdvisorUDP
Filter User Directory Provider, calls a configure provider, and if that fails calls the next provider in the chain. It does this for all methods. If the response is a boolean, then true stop processing, false continues processon. It is the reponsibility of the injected user directory provider to ignore those calls that have nothing to do with it, either by reference to the session, or by refernce to something in the environment or request. To Use, add one or more of these beans to Spring, in a chain, marking the first one in the chain as the 'official' userdirectory provider used by Sakai. Construct the chain by setting the next FilterUserDirectorProvider to the nextProvider and the real User Directory Provider to myProvider eg
<bean
id="org.sakaiproject.user.api.UserDirectoryProvider"
class="org.sakaiproject.provider.user.FilterUserDirectoryProvider"
init-method="init" destroy-method="destroy" singleton="true">
<property name="myProvider">
<ref bean="org.sakaiproject.user.api.UserDirectoryProvider.provider1" />
</property>
<property name="nextProvider">
<ref bean="org.sakaiproject.user.api.UserDirectoryProvider.chain1" />
</property>
</bean>
<bean
id="org.sakaiproject.user.api.UserDirectoryProvider.chain1"
class="org.sakaiproject.provider.user.FilterUserDirectoryProvider"
init-method="init" destroy-method="destroy" singleton="true">
<property name="myProvider">
<ref bean="org.sakaiproject.user.api.UserDirectoryProvider.provider2" />
</property>
</bean>
| Constructor and Description |
|---|
FilterUserDirectoryProvider()
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateUser(String userId,
UserEdit edit,
String password)
Authenticate a user / password.
|
boolean |
authenticateWithProviderFirst(String id) |
void |
destroy()
Returns to uninitialized state.
|
boolean |
findUserByEmail(UserEdit edit,
String email)
Find a user object who has this email address.
|
Collection |
findUsersByEmail(String email,
UserFactory factory)
Find all user objects which have this email address.
|
String |
getDisplayId(User user) |
String |
getDisplayName(User user) |
UserDirectoryProvider |
getMyProvider()
The UserDirectoryProvider used by this filter
|
UserDirectoryProvider |
getNextProvider()
The Next Directory Provider in the chain
|
boolean |
getUser(UserEdit edit)
Access a user object.
|
boolean |
getUserbyAid(String aid,
UserEdit user) |
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.
|
List<UserEdit> |
searchExternalUsers(String criteria,
int first,
int last,
UserFactory factory) |
void |
setMyProvider(UserDirectoryProvider myProvider)
The UserDirectoryProvider used by this filter
|
void |
setNextProvider(UserDirectoryProvider nextDirectoryProvider)
The Next Directory Provider in the chain
|
public void init()
public void destroy()
public boolean getUser(UserEdit edit)
getUser in interface UserDirectoryProvideredit - The user object (id is set) to fill in.public void getUsers(Collection users)
getUsers in interface UserDirectoryProviderusers - The UserEdit objects (with id set) to fill in or remove.public boolean findUserByEmail(UserEdit edit, String email)
findUserByEmail in interface UserDirectoryProvideremail - The email address string.public Collection findUsersByEmail(String email, UserFactory factory)
findUsersByEmail in interface UsersShareEmailUDPemail - The email address string.factory - Use this factory's newUser() method to create all the UserEdit objects you populate and return in the return collection.public boolean authenticateUser(String userId, UserEdit edit, String password)
authenticateUser in interface UserDirectoryProviderid - The user id.edit - The UserEdit matching the id to be authenticated (and updated) if we have one.password - The password.public UserDirectoryProvider getMyProvider()
public void setMyProvider(UserDirectoryProvider myProvider)
myProvider - public UserDirectoryProvider getNextProvider()
public void setNextProvider(UserDirectoryProvider nextDirectoryProvider)
nextDirectoryProvider - public boolean authenticateWithProviderFirst(String id)
authenticateWithProviderFirst in interface UserDirectoryProviderpublic List<UserEdit> searchExternalUsers(String criteria, int first, int last, UserFactory factory)
searchExternalUsers in interface ExternalUserSearchUDPpublic boolean getUserbyAid(String aid, UserEdit user)
getUserbyAid in interface AuthenticationIdUDPpublic String getDisplayId(User user)
getDisplayId in interface DisplayAdvisorUDPpublic String getDisplayName(User user)
getDisplayName in interface DisplayAdvisorUDPCopyright © 2003–2020 Sakai Project. All rights reserved.