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

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

getUserGroupsWithAutorities

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

hasUsers

public Boolean hasUsers(Integer id)

hasUsers

Specified by:
hasUsers in interface GroupRepository
Parameters:
id - a Integer object.
Returns:
a Boolean object.

getGroupUsernames

public List<String> getGroupUsernames(Integer id)

getGroupUsernames

Parameters:
id - a Integer object.
Returns:
a List object.

deleteUserGroups

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

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

getFreeGroups

public List<GroupDTO> getFreeGroups(String username)

getFreeGroups

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

getGroup

public GroupDTO getGroup(Integer id)
Retrieve a group by id

Specified by:
getGroup in interface GroupRepository
Parameters:
id - a Integer object.
Returns:
group

getGroups

public List<GroupDTO> getGroups()

getGroups

Specified by:
getGroups in interface GroupRepository
Returns:
a List object.

saveGroups

public Boolean saveGroups(String username,
                          List<Integer> groups)
Save a list of authorities for a given user

Specified by:
saveGroups in interface GroupRepository
Parameters:
username - a String object.
groups - a List object.
Returns:
the result of operation

getGroups

public List<GroupDTO> getGroups(Pager pager)

getGroups

Specified by:
getGroups in interface GroupRepository
Parameters:
pager - a Pager object.
Returns:
paginated list of groups

getGroupsNumber

public Integer getGroupsNumber()

getGroupsNumber

Specified by:
getGroupsNumber in interface GroupRepository
Returns:
a Integer object.

getUserGroups

public List<GroupDTO> getUserGroups(String username)

getUserGroups

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

removeGroup

public Boolean removeGroup(Integer id)
Remove a group by id

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

save

public Boolean save(GroupDTO group)
Save a GroupDTO

Specified by:
save in interface GroupRepository
Parameters:
group - a GroupDTO object.
Returns:
the result of the operation


Copyright © 2011. All Rights Reserved.