org.pentaho.platform.plugin.services.security.userrole.jdbc
Class JdbcUserRoleListService

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.jdbc.core.support.JdbcDaoSupport
          extended by org.pentaho.platform.plugin.services.security.userrole.jdbc.JdbcUserRoleListService
All Implemented Interfaces:
IUserRoleListService, org.springframework.beans.factory.InitializingBean

public class JdbcUserRoleListService
extends org.springframework.jdbc.core.support.JdbcDaoSupport
implements IUserRoleListService


Field Summary
static String DEF_ALL_AUTHORITIES_QUERY
           
static String DEF_ALL_USERNAMES_IN_ROLE_QUERY
           
static String DEF_ALL_USERNAMES_QUERY
           
 
Constructor Summary
JdbcUserRoleListService(org.springframework.security.userdetails.UserDetailsService userDetailsService)
           
 
Method Summary
 org.springframework.security.GrantedAuthority[] getAllAuthorities()
          Returns all authorities known to the provider.
 String getAllAuthoritiesQuery()
           
 String[] getAllUsernames()
          Returns all user names known to the provider.
 String getAllUsernamesInRoleQuery()
           
 String getAllUsernamesQuery()
           
 org.springframework.security.GrantedAuthority[] getAuthoritiesForUser(String userName)
          Returns all authorities granted for a specified user.
 String[] getUsernamesInRole(org.springframework.security.GrantedAuthority authority)
          Returns all known users in the specified role.
 void setAllAuthoritiesQuery(String queryString)
          Allows the default query string used to retrieve all authorities to be overriden, if default table or column names need to be changed.
 void setAllUsernamesInRoleQuery(String queryString)
          Allows the default query string used to retrieve all user names in a role to be overriden, if default table or column names need to be changed.
 void setAllUsernamesQuery(String queryString)
          Allows the default query string used to retrieve all user names to be overriden, if default table or column names need to be changed.
 void setRolePrefix(String rolePrefix)
           
 void setUserDetailsService(org.springframework.security.userdetails.UserDetailsService userDetailsService)
           
 
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
getDataSource, getJdbcTemplate, setDataSource, setJdbcTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_ALL_AUTHORITIES_QUERY

public static final String DEF_ALL_AUTHORITIES_QUERY
See Also:
Constant Field Values

DEF_ALL_USERNAMES_QUERY

public static final String DEF_ALL_USERNAMES_QUERY
See Also:
Constant Field Values

DEF_ALL_USERNAMES_IN_ROLE_QUERY

public static final String DEF_ALL_USERNAMES_IN_ROLE_QUERY
See Also:
Constant Field Values
Constructor Detail

JdbcUserRoleListService

public JdbcUserRoleListService(org.springframework.security.userdetails.UserDetailsService userDetailsService)
Method Detail

setAllAuthoritiesQuery

public void setAllAuthoritiesQuery(String queryString)
Allows the default query string used to retrieve all authorities to be overriden, if default table or column names need to be changed. The default query is DEF_ALL_AUTHORITIES_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.

Parameters:
queryString - The query string to set

getAllAuthoritiesQuery

public String getAllAuthoritiesQuery()

setAllUsernamesInRoleQuery

public void setAllUsernamesInRoleQuery(String queryString)
Allows the default query string used to retrieve all user names in a role to be overriden, if default table or column names need to be changed. The default query is #DEF_ALL_USERS_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.

Parameters:
queryString - The query string to set

getAllUsernamesInRoleQuery

public String getAllUsernamesInRoleQuery()

setAllUsernamesQuery

public void setAllUsernamesQuery(String queryString)
Allows the default query string used to retrieve all user names to be overriden, if default table or column names need to be changed. The default query is #DEF_ALL_USERS_IN_ROLE_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.

Parameters:
queryString - The query string to set

getAllUsernamesQuery

public String getAllUsernamesQuery()

getAllAuthorities

public org.springframework.security.GrantedAuthority[] getAllAuthorities()
                                                                  throws org.springframework.dao.DataAccessException
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)
Throws:
org.springframework.dao.DataAccessException

getAllUsernames

public String[] getAllUsernames()
                         throws org.springframework.dao.DataAccessException
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)
Throws:
org.springframework.dao.DataAccessException

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)

getAuthoritiesForUser

public org.springframework.security.GrantedAuthority[] getAuthoritiesForUser(String userName)
                                                                      throws org.springframework.security.userdetails.UsernameNotFoundException,
                                                                             org.springframework.dao.DataAccessException
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
org.springframework.dao.DataAccessException

setRolePrefix

public void setRolePrefix(String rolePrefix)

setUserDetailsService

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