org.opennms.acl.repository.ibatis
Class UserRepositoryIbatis

java.lang.Object
  extended by org.springframework.jdbc.support.JdbcAccessor
      extended by org.springframework.orm.ibatis.SqlMapClientTemplate
          extended by org.opennms.acl.repository.ibatis.UserRepositoryIbatis
All Implemented Interfaces:
UserRepository, org.springframework.beans.factory.InitializingBean, org.springframework.orm.ibatis.SqlMapClientOperations

@Repository(value="userRepository")
public class UserRepositoryIbatis
extends org.springframework.orm.ibatis.SqlMapClientTemplate
implements UserRepository

Since:
jdk 1.5.0
Author:
Massimiliano Dessì (desmax74@yahoo.it)

Field Summary
 
Fields inherited from class org.springframework.jdbc.support.JdbcAccessor
logger
 
Constructor Summary
UserRepositoryIbatis()
           
 
Method Summary
 Boolean disableUser(String id)
          disable user by id
 List<UserDTOLight> getDisabledUsers(Pager pager)
           
 List<UserDTOLight> getEnabledUsers(Pager pager)
           
 Object getIdUser(String username)
           
 UserView getUser(String id)
           
 UserDTO getUserCredentials(String id)
           
 Integer getUsersNumber()
           
 UserAuthoritiesDTO getUserWithAuthorities(String username)
           
 UserAuthoritiesDTO getUserWithAuthoritiesByID(Integer sid)
           
 Long insertUser(UserDTO user)
           
 Boolean save(UserAuthoritiesDTO user)
          Save an UserDTO user
 void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
           
 Integer updatePassword(UserDTO user)
          Update a user
 
Methods inherited from class org.springframework.orm.ibatis.SqlMapClientTemplate
afterPropertiesSet, delete, delete, delete, execute, executeWithListResult, executeWithMapResult, getDataSource, getSqlMapClient, insert, insert, queryForList, queryForList, queryForList, queryForList, queryForMap, queryForMap, queryForObject, queryForObject, queryForObject, queryForPaginatedList, queryForPaginatedList, queryWithRowHandler, queryWithRowHandler, update, update, update
 
Methods inherited from class org.springframework.jdbc.support.JdbcAccessor
getExceptionTranslator, isLazyInit, setDatabaseProductName, setDataSource, setExceptionTranslator, setLazyInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserRepositoryIbatis

public UserRepositoryIbatis()
Method Detail

getUserCredentials

public UserDTO getUserCredentials(String id)
Specified by:
getUserCredentials in interface UserRepository
Returns:
the user to update its credentials

setSqlMapClient

public void setSqlMapClient(@Qualifier(value="sqlMapClient")
                            com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Overrides:
setSqlMapClient in class org.springframework.orm.ibatis.SqlMapClientTemplate

insertUser

public Long insertUser(UserDTO user)
Specified by:
insertUser in interface UserRepository
Returns:
id of the inserted user

updatePassword

public Integer updatePassword(UserDTO user)
Description copied from interface: UserRepository
Update a user

Specified by:
updatePassword in interface UserRepository
Returns:
the number of row updated

getUserWithAuthorities

public UserAuthoritiesDTO getUserWithAuthorities(String username)
Specified by:
getUserWithAuthorities in interface UserRepository
Returns:
user with its authorities

getUserWithAuthoritiesByID

public UserAuthoritiesDTO getUserWithAuthoritiesByID(Integer sid)
Specified by:
getUserWithAuthoritiesByID in interface UserRepository
Returns:
user with its authorities

getUser

public UserView getUser(String id)
Specified by:
getUser in interface UserRepository
Returns:
a read only user

getUsersNumber

public Integer getUsersNumber()
Specified by:
getUsersNumber in interface UserRepository
Returns:
number of users in the system

disableUser

public Boolean disableUser(String id)
Description copied from interface: UserRepository
disable user by id

Specified by:
disableUser in interface UserRepository
Returns:
the resutl of the operation

getIdUser

public Object getIdUser(String username)
Specified by:
getIdUser in interface UserRepository
Returns:
the unique identifier user.

getDisabledUsers

public List<UserDTOLight> getDisabledUsers(Pager pager)
Specified by:
getDisabledUsers in interface UserRepository
Returns:
paginated list of disabled users

getEnabledUsers

public List<UserDTOLight> getEnabledUsers(Pager pager)
Specified by:
getEnabledUsers in interface UserRepository
Returns:
paginated list of enabled users

save

public Boolean save(UserAuthoritiesDTO user)
Description copied from interface: UserRepository
Save an UserDTO user

Specified by:
save in interface UserRepository
Returns:
the result of the operation


Copyright © 2009. All Rights Reserved.