1
2
3
4
5
6
7 package gov.bnl.gums;
8
9 import java.util.*;
10
11 /*** An interface that defines a group of people, which GUMS will associate to a
12 * mapping policy. An implementation could take/manage a list of users in
13 * any way it wanted, or it could combine different groups.
14 *
15 * @author Gabriele Carcassi
16 */
17 public interface UserGroup {
18
19 /***
20 * Determines whether the given user identity is part of the group.
21 * @param userDN the certificate DN.
22 * @return true if it's in the group
23 */
24 boolean isInGroup(GridUser user);
25
26 /***
27 * Returns the list of user identities that are part of the group.
28 * <p>
29 * Some UserGroups, however, could be defined by a rule that doesn't
30 * allow listing. For example, a group could be 'all the users
31 * with a DOEGrids certificate'. Though one could argue whether or
32 * not is a good idea to have such a group, one can implement one
33 * and throw an UnsupportedOperationException. This will make it
34 * impossible for GUMS to create a grid-mapfile, but would still
35 * allow direct user to account mapping through a call-out.
36 * @return a List of GridUser objects representing the user certificate DN.
37 */
38 List getMemberList();
39
40 /*** Updates the local list of the users from the source of the group.
41 * <p>
42 * Most user groups will get the information from a separate database
43 * accessible via WAN. For that reason, the user group will maintain a
44 * local cache with the list of members, which can be updated through
45 * this method.
46 */
47 void updateMembers();
48
49 /***
50 * Returns a name associated to this user group.
51 * <p>
52 * @todo this is probably not useful, and can be confusing: should be removed.
53 * @return the name of the group within GUMS.
54 */
55 String getName();
56 }