Package org.opencastproject.security.api
Interface UserProvider
- All Known Implementing Classes:
BrightspaceUserProviderInstance,CanvasUserRoleProvider,InMemoryUserAndRoleProvider,JpaUserAndRoleProvider,JpaUserReferenceProvider,LdapUserProviderInstance,MoodleUserProviderInstance,SakaiUserProviderInstance,StudipUserProviderInstance
public interface UserProvider
Provides access to users and roles.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe constant indicating that a provider should be consulted for all organizations -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of users in the providerReturn the found user's as an iterator.findUsers(Collection<String> userNames) Find a list of users by their user names Note that the default implementation of this might be slow, as it callsloadUseron every single user.getName()Gets the provider nameReturns the identifier for the organization that is associated with this user provider.getUsers()Gets all known users.voidinvalidate(String userName) Discards any cached value for given user name.Loads a user by username, or returns null if this user is not known to this provider.
-
Field Details
-
ALL_ORGANIZATIONS
The constant indicating that a provider should be consulted for all organizations- See Also:
-
-
Method Details
-
getName
String getName()Gets the provider name- Returns:
- the provider name
-
getUsers
Gets all known users.- Returns:
- the users
-
loadUser
Loads a user by username, or returns null if this user is not known to this provider.- Parameters:
userName- the username- Returns:
- the user
-
countUsers
long countUsers()Returns the number of users in the provider- Returns:
- the count of users in the provider
-
getOrganization
String getOrganization()Returns the identifier for the organization that is associated with this user provider. If equal toALL_ORGANIZATIONS, this provider will always be consulted, regardless of the organization.- Returns:
- the defining organization
-
findUsers
Return the found user's as an iterator.- 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 offsetlimit- the limit. 0 means no limit- Returns:
- an iterator of user's
- Throws:
IllegalArgumentException- if the query isnull
-
findUsers
Find a list of users by their user names Note that the default implementation of this might be slow, as it callsloadUseron every single user.- Parameters:
userNames- A list of user names- Returns:
- A list of resolved user objects
-
invalidate
Discards any cached value for given user name.- Parameters:
userName- the user name
-