org.opennms.acl.repository.ibatis
Class AuthorityRepositoryIbatis

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

@Repository(value="authorityRepository")
public class AuthorityRepositoryIbatis
extends org.springframework.orm.ibatis.SqlMapClientTemplate
implements AuthorityRepository

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
AuthorityRepositoryIbatis()
           
 
Method Summary
 Boolean deleteUserGroups(String username)
          Delete all user's groups
 List<AuthorityDTO> getAuthorities()
           
 List<AuthorityDTO> getAuthorities(Pager pager)
           
 Integer getAuthoritiesNumber()
           
 AuthorityDTO getAuthority(Integer id)
          Retrieve an authority by id
 List<AuthorityDTO> getFreeAuthorities(String username)
           
 List<AuthorityDTO> getFreeAuthoritiesForGroup()
           
 List<AuthorityDTO> getGroupAuthorities(Integer id)
           
 List<Integer> getIdItemsAuthority(Integer id)
           
 List<AuthorityDTO> getUserAuthorities(String username)
           
 Boolean removeAuthority(Integer id)
          Remove an authority by id
 Boolean removeGroupFromAuthorities(Integer id)
           
 Boolean save(AuthorityDTO authority)
          Save an authorityDTO
 Boolean saveAuthorities(Integer groupId, List<Integer> authorities)
          Save a list of authorities for a given group
 void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
           
 
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

AuthorityRepositoryIbatis

public AuthorityRepositoryIbatis()
Method Detail

setSqlMapClient

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

removeGroupFromAuthorities

public Boolean removeGroupFromAuthorities(Integer id)
Specified by:
removeGroupFromAuthorities in interface AuthorityRepository

getAuthorities

public List<AuthorityDTO> getAuthorities()
Specified by:
getAuthorities in interface AuthorityRepository
Returns:
list of all authorities

getUserAuthorities

public List<AuthorityDTO> getUserAuthorities(String username)
Specified by:
getUserAuthorities in interface AuthorityRepository
Returns:
the list of user's authorities by username

getFreeAuthorities

public List<AuthorityDTO> getFreeAuthorities(String username)
Specified by:
getFreeAuthorities in interface AuthorityRepository
Returns:
the list of authorities that user doesn't have

getFreeAuthoritiesForGroup

public List<AuthorityDTO> getFreeAuthoritiesForGroup()
Specified by:
getFreeAuthoritiesForGroup in interface AuthorityRepository
Returns:
the list of authorities that Group doesn't have

getIdItemsAuthority

public List<Integer> getIdItemsAuthority(Integer id)
Specified by:
getIdItemsAuthority in interface AuthorityRepository
Returns:

getGroupAuthorities

public List<AuthorityDTO> getGroupAuthorities(Integer id)
Specified by:
getGroupAuthorities in interface AuthorityRepository

saveAuthorities

public Boolean saveAuthorities(Integer groupId,
                               List<Integer> authorities)
Description copied from interface: AuthorityRepository
Save a list of authorities for a given group

Specified by:
saveAuthorities in interface AuthorityRepository
Returns:
the result of operation

getAuthoritiesNumber

public Integer getAuthoritiesNumber()
Specified by:
getAuthoritiesNumber in interface AuthorityRepository
Returns:
numbers of authorities present in the system

getAuthority

public AuthorityDTO getAuthority(Integer id)
Description copied from interface: AuthorityRepository
Retrieve an authority by id

Specified by:
getAuthority in interface AuthorityRepository
Returns:
authority

getAuthorities

public List<AuthorityDTO> getAuthorities(Pager pager)
Specified by:
getAuthorities in interface AuthorityRepository
Returns:
paginated list of authorities

removeAuthority

public Boolean removeAuthority(Integer id)
Description copied from interface: AuthorityRepository
Remove an authority by id

Specified by:
removeAuthority in interface AuthorityRepository
Returns:
the result of the operation

deleteUserGroups

public Boolean deleteUserGroups(String username)
Description copied from interface: AuthorityRepository
Delete all user's groups

Specified by:
deleteUserGroups in interface AuthorityRepository
Returns:
the result of the operation

save

public Boolean save(AuthorityDTO authority)
Description copied from interface: AuthorityRepository
Save an authorityDTO

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


Copyright © 2009. All Rights Reserved.