org.pentaho.platform.engine.security.userroledao.hibernate
Class UserRoleDaoTransactionDecorator

java.lang.Object
  extended by org.pentaho.platform.engine.security.userroledao.hibernate.UserRoleDaoTransactionDecorator
All Implemented Interfaces:
IUserRoleDao

public class UserRoleDaoTransactionDecorator
extends Object
implements IUserRoleDao

Wraps a IUserRoleDao, beginning, committing, and rolling back transactions before and after each operation.

Why not just do the transactions in the DAO implementation? Because transactions are a cross-cutting concern, an aspect that is often scattered throughout the code but is best separated from other code.

Author:
mlowery

Constructor Summary
UserRoleDaoTransactionDecorator()
           
 
Method Summary
 void createRole(IPentahoRole roleToCreate)
           
 void createUser(IPentahoUser userToCreate)
           
 void deleteRole(IPentahoRole roleToDelete)
           
 void deleteUser(IPentahoUser userToDelete)
           
 IPentahoRole getRole(String name)
           
 List<IPentahoRole> getRoles()
           
 IPentahoUser getUser(String username)
           
 List<IPentahoUser> getUsers()
           
 void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
           
 void setUserRoleDao(IUserRoleDao userRoleDao)
           
 void updateRole(IPentahoRole roleToUpdate)
           
 void updateUser(IPentahoUser userToUpdate)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserRoleDaoTransactionDecorator

public UserRoleDaoTransactionDecorator()
Method Detail

createRole

public void createRole(IPentahoRole roleToCreate)
                throws AlreadyExistsException,
                       UncategorizedUserRoleDaoException
Specified by:
createRole in interface IUserRoleDao
Throws:
AlreadyExistsException
UncategorizedUserRoleDaoException

createUser

public void createUser(IPentahoUser userToCreate)
                throws AlreadyExistsException,
                       UncategorizedUserRoleDaoException
Specified by:
createUser in interface IUserRoleDao
Throws:
AlreadyExistsException
UncategorizedUserRoleDaoException

deleteRole

public void deleteRole(IPentahoRole roleToDelete)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
Specified by:
deleteRole in interface IUserRoleDao
Throws:
NotFoundException
UncategorizedUserRoleDaoException

deleteUser

public void deleteUser(IPentahoUser userToDelete)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
Specified by:
deleteUser in interface IUserRoleDao
Throws:
NotFoundException
UncategorizedUserRoleDaoException

getRole

public IPentahoRole getRole(String name)
                     throws UncategorizedUserRoleDaoException
Specified by:
getRole in interface IUserRoleDao
Throws:
UncategorizedUserRoleDaoException

getRoles

public List<IPentahoRole> getRoles()
                            throws UncategorizedUserRoleDaoException
Specified by:
getRoles in interface IUserRoleDao
Throws:
UncategorizedUserRoleDaoException

getUser

public IPentahoUser getUser(String username)
                     throws UncategorizedUserRoleDaoException
Specified by:
getUser in interface IUserRoleDao
Throws:
UncategorizedUserRoleDaoException

getUsers

public List<IPentahoUser> getUsers()
                            throws UncategorizedUserRoleDaoException
Specified by:
getUsers in interface IUserRoleDao
Throws:
UncategorizedUserRoleDaoException

updateRole

public void updateRole(IPentahoRole roleToUpdate)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
Specified by:
updateRole in interface IUserRoleDao
Throws:
NotFoundException
UncategorizedUserRoleDaoException

updateUser

public void updateUser(IPentahoUser userToUpdate)
                throws NotFoundException,
                       UncategorizedUserRoleDaoException
Specified by:
updateUser in interface IUserRoleDao
Throws:
NotFoundException
UncategorizedUserRoleDaoException

setTransactionTemplate

public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)

setUserRoleDao

public void setUserRoleDao(IUserRoleDao userRoleDao)