gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / identitymanagement / SimpleIdentityManager.java @ 1739
History | View | Annotate | Download (1.8 KB)
1 | 1160 | jjdelcerro | package org.gvsig.tools.identitymanagement; |
---|---|---|---|
2 | |||
3 | 1211 | jjdelcerro | import java.util.Collection; |
4 | 1160 | jjdelcerro | |
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 | 1215 | jjdelcerro | public void login(String domain, String identityid, String password) throws UnauthorizedException; |
24 | 1160 | jjdelcerro | |
25 | /**
|
||
26 | * Closes the session stablised with the current identity.
|
||
27 | */
|
||
28 | public void logout(); |
||
29 | |||
30 | /**
|
||
31 | 1405 | jjdelcerro | * Return the identity of the current session in the system.
|
32 | * Can't be null.
|
||
33 | 1160 | jjdelcerro | *
|
34 | * @return the current identity
|
||
35 | */
|
||
36 | public SimpleIdentity getCurrentIdentity();
|
||
37 | |||
38 | 1229 | jjdelcerro | public SimpleIdentity getAdministrator();
|
39 | |||
40 | 1160 | jjdelcerro | /**
|
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 | 1164 | jjdelcerro | |
47 | /**
|
||
48 | * Run the specified action as the specified identity.
|
||
49 | *
|
||
50 | 1215 | jjdelcerro | * @param domain
|
51 | 1164 | jjdelcerro | * @param identityid
|
52 | * @param acction
|
||
53 | */
|
||
54 | 1215 | jjdelcerro | public void sudo(String domain, String identityid, Runnable acction); |
55 | 1211 | jjdelcerro | |
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 | 1160 | jjdelcerro | } |