Class DuracloudGroupServiceImpl
- java.lang.Object
-
- org.duracloud.account.db.util.impl.DuracloudGroupServiceImpl
-
- All Implemented Interfaces:
DuracloudGroupService
@Component("duracloudGroupService") public class DuracloudGroupServiceImpl extends Object implements DuracloudGroupService- Author:
- Daniel Bernstein Date: Nov 11, 2011
-
-
Constructor Summary
Constructors Constructor Description DuracloudGroupServiceImpl(org.duracloud.account.db.repo.DuracloudRepoMgr duracloudRepoMgr, org.duracloud.common.changenotifier.AccountChangeNotifier accountChangeNotifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.duracloud.account.db.model.DuracloudGroupcreateGroup(String name, Long acctId)voiddeleteGroup(org.duracloud.account.db.model.DuracloudGroup group, Long acctId)Deletes a group.org.duracloud.account.db.model.DuracloudGroupgetGroup(String name, Long acctId)Set<org.duracloud.account.db.model.DuracloudGroup>getGroups(Long acctId)Returns a set of groups associated with the underlying Account.protected booleanisGroupNameValid(String name)This method is 'protected' for testing purposes only.voidupdateGroupUsers(org.duracloud.account.db.model.DuracloudGroup group, Set<org.duracloud.account.db.model.DuracloudUser> users, Long acctId)This method replaces the users (if any) associated with the specified group.
-
-
-
Method Detail
-
getGroups
public Set<org.duracloud.account.db.model.DuracloudGroup> getGroups(Long acctId)
Description copied from interface:DuracloudGroupServiceReturns a set of groups associated with the underlying Account.- Specified by:
getGroupsin interfaceDuracloudGroupService- Parameters:
acctId- associated with group- Returns:
- a set of groups or null if no groups associated with the account.
-
getGroup
public org.duracloud.account.db.model.DuracloudGroup getGroup(String name, Long acctId)
- Specified by:
getGroupin interfaceDuracloudGroupService- Parameters:
name- of the groupacctId- associated with group- Returns:
- the group with the matching name
-
createGroup
public org.duracloud.account.db.model.DuracloudGroup createGroup(String name, Long acctId) throws DuracloudGroupAlreadyExistsException, InvalidGroupNameException
- Specified by:
createGroupin interfaceDuracloudGroupService- Parameters:
name- of the new groupacctId- associated with group- Returns:
- the newly created group
- Throws:
DuracloudGroupAlreadyExistsExceptionInvalidGroupNameException
-
isGroupNameValid
protected final boolean isGroupNameValid(String name)
This method is 'protected' for testing purposes only.
-
deleteGroup
public void deleteGroup(org.duracloud.account.db.model.DuracloudGroup group, Long acctId)Description copied from interface:DuracloudGroupServiceDeletes a group. If the group does not exist, nothing happens.- Specified by:
deleteGroupin interfaceDuracloudGroupService- Parameters:
group- to deleteacctId- associated with group
-
updateGroupUsers
public void updateGroupUsers(org.duracloud.account.db.model.DuracloudGroup group, Set<org.duracloud.account.db.model.DuracloudUser> users, Long acctId) throws DuracloudGroupNotFoundExceptionDescription copied from interface:DuracloudGroupServiceThis method replaces the users (if any) associated with the specified group.- Specified by:
updateGroupUsersin interfaceDuracloudGroupService- Parameters:
group- to be updatedusers- to associate with groupacctId- associated with group- Throws:
DuracloudGroupNotFoundException
-
-