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 @ 1215

History | View | Annotate | Download (1.82 KB)

1
package org.gvsig.tools.identitymanagement;
2

    
3
import java.util.Collection;
4
import javax.naming.AuthenticationException;
5

    
6

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

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

    
31
    /**
32
     * Return the identity of the current session in the system or null if no has a
33
     * session stablisehd.
34
     *
35
     * @return the current identity
36
     */
37
    public SimpleIdentity getCurrentIdentity();
38

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