Class UserAndRoleDirectoryServiceImpl
java.lang.Object
org.opencastproject.userdirectory.UserAndRoleDirectoryServiceImpl
- All Implemented Interfaces:
org.opencastproject.security.api.RoleDirectoryService,org.opencastproject.security.api.UserDirectoryService,org.springframework.security.core.userdetails.UserDetailsService
public class UserAndRoleDirectoryServiceImpl
extends Object
implements org.opencastproject.security.api.UserDirectoryService, org.springframework.security.core.userdetails.UserDetailsService, org.opencastproject.security.api.RoleDirectoryService
Federates user and role providers, and exposes a spring UserDetailsService so user lookups can be used by spring
security.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.opencastproject.security.api.RoleProvider> The list of role providersprotected org.opencastproject.security.api.SecurityServiceThe security servicestatic final StringThe configuration property for the user cache expiry timestatic final StringThe configuration property for the user cache sizeprotected List<org.opencastproject.security.api.UserProvider> The list of user providers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate(org.osgi.service.component.ComponentContext cc) Callback to activate the component.protected voidaddRoleProvider(org.opencastproject.security.api.RoleProvider roleProvider) Adds a role provider.protected voidaddUserProvider(org.opencastproject.security.api.UserProvider userProvider) Adds a user provider.longList<org.opencastproject.security.api.Role> Iterator<org.opencastproject.security.api.User> List<org.opencastproject.security.api.User> getUsers()voidinvalidate(String userName) org.opencastproject.security.api.Userorg.springframework.security.core.userdetails.UserDetailsloadUserByUsername(String userName) Iterator<org.opencastproject.security.api.User> loadUsers(Collection<String> userNames) protected voidremoveRoleProvider(org.opencastproject.security.api.RoleProvider roleProvider) Remove a role provider.protected voidremoveUserProvider(org.opencastproject.security.api.UserProvider userProvider) Remove a user provider.voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) Sets the security service
-
Field Details
-
USER_CACHE_SIZE_KEY
The configuration property for the user cache size- See Also:
-
USER_CACHE_EXPIRY_KEY
The configuration property for the user cache expiry time- See Also:
-
userProviders
The list of user providers -
roleProviders
The list of role providers -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service
-
-
Constructor Details
-
UserAndRoleDirectoryServiceImpl
public UserAndRoleDirectoryServiceImpl()
-
-
Method Details
-
activate
protected void activate(org.osgi.service.component.ComponentContext cc) Callback to activate the component.- Parameters:
cc- the declarative services component context
-
addUserProvider
protected void addUserProvider(org.opencastproject.security.api.UserProvider userProvider) Adds a user provider.- Parameters:
userProvider- the user provider to add
-
removeUserProvider
protected void removeUserProvider(org.opencastproject.security.api.UserProvider userProvider) Remove a user provider.- Parameters:
userProvider- the user provider to remove
-
addRoleProvider
protected void addRoleProvider(org.opencastproject.security.api.RoleProvider roleProvider) Adds a role provider.- Parameters:
roleProvider- the role provider to add
-
removeRoleProvider
protected void removeRoleProvider(org.opencastproject.security.api.RoleProvider roleProvider) Remove a role provider.- Parameters:
roleProvider- the role provider to remove
-
getUsers
- Specified by:
getUsersin interfaceorg.opencastproject.security.api.UserDirectoryService- See Also:
-
loadUser
- Specified by:
loadUserin interfaceorg.opencastproject.security.api.UserDirectoryService- Throws:
IllegalStateException- See Also:
-
loadUsers
- Specified by:
loadUsersin interfaceorg.opencastproject.security.api.UserDirectoryService
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String userName) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Specified by:
loadUserByUsernamein interfaceorg.springframework.security.core.userdetails.UserDetailsService- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException- See Also:
-
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) Sets the security service- Parameters:
securityService- the securityService to set
-
findUsers
public Iterator<org.opencastproject.security.api.User> findUsers(String query, int offset, int limit) - Specified by:
findUsersin interfaceorg.opencastproject.security.api.UserDirectoryService
-
findRoles
public List<org.opencastproject.security.api.Role> findRoles(String query, org.opencastproject.security.api.Role.Target target, int offset, int limit) - Specified by:
findRolesin interfaceorg.opencastproject.security.api.RoleDirectoryService
-
countUsers
public long countUsers()- Specified by:
countUsersin interfaceorg.opencastproject.security.api.UserDirectoryService
-
invalidate
- Specified by:
invalidatein interfaceorg.opencastproject.security.api.UserDirectoryService
-