1
2
3
4
5
6 package org.directdemocracyportal.democracy.service.dao;
7
8 import java.util.List;
9
10 import org.directdemocracyportal.democracy.model.application.UserSession;
11 import org.springframework.dao.DataAccessException;
12
13 /***
14 * The Interface UserSessionDAO.
15 */
16 public interface UserSessionDAO extends GenericDAO<UserSession, Long>
17 {
18
19 /***
20 * Find by session id.
21 *
22 * @param sessionId the session id
23 * @return the user session
24 * @throws DataAccessException the data access exception
25 */
26 UserSession findBySessionId(String sessionId) throws DataAccessException;
27
28 /***
29 * Find by user id.
30 *
31 * @param userId the user id
32 * @return the user session
33 * @throws DataAccessException the data access exception
34 */
35 UserSession findByUserId(Long userId) throws DataAccessException;
36
37 /***
38 * Gets the active sessions.
39 *
40 * @return the active sessions
41 */
42 List<UserSession> getActiveSessions();
43
44 /***
45 * End active sessions.
46 */
47 void endActiveSessions();
48 }