org.pentaho.platform.plugin.services.security.userrole.memory
Class InMemoryUserRoleListService

java.lang.Object
  extended by org.pentaho.platform.plugin.services.security.userrole.memory.InMemoryUserRoleListService
All Implemented Interfaces:
IUserRoleListService, org.springframework.beans.factory.InitializingBean

public class InMemoryUserRoleListService
extends Object
implements IUserRoleListService, org.springframework.beans.factory.InitializingBean

An in-memory implementation of UserRoleListService.

Author:
mlowery

Constructor Summary
InMemoryUserRoleListService()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.springframework.security.GrantedAuthority[] getAllAuthorities()
          Returns all authorities known to the provider.
 String[] getAllUsernames()
          Returns all user names known to the provider.
 org.springframework.security.GrantedAuthority[] getAuthoritiesForUser(String username)
          Returns all authorities granted for a specified user.
 org.springframework.security.userdetails.UserDetailsService getUserDetailsService()
           
 String[] getUsernamesInRole(org.springframework.security.GrantedAuthority authority)
          Returns all known users in the specified role.
 UserRoleListEnhancedUserMap getUserRoleListEnhancedUserMap()
           
 void setAllAuthorities(org.springframework.security.GrantedAuthority[] allAuthorities)
           
 void setGrantedAuthorityComparator(Comparator<org.springframework.security.GrantedAuthority> grantedAuthorityComparator)
           
 void setUserDetailsService(org.springframework.security.userdetails.UserDetailsService userDetailsService)
           
 void setUsernameComparator(Comparator<String> usernameComparator)
           
 void setUserRoleListEnhancedUserMap(UserRoleListEnhancedUserMap userRoleListEnhancedUserMap)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryUserRoleListService

public InMemoryUserRoleListService()
Method Detail

getAllAuthorities

public org.springframework.security.GrantedAuthority[] getAllAuthorities()
Description copied from interface: IUserRoleListService
Returns all authorities known to the provider. Cannot return null

Specified by:
getAllAuthorities in interface IUserRoleListService
Returns:
the authorities (never null)

getAllUsernames

public String[] getAllUsernames()
Description copied from interface: IUserRoleListService
Returns all user names known to the provider. Cannot return null

Specified by:
getAllUsernames in interface IUserRoleListService
Returns:
the users (never null)

getUsernamesInRole

public String[] getUsernamesInRole(org.springframework.security.GrantedAuthority authority)
Description copied from interface: IUserRoleListService
Returns all known users in the specified role. Cannot return null

Specified by:
getUsernamesInRole in interface IUserRoleListService
Parameters:
authority - The authority to look users up by. Cannot be null
Returns:
the users. (never null)

setAllAuthorities

public void setAllAuthorities(org.springframework.security.GrantedAuthority[] allAuthorities)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

getAuthoritiesForUser

public org.springframework.security.GrantedAuthority[] getAuthoritiesForUser(String username)
                                                                      throws org.springframework.security.userdetails.UsernameNotFoundException
Description copied from interface: IUserRoleListService
Returns all authorities granted for a specified user.

Specified by:
getAuthoritiesForUser in interface IUserRoleListService
Parameters:
username - The name of the user to look up authorities for
Returns:
the authorities. (Never null)
Throws:
org.springframework.security.userdetails.UsernameNotFoundException

setUserRoleListEnhancedUserMap

public void setUserRoleListEnhancedUserMap(UserRoleListEnhancedUserMap userRoleListEnhancedUserMap)

getUserDetailsService

public org.springframework.security.userdetails.UserDetailsService getUserDetailsService()

setUserDetailsService

public void setUserDetailsService(org.springframework.security.userdetails.UserDetailsService userDetailsService)

getUserRoleListEnhancedUserMap

public UserRoleListEnhancedUserMap getUserRoleListEnhancedUserMap()

setGrantedAuthorityComparator

public void setGrantedAuthorityComparator(Comparator<org.springframework.security.GrantedAuthority> grantedAuthorityComparator)

setUsernameComparator

public void setUsernameComparator(Comparator<String> usernameComparator)