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

public class InMemoryUserRoleListService
extends Object
implements IUserRoleListService

An in-memory implementation of UserRoleListService.

Author:
mlowery

Constructor Summary
InMemoryUserRoleListService()
           
 
Method Summary
 void afterPropertiesSet()
           
 GrantedAuthority[] getAllAuthorities()
          Returns all authorities known to the provider.
 String[] getAllUsernames()
          Returns all user names known to the provider.
 GrantedAuthority[] getAuthoritiesForUser(String username)
          Returns all authorities granted for a specified user.
 UserDetailsService getUserDetailsService()
           
 String[] getUsernamesInRole(GrantedAuthority authority)
          Returns all known users in the specified role.
 UserRoleListEnhancedUserMap getUserRoleListEnhancedUserMap()
           
 void setAllAuthorities(GrantedAuthority[] allAuthorities)
           
 void setGrantedAuthorityComparator(Comparator<GrantedAuthority> grantedAuthorityComparator)
           
 void setUserDetailsService(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 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(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(GrantedAuthority[] allAuthorities)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Throws:
Exception

getAuthoritiesForUser

public GrantedAuthority[] getAuthoritiesForUser(String username)
                                         throws 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:
UsernameNotFoundException

setUserRoleListEnhancedUserMap

public void setUserRoleListEnhancedUserMap(UserRoleListEnhancedUserMap userRoleListEnhancedUserMap)

getUserDetailsService

public UserDetailsService getUserDetailsService()

setUserDetailsService

public void setUserDetailsService(UserDetailsService userDetailsService)

getUserRoleListEnhancedUserMap

public UserRoleListEnhancedUserMap getUserRoleListEnhancedUserMap()

setGrantedAuthorityComparator

public void setGrantedAuthorityComparator(Comparator<GrantedAuthority> grantedAuthorityComparator)

setUsernameComparator

public void setUsernameComparator(Comparator<String> usernameComparator)