org.opennms.acl.repository.ibatis
Class GroupRepositoryIbatis

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

@Repository(value="groupRepository")
public class GroupRepositoryIbatis
extends org.springframework.orm.ibatis.SqlMapClientTemplate
implements GroupRepository

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
GroupRepositoryIbatis()
           
 
Method Summary
 Boolean deleteUserGroups(String username)
          Delete all user's authorities
 List<GroupDTO> getFreeGroups(String username)
           
 GroupDTO getGroup(Integer id)
          Retrieve a group by id
 List<GroupDTO> getGroups()
           
 List<GroupDTO> getGroups(Pager pager)
           
 Integer getGroupsNumber()
           
 List<String> getGroupUsernames(Integer id)
           
 List<GroupDTO> getUserGroups(String username)
           
 List<GroupDTO> getUserGroupsWithAutorities(String username)
           
 Boolean hasUsers(Integer id)
           
 Boolean removeGroup(Integer id)
          Remove a group by id
 Boolean save(GroupDTO group)
          Save a GroupDTO
 Boolean saveGroups(String username, List<Integer> groups)
          Save a list of authorities for a given user
 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

GroupRepositoryIbatis

public GroupRepositoryIbatis()
Method Detail

setSqlMapClient

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

getUserGroupsWithAutorities

public List<GroupDTO> getUserGroupsWithAutorities(String username)
Specified by:
getUserGroupsWithAutorities in interface GroupRepository
Returns:
the list of user's authorities by username

hasUsers

public Boolean hasUsers(Integer id)
Specified by:
hasUsers in interface GroupRepository

getGroupUsernames

public List<String> getGroupUsernames(Integer id)

deleteUserGroups

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

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

getFreeGroups

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

getGroup

public GroupDTO getGroup(Integer id)
Description copied from interface: GroupRepository
Retrieve a group by id

Specified by:
getGroup in interface GroupRepository
Returns:
group

getGroups

public List<GroupDTO> getGroups()
Specified by:
getGroups in interface GroupRepository
Returns:
list of all authorities

saveGroups

public Boolean saveGroups(String username,
                          List<Integer> groups)
Description copied from interface: GroupRepository
Save a list of authorities for a given user

Specified by:
saveGroups in interface GroupRepository
Returns:
the result of operation

getGroups

public List<GroupDTO> getGroups(Pager pager)
Specified by:
getGroups in interface GroupRepository
Returns:
paginated list of groups

getGroupsNumber

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

getUserGroups

public List<GroupDTO> getUserGroups(String username)
Specified by:
getUserGroups in interface GroupRepository
Returns:
the list of user's authorities by username

removeGroup

public Boolean removeGroup(Integer id)
Description copied from interface: GroupRepository
Remove a group by id

Specified by:
removeGroup in interface GroupRepository
Returns:
the result of the operation

save

public Boolean save(GroupDTO group)
Description copied from interface: GroupRepository
Save a GroupDTO

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


Copyright © 2009. All Rights Reserved.