1
2
3
4
5
6
7 package gov.bnl.gums;
8
9 import java.util.*;
10
11 /*** A persistance layer for a group of users, used to cache user information
12 * on the GUMS server/site instead of taking it always directly from the source.
13 * A list of users from a VO will be taken typically few times a day, through
14 * the updateMembers() in the group. The UserGroup will typically save the
15 * information somewhere. This interface is provided to allow for the
16 * cache to reside on different mediums (i.e. Database, LDAP, file, ...)
17 *
18 * @author Gabriele Carcassi
19 */
20 public interface UserGroupDB {
21 /***
22 * Retrieves all the members of the griven group.
23 * @return A List of GridUser objects representing all the members in the group.
24 */
25 List retrieveMembers();
26 /***
27 * Determines whether a member is in the group. It must be a direct query to
28 * the store, not on a cached value.
29 * @param user A grid credential
30 * @return True if the credential was in the list of members
31 */
32 boolean isMemberInGroup(GridUser user);
33 /***
34 * Sets the list of members as the one given. The method should change what
35 * was stored to the content of the list. It should also perform a diff,
36 * so that calls to retrieveNewMembers and retrieveRemovedMembers will
37 * return the changes.
38 * @param members A list of GridUser objects.
39 */
40 void loadUpdatedList(List members);
41 /***
42 * Returns the members added after a loadUpdatedList
43 * @return A list of GridUser objects.
44 */
45 List retrieveNewMembers();
46 /***
47 * Returns the members removed after a loadUpdatedList
48 * @return A list of GridUser objects.
49 */
50 List retrieveRemovedMembers();
51 }