1 package net.avcompris.examples.users3.dao;
2
3 import java.io.IOException;
4 import java.sql.SQLException;
5
6 import javax.annotation.Nullable;
7
8 import org.joda.time.DateTime;
9
10 import net.avcompris.commons3.dao.exception.DuplicateEntityException;
11
12 public interface UsersDao {
13
14 UsersDto getUsers(UsersDtoQuery query) throws SQLException, IOException;
15
16 void createUser(String username,
17 String rolename,
18 @Nullable String preferredLang,
19 @Nullable String preferredTimeZone,
20 boolean enabled
21 ) throws SQLException, IOException, DuplicateEntityException;
22
23 @Nullable
24 UserDto getUser(String username) throws SQLException, IOException;
25
26 void updateUser(String username,
27 String rolename,
28 @Nullable String preferredLang,
29 @Nullable String preferredTimeZone,
30 boolean enabled,
31 int fromRevision
32 ) throws SQLException, IOException;
33
34 void deleteUser(String username) throws SQLException, IOException;
35
36 void setLastActiveAt(String username, DateTime lastActiveAt) throws SQLException, IOException;
37 }