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 Details

  • 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 service
      organization - the organization
      url - the url of the Sakai server
      userName - the user to authenticate as
      password - the user credentials
      cacheSize - the number of users to cache
      cacheExpiration - the number of minutes to cache users
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.opencastproject.security.api.UserProvider
    • registerMBean

      protected void registerMBean(String pid)
      Registers an MXBean.
    • getOrganization

      public String getOrganization()
      Specified by:
      getOrganization in interface org.opencastproject.security.api.RoleProvider
      Specified by:
      getOrganization in interface org.opencastproject.security.api.UserProvider
      See Also:
      • UserProvider.getOrganization()
    • loadUser

      public org.opencastproject.security.api.User loadUser(String userName)
      Specified by:
      loadUser in interface org.opencastproject.security.api.UserProvider
      See Also:
      • UserProvider.loadUser(java.lang.String)
    • loadUserFromSakai

      protected org.opencastproject.security.api.User loadUserFromSakai(String userName)
      Loads a user from Sakai.
      Parameters:
      userName - the username
      Returns:
      the user
    • getCacheHitRatio

      public float getCacheHitRatio()
      Specified by:
      getCacheHitRatio in interface org.opencastproject.security.api.CachingUserProviderMXBean
      See Also:
      • CachingUserProviderMXBean.getCacheHitRatio()
    • findUsers

      public Iterator<org.opencastproject.security.api.User> findUsers(String query, int offset, int limit)
      Specified by:
      findUsers in interface org.opencastproject.security.api.UserProvider
    • getUsers

      public Iterator<org.opencastproject.security.api.User> getUsers()
      Specified by:
      getUsers in interface org.opencastproject.security.api.UserProvider
    • invalidate

      public void invalidate(String userName)
      Specified by:
      invalidate in interface org.opencastproject.security.api.UserProvider
    • countUsers

      public long countUsers()
      Specified by:
      countUsers in interface org.opencastproject.security.api.UserProvider
    • getRolesForUser

      public List<org.opencastproject.security.api.Role> getRolesForUser(String userName)
      Specified by:
      getRolesForUser in interface org.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:
      findRoles in interface org.opencastproject.security.api.RoleProvider