Salome HOME
264ff9edc296f1ec66787ce5523fa9e84984e541
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / UserService.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   21.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  * @copyright      OPEN CASCADE 2012-2014
9  *****************************************************************************/
10
11 package org.splat.service;
12
13 import java.io.File;
14 import java.util.List;
15 import java.util.Set;
16
17 import org.splat.dal.bo.kernel.User;
18 import org.splat.kernel.InvalidPropertyException;
19 import org.splat.kernel.MismatchException;
20 import org.splat.kernel.MissedPropertyException;
21 import org.splat.kernel.MultiplyDefinedException;
22 import org.splat.manox.XMLException;
23
24 /**
25  * User service interface.
26  * 
27  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
28  */
29 public interface UserService {
30
31         User createUser(User.Properties uprop)
32                         throws MissedPropertyException, InvalidPropertyException,
33                         MultiplyDefinedException;
34
35         Set<User> importUsers(File xfile) throws XMLException,
36                         MismatchException;
37
38         /**
39          * Returns the manager of the given user. This function is effective providing that users are defined according to the following
40          * conventions:
41          * <ul>
42          * <li>One user is assigned in the organization as Nx1 (n+1 manager of members of the organization)</li>
43          * <li>Another user is assigned in the organization as Nx2 (n+2 manager of members of the organization)</li>
44          * </ul>
45          * If such users do not exit, null is returned.
46          * 
47          * @param user
48          *            the user whose manager is get
49          * @return the manager of the given user, if defined
50          */
51         User getManagerOf(User user);
52
53         List<User> selectAllUsers();
54
55         User selectUser(String username);
56
57         User selectUser(String username, String password);
58
59         User selectUser(long index);
60
61         List<User> selectUsersWhere(User.Properties... uprop);
62 }