commit | author | age
|
9ee357
|
1 |
/* |
c7d492
|
2 |
http-auth - Authentication Extensions to jdk.httpserver |
9ee357
|
3 |
Copyright (C) 2021 Ulrich Hilger |
U |
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.httpserver.auth.session; |
|
19 |
|
|
20 |
import java.util.Date; |
|
21 |
|
|
22 |
/** |
|
23 |
* |
|
24 |
* @author Ulrich Hilger |
|
25 |
* @version 2, 29.05.2021 |
|
26 |
*/ |
|
27 |
public class AuthenticatedSession implements Session { |
|
28 |
|
|
29 |
private Date exp; |
|
30 |
private String id; |
|
31 |
private Object data; |
|
32 |
|
|
33 |
public Date getExp() { |
|
34 |
return exp; |
|
35 |
} |
|
36 |
|
|
37 |
public void setExp(Date exp) { |
|
38 |
this.exp = exp; |
|
39 |
} |
|
40 |
|
|
41 |
public String getId() { |
|
42 |
return id; |
|
43 |
} |
|
44 |
|
|
45 |
public void setId(String id) { |
|
46 |
this.id = id; |
|
47 |
} |
|
48 |
|
|
49 |
public String getUserId() { |
|
50 |
if(data instanceof String) { |
|
51 |
return (String) data; |
|
52 |
} else { |
|
53 |
return null; |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
public void setUserId(String nutzerId) { |
|
58 |
this.data = nutzerId; |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public Object getData() { |
|
63 |
return data; |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public void setData(Object data) { |
|
68 |
this.data = data; |
|
69 |
} |
|
70 |
|
|
71 |
} |