Class SakaiUserProviderInstance

java.lang.Object
org.opencastproject.userdirectory.sakai.SakaiUserProviderInstance
All Implemented Interfaces:
RoleProvider, UserProvider

public class SakaiUserProviderInstance extends Object implements UserProvider, RoleProvider
A UserProvider that reads user roles from Sakai.
  • Field Details

  • Constructor Details

    • SakaiUserProviderInstance

      public SakaiUserProviderInstance()
  • Method Details

    • setOrgDirectory

      public void setOrgDirectory(OrganizationDirectoryService orgDirectory)
      OSGi DI
    • updated

      public void updated(Map<String,Object> properties) throws org.osgi.service.cm.ConfigurationException
      Throws:
      org.osgi.service.cm.ConfigurationException
    • getName

      public String getName()
      Description copied from interface: UserProvider
      Gets the provider name
      Specified by:
      getName in interface UserProvider
      Returns:
      the provider name
    • getOrganization

      public String getOrganization()
      Returns the identifier for the organization that is associated with this user provider. If equal to UserProvider.ALL_ORGANIZATIONS, this provider will always be consulted, regardless of the organization.
      Specified by:
      getOrganization in interface RoleProvider
      Specified by:
      getOrganization in interface UserProvider
      Returns:
      the defining organization
      See Also:
    • loadUser

      public User loadUser(String userName)
      Loads a user by username, or returns null if this user is not known to this provider.
      Specified by:
      loadUser in interface UserProvider
      Parameters:
      userName - the username
      Returns:
      the user
      See Also:
    • loadUserFromSakai

      protected User loadUserFromSakai(String userName)
      Loads a user from Sakai.
      Parameters:
      userName - the username
      Returns:
      the user
    • findUsers

      public Iterator<User> findUsers(String query, int offset, int limit)
      Description copied from interface: UserProvider
      Return the found user's as an iterator.
      Specified by:
      findUsers in interface UserProvider
      Parameters:
      query - the query. Use the wildcards "_" to match any single character and "%" to match an arbitrary number of characters (including zero characters).
      offset - the offset
      limit - the limit. 0 means no limit
      Returns:
      an iterator of user's
    • getUsers

      public Iterator<User> getUsers()
      Description copied from interface: UserProvider
      Gets all known users.
      Specified by:
      getUsers in interface UserProvider
      Returns:
      the users
    • invalidate

      public void invalidate(String userName)
      Description copied from interface: UserProvider
      Discards any cached value for given user name.
      Specified by:
      invalidate in interface UserProvider
      Parameters:
      userName - the user name
    • countUsers

      public long countUsers()
      Description copied from interface: UserProvider
      Returns the number of users in the provider
      Specified by:
      countUsers in interface UserProvider
      Returns:
      the count of users in the provider
    • getRolesForUser

      public List<Role> getRolesForUser(String userName)
      Description copied from interface: RoleProvider
      Returns the roles for this user or an empty array if no roles are applicable.
      Specified by:
      getRolesForUser in interface RoleProvider
      Parameters:
      userName - the user id
      Returns:
      the set of roles
    • findRoles

      public Iterator<Role> findRoles(String query, Role.Target target, int offset, int limit)
      Description copied from interface: RoleProvider
      Return the found roles as an iterator.
      Specified by:
      findRoles in interface RoleProvider
      Parameters:
      query - the query. Use the wildcards "_" to match any single character and "%" to match an arbitrary number of characters (including zero characters).
      offset - the offset
      limit - the limit. 0 means no limit
      Returns:
      an iterator of role's