Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IDIFSession |
|
| 1.0;1 |
1 | /** | |
2 | * - Digitalis Internal Framework v2.0 - (C) 2007, Digitalis Informatica. Distribuicao e Gestao de Informatica, Lda. | |
3 | * Estrada de Paco de Arcos num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 | |
4 | * http://www.digitalis.pt | |
5 | */ | |
6 | package pt.digitalis.dif.controller.interfaces; | |
7 | ||
8 | import java.util.Map; | |
9 | ||
10 | import pt.digitalis.dif.controller.objects.DIFUserInSession; | |
11 | ||
12 | /** | |
13 | * Defines a public accessible DIF Session | |
14 | * | |
15 | * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a><br/> | |
16 | * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a> | |
17 | * @created Nov 29, 2007 | |
18 | */ | |
19 | public interface IDIFSession { | |
20 | ||
21 | /** | |
22 | * Stores a new attribute in the session. | |
23 | * | |
24 | * @param key | |
25 | * the key of the attribute | |
26 | * @param value | |
27 | * the value of the new attribute | |
28 | */ | |
29 | public void addAttribute(String key, Object value); | |
30 | ||
31 | /** | |
32 | * Stores a new attribute in the session. | |
33 | * | |
34 | * @param key | |
35 | * the key of the attribute | |
36 | * @return T if the attribute for the given key exists | |
37 | */ | |
38 | public boolean containsAttribute(String key); | |
39 | ||
40 | /** | |
41 | * Retrieves a given attributes by id. | |
42 | * | |
43 | * @param key | |
44 | * the key of the attribute | |
45 | * @return the attribute value | |
46 | */ | |
47 | public Object getAttribute(String key); | |
48 | ||
49 | /** | |
50 | * Retrieves all session attributes. | |
51 | * | |
52 | * @return the session attributes Map | |
53 | */ | |
54 | public Map<String, Object> getAttributes(); | |
55 | ||
56 | /** | |
57 | * @return the language | |
58 | */ | |
59 | public String getLanguage(); | |
60 | ||
61 | /** | |
62 | * Provides the current session navigation history objet | |
63 | * | |
64 | * @return the navigation history object in session | |
65 | */ | |
66 | public INavigationHistory getNavigationHistory(); | |
67 | ||
68 | /** | |
69 | * @return the sessionID | |
70 | */ | |
71 | public String getSessionID(); | |
72 | ||
73 | /** | |
74 | * Inspector for the session time-out value. | |
75 | * | |
76 | * @return the session time-out value | |
77 | */ | |
78 | public long getSessionTimeOut(); | |
79 | ||
80 | /** | |
81 | * Gets the user in session. | |
82 | * | |
83 | * @return the user in session | |
84 | */ | |
85 | public DIFUserInSession getUser(); | |
86 | ||
87 | /** | |
88 | * Checks if session has timed out. | |
89 | * | |
90 | * @return T if session has timed out, F otherwise | |
91 | */ | |
92 | public boolean hasTimedOut(); | |
93 | ||
94 | /** | |
95 | * Checks if the session has a logged user | |
96 | * | |
97 | * @return T if if is logged | |
98 | */ | |
99 | public boolean isLogged(); | |
100 | ||
101 | /** | |
102 | * @return T if the session has been marked for removal | |
103 | */ | |
104 | public boolean isMarkedForRemoval(); | |
105 | ||
106 | /** | |
107 | * Sets all session attributes. | |
108 | * | |
109 | * @param attributes | |
110 | * the session attributes to set | |
111 | */ | |
112 | public void setAttributes(Map<String, Object> attributes); | |
113 | ||
114 | /** | |
115 | * @param language | |
116 | * the language to set | |
117 | */ | |
118 | public void setLanguage(String language); | |
119 | ||
120 | /** | |
121 | * Sets the session time-out value. | |
122 | * | |
123 | * @param sessionTimeOut | |
124 | * the session time out new value to set | |
125 | */ | |
126 | public void setSessionTimeOut(long sessionTimeOut); | |
127 | ||
128 | /** | |
129 | * Sets the user in session. | |
130 | * | |
131 | * @param user | |
132 | * the user to set | |
133 | */ | |
134 | public void setUser(DIFUserInSession user); | |
135 | } |