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

History | View | Annotate | Download (1.78 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 AuthenticationException;
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 identityid
50
     * @param acction 
51
     */
52
    public void sudo(String identityid, Runnable acction);
53
 
54
    /**
55
     * Register the actionName as an action that require authorization.
56
     * 
57
     * @param actionName 
58
     */
59
    public void registerAction(String actionName);
60
    
61
    /**
62
     * Return a list of the actions that are registered.
63
     * 
64
     * @return list of action names that requiere authorization.
65
     */
66
    public Collection getActions();
67
}