01: package org.contineo.core.security.dao;
02:
03: import java.util.Collection;
04:
05: import org.contineo.core.security.Group;
06:
07: public interface GroupDAO {
08:
09: /**
10: * This method persists a new group object.
11: * @param group Group which should be stored in a database.
12: * @param parentGroup Name of the group this group inherits ACLs from
13: * @return True if successful stored in a database.
14: */
15: public boolean insert(Group group, String parentGroup);
16:
17: /**
18: * This method persists a group object.
19: * @param group Group which should be stored in a database.
20: * @return True if successful stored in a database.
21: */
22: public boolean store(Group group);
23:
24: /**
25: * This method deletes a group in database.
26: * @param groupname Groupname of group to be deleted.
27: * @return True if successful deleted.
28: */
29: public boolean delete(String groupname);
30:
31: /**
32: * Finds a group by primarykey.
33: * @param groupname Primarykey of wanted group.
34: * @return Wanted group or null.
35: */
36: public Group findByPrimaryKey(String groupname);
37:
38: /**
39: * This method selects all groups.
40: */
41: public Collection<Group> findAll();
42:
43: /**
44: * This method selects all groupnames.
45: */
46: public Collection<String> findAllGroupNames();
47:
48: /**
49: * This method checks the exist of a group.
50: * @param groupname Groupname of the group.
51: */
52: public boolean exists(String groupname);
53: }
|