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   package org.directdemocracyportal.democracy.service;
6   
7   import java.util.List;
8   
9   import org.directdemocracyportal.democracy.model.application.Portal;
10  import org.directdemocracyportal.democracy.model.application.User;
11  import org.directdemocracyportal.democracy.service.command.RegisterCommand;
12  
13  /***
14   * The Interface UserService.
15   */
16  public interface UserService
17  {
18  
19      /***
20       * Register.
21       *
22       * @param command the command
23       * @param sessionId the session id
24       * @return the user
25       * @throws UserAlreadyExistException the user already exist exception
26       */
27      User register(RegisterCommand command, String sessionId)
28              throws UserAlreadyExistException;
29  
30      /***
31       * Logout.
32       *
33       * @param user the user
34       */
35      void logout(User user);
36  
37      /***
38       * Login.
39       *
40       * @param username the username
41       * @param password the password
42       * @param sessionId the session id
43       * @return the user
44       */
45      User login(String username, String password, String sessionId);
46  
47      /***
48       * Gets the users.
49       *
50       * @return the users
51       */
52      List<User> getUsers();
53  
54      /***
55       * Gets the user.
56       *
57       * @param userId the user id
58       * @return the user
59       */
60      User getUser(Long userId);
61  
62      /***
63       * Gets the portals.
64       *
65       * @return the portals
66       */
67      List<Portal> getPortals();
68  
69      /***
70       * End active user sessions.
71       */
72      void endActiveUserSessions();
73  
74  }