Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / identitymanagement / SimpleIdentityManager.java @ 1405

History | View | Annotate | Download (1.8 KB)

1
package org.gvsig.tools.identitymanagement;
2

    
3
import java.util.Collection;
4

    
5

    
6
public interface SimpleIdentityManager {
7
    //
8
    // http://en.wikipedia.org/wiki/Identity_management
9
    //
10
    
11
    /**
12
     * Authenticate the identity in the system and stablish a session with this
13
     * identity.
14
     * If the identityid don't exists or the password specified is incorrect, throw
15
     * a exception.
16
     *
17
     * If the domain is not required it can not be null.
18
     *
19
     * @param domain, the domain used to authenticate the user
20
     * @param identityid, identity id to login in the system
21
     * @param password
22
     */
23
    public void login(String domain, String identityid, String password) throws UnauthorizedException;
24

    
25
    /**
26
     * Closes the session stablised with the current identity.
27
     */
28
    public void logout();
29

    
30
    /**
31
     * Return the identity of the current session in the system.
32
     * Can't be null.
33
     *
34
     * @return the current identity
35
     */
36
    public SimpleIdentity getCurrentIdentity();
37

    
38
    public SimpleIdentity getAdministrator();
39
    
40
    /**
41
     * Inform if the login process require a domain name.
42
     *
43
     * @return true if a domain name is required.
44
     */
45
    public boolean needDomain();
46
    
47
    /**
48
     * Run the specified action as the specified identity.
49
     * 
50
     * @param domain
51
     * @param identityid
52
     * @param acction 
53
     */
54
    public void sudo(String domain, String identityid, Runnable acction);
55
 
56
    /**
57
     * Register the actionName as an action that require authorization.
58
     * 
59
     * @param actionName 
60
     */
61
    public void registerAction(String actionName);
62
    
63
    /**
64
     * Return a list of the actions that are registered.
65
     * 
66
     * @return list of action names that requiere authorization.
67
     */
68
    public Collection getActions();
69
}