com.atlassian.jira.bc.group
Class GroupRemoveChildMapper

java.lang.Object
  extended by com.atlassian.jira.bc.group.GroupRemoveChildMapper

public class GroupRemoveChildMapper
extends Object

Holds the parameters that specify which children should be removed from which groups. Also holds a list of default groups which children can be registered to be removed from. This class is not threadsafe. The only time you want to use the register methods and not the register(String) method is when you are updating multiple groups and multiple children and not all children are being removed from all groups. In all other cases the usage pattern for this class should be: GroupRemoveChildMapper mapper = new GroupRemoveChildMapper(listOfGroupNamesToRemoveFrom); mapper.registerForSelected(childNameWhoShouldBeRemovedFromGroups);

Since:
v3.12. In v4.3 - Renamed from GroupRemoveUserMapper.

Constructor Summary
GroupRemoveChildMapper()
          Creates the mapper with no default groups.
GroupRemoveChildMapper(List defaultGroupNames)
          Creates the mapper with the given groups marked as default groups.
 
Method Summary
 Iterator childIterator()
          Provides an iterator over the childNames.
 List getDefaultGroupNames()
          Returns the default groups.
 Collection getGroups(String childName)
          Provides an unmodifiable collection of all registered groups for a child.
 Iterator getGroupsIterator(String childName)
          Provides an Iterator to loop over all registered groups for a child.
 boolean isRemoveFromAllSelected(String childName)
          Indicates that the given child is to be removed from all default groups.
 GroupRemoveChildMapper register(String childName)
          Registers the given childName to be removed from the configured list of default groups.
 GroupRemoveChildMapper register(String childName, Collection groupNames)
          Registers the given childName to be removed from the specified group names.
 GroupRemoveChildMapper register(String childName, String groupName)
          Registers the given childName to be removed from the specified groupName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupRemoveChildMapper

public GroupRemoveChildMapper()
Creates the mapper with no default groups.


GroupRemoveChildMapper

public GroupRemoveChildMapper(List defaultGroupNames)
Creates the mapper with the given groups marked as default groups. If there are any children registered to be removed from all default groups, these will be the groups that refers to.

Parameters:
defaultGroupNames - the defaultGroupNames.
Since:
v3.12
Method Detail

register

public GroupRemoveChildMapper register(String childName)
Registers the given childName to be removed from the configured list of default groups.

Parameters:
childName - identifies the child to be removed from the default groups.
Returns:
this.
Since:
v3.12

register

public GroupRemoveChildMapper register(String childName,
                                       String groupName)
Registers the given childName to be removed from the specified groupName. This can be called many times and the groups will be aggregated against the childName. Calling this method implies that the child should be removed from the specified group instead of the default groups.

Parameters:
childName - identifies the child to be removed from the default groups.
groupName - identifies the group to remove the child from.
Returns:
this.
Since:
v3.12

register

public GroupRemoveChildMapper register(String childName,
                                       Collection groupNames)
Registers the given childName to be removed from the specified group names. This can be called many times and the groups will be aggregated against the childName. Calling this method implies that the child should be removed from the specified groups instead of the default groups.

Parameters:
childName - identifies the child to be removed from the default groups.
groupNames - a collection of groupNames that identify the groups to remove the child from.
Returns:
this.
Since:
v3.12

isRemoveFromAllSelected

public boolean isRemoveFromAllSelected(String childName)
Indicates that the given child is to be removed from all default groups.

Parameters:
childName - identifies the child to be removed from the default groups.
Returns:
true if the child is to be removed from all default groups, false otherwise.
Since:
v3.12

getGroupsIterator

public Iterator getGroupsIterator(String childName)
Provides an Iterator to loop over all registered groups for a child.

Parameters:
childName - identifies the child whose groups we want to iterate over.
Returns:
Iterator to loop over all registered groups for a child.
Since:
v3.12

getGroups

public Collection getGroups(String childName)
Provides an unmodifiable collection of all registered groups for a child.

Parameters:
childName - identifies the child to be removed from the default groups.
Returns:
unmodifiable collection of all registered groups for a child.
Since:
v3.12

childIterator

public Iterator childIterator()
Provides an iterator over the childNames.

Returns:
iterator for registered childNames.
Since:
v3.12

getDefaultGroupNames

public List getDefaultGroupNames()
Returns the default groups.

Returns:
the list of groupNames that are default.
Since:
v3.12


Copyright © 2002-2013 Atlassian. All Rights Reserved.