org.wamblee.security.authentication
Class InMemoryGroupSet

java.lang.Object
  extended by org.wamblee.security.authentication.InMemoryGroupSet
All Implemented Interfaces:
GroupSet

public class InMemoryGroupSet
extends java.lang.Object
implements GroupSet

In-memory group set implementation.

Author:
Erik Brakkee

Constructor Summary
InMemoryGroupSet()
          Constructs an empty group set.
 
Method Summary
 boolean add(Group aGroup)
          Adds a group.
 boolean contains(Group aGroup)
          Determines if the group exists.
 Group find(java.lang.String aName)
          Finds the group by name.
 void groupModified(Group aGroup)
          Must be called when the group has been modified to notify the group set.
 java.util.Set<Group> list()
          Returns the current groups.
 boolean remove(Group aGroup)
          Removes a group.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryGroupSet

public InMemoryGroupSet()
Constructs an empty group set.

Method Detail

groupModified

public void groupModified(Group aGroup)
Description copied from interface: GroupSet
Must be called when the group has been modified to notify the group set.

Specified by:
groupModified in interface GroupSet
Parameters:
aGroup - Group that was modified.

find

public Group find(java.lang.String aName)
Description copied from interface: GroupSet
Finds the group by name.

Specified by:
find in interface GroupSet
Parameters:
aName - Group name.
Returns:
Group or null if not found.

contains

public boolean contains(Group aGroup)
Description copied from interface: GroupSet
Determines if the group exists.

Specified by:
contains in interface GroupSet
Parameters:
aGroup - Group.
Returns:
True iff the group exists.

add

public boolean add(Group aGroup)
Description copied from interface: GroupSet
Adds a group. If the group already exists, the existing group set is left unchanged.

Specified by:
add in interface GroupSet
Parameters:
aGroup - Group.

remove

public boolean remove(Group aGroup)
Description copied from interface: GroupSet
Removes a group. If the group does not exist, this method is a no-op.

Specified by:
remove in interface GroupSet
Parameters:
aGroup - Group to remove.
Returns:
True if the group was removed, false otherwise.

list

public java.util.Set<Group> list()
Description copied from interface: GroupSet
Returns the current groups.

Specified by:
list in interface GroupSet
Returns:
Groups.

size

public int size()
Specified by:
size in interface GroupSet
Returns:
The number of groups.


Copyright © 2022. All Rights Reserved.