01: package org.contineo.core.security.dao;
02:
03: import java.util.Collection;
04:
05: import org.contineo.core.security.UserDoc;
06:
07: /**
08: * This class is a DAO-service for userdocs.
09: *
10: * @author Michael Scholz
11: * @version 1.0
12: */
13: public interface UserDocDAO {
14:
15: /**
16: * This method persist an userdoc. The maximum of userdoc for an user is 5.
17: */
18: public boolean store(UserDoc userdoc);
19:
20: /**
21: * Select the count of userdocs for an user.
22: */
23: public int getCount(String username);
24:
25: /**
26: * This method deletes an userdoc by the primary key.
27: */
28: public boolean delete(String username, int menuId);
29:
30: /**
31: * This method deletes all userdocs by the menu id.
32: */
33: public boolean delete(int menuId);
34:
35: /**
36: * Selects all userdocs for a given user.
37: */
38: public Collection<UserDoc> findByUserName(String username);
39:
40: /**
41: * Selects all userdocs for a given menu.
42: */
43: public Collection<UserDoc> findByMenuId(int menuId);
44:
45: /**
46: * Selects the oldest userdoc for a given user.
47: */
48: public UserDoc findByMinTimeStamp(String username);
49:
50: /**
51: * Check if an userdoc exists.
52: *
53: * @param menuId MenuId of the userdoc
54: * @param username
55: */
56: public boolean exists(int menuId, String username);
57: }
|