Class InMemoryUserAndRoleProvider
java.lang.Object
org.opencastproject.userdirectory.InMemoryUserAndRoleProvider
- All Implemented Interfaces:
RoleProvider,UserProvider,org.osgi.service.cm.ManagedService
public class InMemoryUserAndRoleProvider
extends Object
implements UserProvider, RoleProvider, org.osgi.service.cm.ManagedService
An in-memory user directory containing the users and roles used by the system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration key for optional additional roles for the capture agent userstatic final Stringstatic final Stringstatic final StringConfiguration key for the digest passwordstatic final StringConfiguration key for the digest usersstatic final StringThe digest usersstatic final Stringprotected SecurityServiceThe security serviceFields inherited from interface org.opencastproject.security.api.UserProvider
ALL_ORGANIZATIONS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate(org.osgi.service.component.ComponentContext cc) Callback to activate the component.longReturns 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.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.toString()voidupdated(Dictionary<String, ?> properties) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opencastproject.security.api.UserProvider
findUsers
-
Field Details
-
PROVIDER_NAME
- See Also:
-
DIGEST_USER_NAME
The digest users- See Also:
-
CAPTURE_AGENT_USER_NAME
- See Also:
-
DIGEST_USER_KEY
Configuration key for the digest users- See Also:
-
CAPTURE_AGENT_USER_PREFIX
- See Also:
-
DIGEST_PASSWORD_KEY
Configuration key for the digest password- See Also:
-
CAPTURE_AGENT_ROLES_PREFIX
Configuration key for optional additional roles for the capture agent user- See Also:
-
securityService
The security service
-
-
Constructor Details
-
InMemoryUserAndRoleProvider
public InMemoryUserAndRoleProvider()
-
-
Method Details
-
activate
protected void activate(org.osgi.service.component.ComponentContext cc) Callback to activate the component.- Parameters:
cc- the declarative services component context
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
getName
Description copied from interface:UserProviderGets the provider name- Specified by:
getNamein interfaceUserProvider- Returns:
- the provider name
-
getUsers
Description copied from interface:UserProviderGets all known users.- Specified by:
getUsersin interfaceUserProvider- Returns:
- the users
-
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:
-
toString
-
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:
-
getRolesForUser
Returns 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
- See Also:
-
findUsers
Description copied from interface:UserProviderReturn 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
-
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
-
countUsers
public long countUsers()Description copied from interface:UserProviderReturns the number of users in the provider- Specified by:
countUsersin interfaceUserProvider- Returns:
- the count of users in the provider
-
invalidate
Description copied from interface:UserProviderDiscards any cached value for given user name.- Specified by:
invalidatein interfaceUserProvider- Parameters:
userName- the user name
-