2 * Copyright 2005 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.wamblee.usermgt;
22 * Represents a set of groups. A typical implemnetation would be, a readonly implementation
23 * defined in a configuration file or a list of groups defined in a database.
25 * @author Erik Brakkee
27 public interface GroupSet {
29 * Must be called when the group has been modified to notify the
32 * @param aGroup Group that was modified.
34 void groupModified(Group aGroup);
37 * Finds the group by name.
39 * @param aName Group name.
41 * @return Group or null if not found.
43 Group find(String aName);
46 * Determines if the group exists.
48 * @param aGroup Group.
50 * @return True iff the group exists.
52 boolean contains(Group aGroup);
55 * Adds a group. If the group already exists, the existing group
56 * set is left unchanged.
58 * @param aGroup Group.
60 * @return DOCUMENT ME!
62 boolean add(Group aGroup);
65 * Removes a group. If the group does not exist, this method is a
68 * @param aGroup Group to remove.
70 * @return True if the group was removed, false otherwise.
72 boolean remove(Group aGroup);
77 * @return DOCUMENT ME!
82 * @return DOCUMENT ME!
85 * Returns the current groups.
93 * @return The number of groups.