01: package org.enhydra.dm.api;
02:
03: import java.util.Properties;
04:
05: import org.enhydra.dm.api.exceptions.BaseException;
06: import org.enhydra.dm.api.loggers.Log;
07:
08: public interface UserManager {
09:
10: /**
11: * Get user by username
12: *
13: * @param username
14: * @return
15: * @throws BaseException
16: */
17: public AppUser getUserByUsername(String username)
18: throws BaseException;
19:
20: /**
21: * Get user by user id
22: *
23: * @param userOid
24: * @return
25: * @throws BaseException
26: */
27: public AppUser getUserById(String userId) throws BaseException;
28:
29: /**
30: * Create user in database
31: *
32: * @param firstname
33: * @param lastname
34: * @param username
35: * @param password
36: * @throws BaseException
37: */
38: public boolean createUser(String firstname, String lastname,
39: String username, String password) throws BaseException;
40:
41: /**
42: * Getter for logger
43: *
44: * @return
45: */
46: public Log getLogger();
47:
48: /**
49: * Setter for logger
50: *
51: * @param logger
52: */
53: public void setLogger(Log logger);
54:
55: /**
56: * Configure method that read parameters from Properties
57: *
58: * @param properties
59: * @throws BaseException
60: */
61: public void configure(Properties properties) throws BaseException;
62:
63: }
|