View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
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  }