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

AuthorityRepositoryIbatis class.

Since:
jdk 1.5.0
Version:
$Id: $
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()
          getAuthorities
 List<AuthorityDTO> getAuthorities(Pager pager)
          getAuthorities
 Integer getAuthoritiesNumber()
          getAuthoritiesNumber
 AuthorityDTO getAuthority(Integer id)
          Retrieve an authority by id
 List<AuthorityDTO> getFreeAuthorities(String username)
          getFreeAuthorities
 List<AuthorityDTO> getFreeAuthoritiesForGroup()
          getFreeAuthoritiesForGroup
 List<AuthorityDTO> getGroupAuthorities(Integer id)
          getGroupAuthorities
 List<Integer> getIdItemsAuthority(Integer id)
          getIdItemsAuthority
 List<AuthorityDTO> getUserAuthorities(String username)
          getUserAuthorities
 Boolean removeAuthority(Integer id)
          Remove an authority by id
 Boolean removeGroupFromAuthorities(Integer id)
          removeGroupFromAuthorities
 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, 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)

removeGroupFromAuthorities

Specified by:
removeGroupFromAuthorities in interface AuthorityRepository
Parameters:
id - a Integer object.
Returns:
a Boolean object.

getAuthorities

public List<AuthorityDTO> getAuthorities()

getAuthorities

Specified by:
getAuthorities in interface AuthorityRepository
Returns:
a List object.

getUserAuthorities

public List<AuthorityDTO> getUserAuthorities(String username)

getUserAuthorities

Specified by:
getUserAuthorities in interface AuthorityRepository
Parameters:
username - a String object.
Returns:
the list of user's authorities by username

getFreeAuthorities

public List<AuthorityDTO> getFreeAuthorities(String username)

getFreeAuthorities

Specified by:
getFreeAuthorities in interface AuthorityRepository
Parameters:
username - a String object.
Returns:
the list of authorities that user doesn't have

getFreeAuthoritiesForGroup

public List<AuthorityDTO> getFreeAuthoritiesForGroup()

getFreeAuthoritiesForGroup

Specified by:
getFreeAuthoritiesForGroup in interface AuthorityRepository
Returns:
a List object.

getIdItemsAuthority

public List<Integer> getIdItemsAuthority(Integer id)

getIdItemsAuthority

Specified by:
getIdItemsAuthority in interface AuthorityRepository
Parameters:
id - a Integer object.
Returns:
a List object.

getGroupAuthorities

public List<AuthorityDTO> getGroupAuthorities(Integer id)

getGroupAuthorities

Specified by:
getGroupAuthorities in interface AuthorityRepository
Parameters:
id - a Integer object.
Returns:
a List object.

saveAuthorities

public Boolean saveAuthorities(Integer groupId,
                               List<Integer> authorities)
Save a list of authorities for a given group

Specified by:
saveAuthorities in interface AuthorityRepository
Parameters:
groupId - a Integer object.
authorities - a List object.
Returns:
the result of operation

getAuthoritiesNumber

public Integer getAuthoritiesNumber()

getAuthoritiesNumber

Specified by:
getAuthoritiesNumber in interface AuthorityRepository
Returns:
a Integer object.

getAuthority

public AuthorityDTO getAuthority(Integer id)
Retrieve an authority by id

Specified by:
getAuthority in interface AuthorityRepository
Parameters:
id - a Integer object.
Returns:
authority

getAuthorities

public List<AuthorityDTO> getAuthorities(Pager pager)

getAuthorities

Specified by:
getAuthorities in interface AuthorityRepository
Parameters:
pager - a Pager object.
Returns:
paginated list of authorities

removeAuthority

public Boolean removeAuthority(Integer id)
Remove an authority by id

Specified by:
removeAuthority in interface AuthorityRepository
Parameters:
id - a Integer object.
Returns:
the result of the operation

deleteUserGroups

public Boolean deleteUserGroups(String username)
Delete all user's groups

Specified by:
deleteUserGroups in interface AuthorityRepository
Parameters:
username - a String object.
Returns:
the result of the operation

save

public Boolean save(AuthorityDTO authority)
Save an authorityDTO

Specified by:
save in interface AuthorityRepository
Parameters:
authority - a AuthorityDTO object.
Returns:
the result of the operation


Copyright © 2011. All Rights Reserved.