Class MoodleUserProviderInstance
java.lang.Object
org.opencastproject.userdirectory.moodle.MoodleUserProviderInstance
- All Implemented Interfaces:
org.opencastproject.security.api.CachingUserProviderMXBean,org.opencastproject.security.api.RoleProvider,org.opencastproject.security.api.UserProvider
public class MoodleUserProviderInstance
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 Moodle.
-
Field Summary
Fields inherited from interface org.opencastproject.security.api.UserProvider
ALL_ORGANIZATIONS -
Constructor Summary
ConstructorsConstructorDescriptionMoodleUserProviderInstance(String pid, MoodleWebService client, org.opencastproject.security.api.Organization organization, String coursePattern, String userPattern, String groupPattern, boolean groupRoles, int cacheSize, int cacheExpiration, String adminUserName, boolean lowercaseUsername, String contextRolePrefix) Constructs an Moodle 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.UserMethods 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
-
Constructor Details
-
MoodleUserProviderInstance
public MoodleUserProviderInstance(String pid, MoodleWebService client, org.opencastproject.security.api.Organization organization, String coursePattern, String userPattern, String groupPattern, boolean groupRoles, int cacheSize, int cacheExpiration, String adminUserName, boolean lowercaseUsername, String contextRolePrefix) Constructs an Moodle user provider with the needed settings.- Parameters:
pid- The pid of this service.client- The Moodle web service client.organization- The organization.coursePattern- The pattern of a Moodle course ID.userPattern- The pattern of a Moodle user ID.groupPattern- The pattern of a Moodle group ID.groupRoles- Whether to activate groupRolescacheSize- The number of users to cache.cacheExpiration- The number of minutes to cache users.adminUserName- Name of the global admin user.contextRolePrefix- Prefix to prepend to context roles like 1234_Learner
-
-
Method Details
-
getCacheHitRatio
public float getCacheHitRatio()- Specified by:
getCacheHitRatioin interfaceorg.opencastproject.security.api.CachingUserProviderMXBean- See Also:
-
getName
- Specified by:
getNamein interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
getUsers
- Specified by:
getUsersin interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
loadUser
- Specified by:
loadUserin interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
countUsers
public long countUsers()- Specified by:
countUsersin interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
getOrganization
- Specified by:
getOrganizationin interfaceorg.opencastproject.security.api.RoleProvider- Specified by:
getOrganizationin interfaceorg.opencastproject.security.api.UserProvider- 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- See Also:
-
invalidate
- Specified by:
invalidatein interfaceorg.opencastproject.security.api.UserProvider- See Also:
-
getRolesForUser
- Specified by:
getRolesForUserin interfaceorg.opencastproject.security.api.RoleProvider- See Also:
-
findRoles
public Iterator<org.opencastproject.security.api.Role> findRoles(String query, org.opencastproject.security.api.Role.Target target, int offset, int limit) We search for COURSEID, COURSEID_Learner, COURSEID_Instructor
- Specified by:
findRolesin interfaceorg.opencastproject.security.api.RoleProvider
-