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