Class SakaiUserProviderInstance
java.lang.Object
org.opencastproject.userdirectory.sakai.SakaiUserProviderInstance
- All Implemented Interfaces:
org.opencastproject.security.api.CachingUserProviderMXBean,org.opencastproject.security.api.RoleProvider,org.opencastproject.security.api.UserProvider
public class SakaiUserProviderInstance
extends Object
implements org.opencastproject.security.api.UserProvider, org.opencastproject.security.api.RoleProvider, org.opencastproject.security.api.CachingUserProviderMXBean
A UserProvider that reads user roles from Sakai.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectA token to store in the miss cachestatic final StringFields inherited from interface org.opencastproject.security.api.UserProvider
ALL_ORGANIZATIONS -
Constructor Summary
ConstructorsConstructorDescriptionSakaiUserProviderInstance(String pid, org.opencastproject.security.api.Organization organization, String url, String userName, String password, String sitePattern, String userPattern, Set<String> instructorRoles, int cacheSize, int cacheExpiration) Constructs an Sakai user provider with the needed settings. -
Method Summary
Modifier and TypeMethodDescriptionlongIterator<org.opencastproject.security.api.Role> Iterator<org.opencastproject.security.api.User> floatgetName()List<org.opencastproject.security.api.Role> getRolesForUser(String userName) Iterator<org.opencastproject.security.api.User> getUsers()voidinvalidate(String userName) org.opencastproject.security.api.Userprotected org.opencastproject.security.api.UserloadUserFromSakai(String userName) Loads a user from Sakai.protected voidregisterMBean(String pid) Registers an MXBean.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencastproject.security.api.UserProvider
findUsers
-
Field Details
-
PROVIDER_NAME
- See Also:
-
nullToken
A token to store in the miss cache
-
-
Constructor Details
-
SakaiUserProviderInstance
public SakaiUserProviderInstance(String pid, org.opencastproject.security.api.Organization organization, String url, String userName, String password, String sitePattern, String userPattern, Set<String> instructorRoles, int cacheSize, int cacheExpiration) Constructs an Sakai user provider with the needed settings.- Parameters:
pid- the pid of this serviceorganization- the organizationurl- the url of the Sakai serveruserName- the user to authenticate aspassword- the user credentialscacheSize- the number of users to cachecacheExpiration- the number of minutes to cache users
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.opencastproject.security.api.UserProvider
-
registerMBean
Registers an MXBean. -
getOrganization
- Specified by:
getOrganizationin interfaceorg.opencastproject.security.api.RoleProvider- Specified by:
getOrganizationin interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
loadUser
- Specified by:
loadUserin interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
loadUserFromSakai
Loads a user from Sakai.- Parameters:
userName- the username- Returns:
- the user
-
getCacheHitRatio
public float getCacheHitRatio()- Specified by:
getCacheHitRatioin interfaceorg.opencastproject.security.api.CachingUserProviderMXBean- See Also:
-
findUsers
public Iterator<org.opencastproject.security.api.User> findUsers(String query, int offset, int limit) - Specified by:
findUsersin interfaceorg.opencastproject.security.api.UserProvider
-
getUsers
- Specified by:
getUsersin interfaceorg.opencastproject.security.api.UserProvider
-
invalidate
- Specified by:
invalidatein interfaceorg.opencastproject.security.api.UserProvider
-
countUsers
public long countUsers()- Specified by:
countUsersin interfaceorg.opencastproject.security.api.UserProvider
-
getRolesForUser
- Specified by:
getRolesForUserin interfaceorg.opencastproject.security.api.RoleProvider
-
findRoles
public Iterator<org.opencastproject.security.api.Role> findRoles(String query, org.opencastproject.security.api.Role.Target target, int offset, int limit) - Specified by:
findRolesin interfaceorg.opencastproject.security.api.RoleProvider
-