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

GroupServiceImpl class.

Since:
jdk 1.5.0
Version:
$Id: $
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)
          getFreeGroups
 GroupDTO getGroup(Integer id)
          Retrieve a group by id
 List<GroupDTO> getGroups()
          getGroups
 List<GroupDTO> getGroups(Pager pager)
          getGroups
 Integer getTotalItemsNumber()
          getTotalItemsNumber
 List<GroupDTO> getUserGroups(String username)
          getUserGroups
 List<GroupDTO> getUserGroupsWithAutorities(String username)
          getUserGroupsWithAutorities
 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)

getUserGroupsWithAutorities

Specified by:
getUserGroupsWithAutorities in interface GroupService
Parameters:
username - a String object.
Returns:
a List object.

deleteUserGroups

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

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

getFreeGroups

public List<GroupDTO> getFreeGroups(String username)

getFreeGroups

Specified by:
getFreeGroups in interface GroupService
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 GroupService
Parameters:
id - a Integer object.
Returns:
group

getGroups

public List<GroupDTO> getGroups()

getGroups

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

getGroups

public List<GroupDTO> getGroups(Pager pager)

getGroups

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

getUserGroups

public List<GroupDTO> getUserGroups(String username)

getUserGroups

Specified by:
getUserGroups in interface GroupService
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 GroupService
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 GroupService
Parameters:
group - a GroupDTO object.
Returns:
the result of the operation

saveGroups

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

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

getTotalItemsNumber

public Integer getTotalItemsNumber()

getTotalItemsNumber

Specified by:
getTotalItemsNumber in interface PagerService
Returns:
a Integer object.

hasUsers

public Boolean hasUsers(Integer id)
Check if Group has a users

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


Copyright © 2011. All Rights Reserved.