Class BrightspaceUserProviderInstance
java.lang.Object
org.opencastproject.userdirectory.brightspace.BrightspaceUserProviderInstance
- All Implemented Interfaces:
CachingUserProviderMXBean,RoleProvider,UserProvider
public class BrightspaceUserProviderInstance
extends Object
implements UserProvider, RoleProvider, CachingUserProviderMXBean
-
Field Summary
Fields inherited from interface org.opencastproject.security.api.UserProvider
ALL_ORGANIZATIONS -
Constructor Summary
ConstructorsConstructorDescriptionBrightspaceUserProviderInstance(String pid, BrightspaceClient client, Organization organization, int cacheSize, int cacheExpiration, Set instructorRoles, Set ignoredUsernames) Constructs a Brighspace user provider with the needed settings -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of users in the providerfindRoles(String query, Role.Target target, int offset, int limit) Return the found roles as an iterator.Return the found user's as an iterator.floatGets the ratio of cache hits to total requests.getName()Gets the provider nameReturns the identifier for the organization that is associated with this user provider.getRolesForUser(String username) Returns the roles for this user or an empty array if no roles are applicable.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.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
-
Constructor Details
-
BrightspaceUserProviderInstance
public BrightspaceUserProviderInstance(String pid, BrightspaceClient client, Organization organization, int cacheSize, int cacheExpiration, Set instructorRoles, Set ignoredUsernames) Constructs a Brighspace user provider with the needed settings- Parameters:
pid- The PID of this service.client- The Brightspace rest service client.organization- The organisation.cacheSize- The number of users to cache.cacheExpiration- The number of minutes to cache users.
-
-
Method Details
-
getCacheHitRatio
public float getCacheHitRatio()Description copied from interface:CachingUserProviderMXBeanGets the ratio of cache hits to total requests.- Specified by:
getCacheHitRatioin interfaceCachingUserProviderMXBean- Returns:
- the hit ratio
-
getName
Gets the provider name- Specified by:
getNamein interfaceUserProvider- Returns:
- the provider name
- See Also:
-
getUsers
Gets all known users.- Specified by:
getUsersin interfaceUserProvider- Returns:
- the users
- See Also:
-
loadUser
Loads a user by username, or returns null if this user is not known to this provider.- Specified by:
loadUserin interfaceUserProvider- Parameters:
userName- the username- Returns:
- the user
- See Also:
-
countUsers
public long countUsers()Returns the number of users in the provider- Specified by:
countUsersin interfaceUserProvider- Returns:
- the count of users in the provider
- See Also:
-
getOrganization
Returns the identifier for the organization that is associated with this user provider. If equal toUserProvider.ALL_ORGANIZATIONS, this provider will always be consulted, regardless of the organization.- Specified by:
getOrganizationin interfaceRoleProvider- Specified by:
getOrganizationin interfaceUserProvider- Returns:
- the defining organization
- See Also:
-
findUsers
Return the found user's as an iterator.- Specified by:
findUsersin interfaceUserProvider- 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
- See Also:
-
invalidate
Description copied from interface:UserProviderDiscards any cached value for given user name.- Specified by:
invalidatein interfaceUserProvider- Parameters:
userName- the user name
-
getRolesForUser
Description copied from interface:RoleProviderReturns the roles for this user or an empty array if no roles are applicable.- Specified by:
getRolesForUserin interfaceRoleProvider- Parameters:
username- the user id- Returns:
- the set of roles
-
findRoles
Description copied from interface:RoleProviderReturn the found roles as an iterator.- Specified by:
findRolesin interfaceRoleProvider- 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 role's
-