org.pentaho.platform.engine.security.userroledao.hibernate.sample
Class SampleUsersAndRolesInitHandler

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.pentaho.platform.engine.security.userroledao.hibernate.sample.SampleUsersAndRolesInitHandler
All Implemented Interfaces:
HibernateUserRoleDao.InitHandler, org.springframework.beans.factory.InitializingBean

public class SampleUsersAndRolesInitHandler
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements HibernateUserRoleDao.InitHandler

Inserts sample users and roles into tables if those tables are empty.

This handler checks to see if the users table is empty. If it is empty, then it inserts sample users and roles.

TODO mlowery Use DefaultPentahoPasswordEncoder to encode the hard-coded passwords.

Author:
mlowery
See Also:
HibernateUserRoleDao.InitHandler

Constructor Summary
SampleUsersAndRolesInitHandler()
           
 
Method Summary
 void handleInit()
           
 void setUserRoleDao(IUserRoleDao userRoleDao)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
 
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
 

Constructor Detail

SampleUsersAndRolesInitHandler

public SampleUsersAndRolesInitHandler()
Method Detail

handleInit

public void handleInit()
Specified by:
handleInit in interface HibernateUserRoleDao.InitHandler

setUserRoleDao

public void setUserRoleDao(IUserRoleDao userRoleDao)