org.opennms.acl.service
Class GroupServiceImpl

java.lang.Object
  extended by org.opennms.acl.service.GroupServiceImpl
All Implemented Interfaces:
GroupService, PagerService

@Service(value="groupService")
public class GroupServiceImpl
extends Object
implements GroupService

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

Constructor Summary
GroupServiceImpl()
           
 
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 getTotalItemsNumber()
           
 List<GroupDTO> getUserGroups(String username)
           
 List<GroupDTO> getUserGroupsWithAutorities(String username)
           
 Boolean hasUsers(Integer id)
          Check if Group has a users
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupServiceImpl

public GroupServiceImpl()
Method Detail

getUserGroupsWithAutorities

public List<GroupDTO> getUserGroupsWithAutorities(String username)
Specified by:
getUserGroupsWithAutorities in interface GroupService

deleteUserGroups

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

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

getFreeGroups

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

getGroup

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

Specified by:
getGroup in interface GroupService
Returns:
group

getGroups

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

getGroups

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

getUserGroups

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

removeGroup

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

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

save

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

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

saveGroups

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

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

getTotalItemsNumber

public Integer getTotalItemsNumber()
Specified by:
getTotalItemsNumber in interface PagerService

hasUsers

public Boolean hasUsers(Integer id)
Description copied from interface: GroupService
Check if Group has a users

Specified by:
hasUsers in interface GroupService
Parameters:
id - of the group
Returns:
the result of the operation


Copyright © 2009. All Rights Reserved.