1
|
/**
|
2
|
* '$RCSfile$'
|
3
|
* Purpose: A Class that stores user session information
|
4
|
* Copyright: 2008 Regents of the University of California and the
|
5
|
* National Center for Ecological Analysis and Synthesis
|
6
|
* Authors: Michael Daigle
|
7
|
*
|
8
|
* '$Author: daigle $'
|
9
|
* '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
|
10
|
* '$Revision: 4080 $'
|
11
|
*
|
12
|
* This program is free software; you can redistribute it and/or modify
|
13
|
* it under the terms of the GNU General Public License as published by
|
14
|
* the Free Software Foundation; either version 2 of the License, or
|
15
|
* (at your option) any later version.
|
16
|
*
|
17
|
* This program is distributed in the hope that it will be useful,
|
18
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20
|
* GNU General Public License for more details.
|
21
|
*
|
22
|
* You should have received a copy of the GNU General Public License
|
23
|
* along with this program; if not, write to the Free Software
|
24
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
*/
|
26
|
|
27
|
package edu.ucsb.nceas.metacat.util;
|
28
|
|
29
|
import java.util.Calendar;
|
30
|
import java.util.Date;
|
31
|
|
32
|
import javax.naming.AuthenticationException;
|
33
|
import javax.naming.NamingException;
|
34
|
|
35
|
import javax.servlet.http.Cookie;
|
36
|
import javax.servlet.http.HttpServletRequest;
|
37
|
import javax.servlet.http.HttpSession;
|
38
|
|
39
|
import org.apache.log4j.Logger;
|
40
|
|
41
|
import edu.ucsb.nceas.metacat.AuthLdap;
|
42
|
import edu.ucsb.nceas.metacat.MetaCatServlet;
|
43
|
|
44
|
public class SessionData {
|
45
|
|
46
|
private String id = null;
|
47
|
private String userName = null;
|
48
|
private String[] groupNames = null;
|
49
|
private String password = null;
|
50
|
private final Calendar creationTime = Calendar.getInstance();
|
51
|
private Calendar lastAccessedTime = Calendar.getInstance();
|
52
|
|
53
|
private Logger logMetacat = Logger.getLogger(SessionData.class);
|
54
|
|
55
|
/**
|
56
|
*
|
57
|
* @param userName
|
58
|
* @param groupNames
|
59
|
* @param password
|
60
|
*/
|
61
|
public SessionData(String id, String userName, String[] groupNames, String password) {
|
62
|
this.id = id;
|
63
|
this.userName = userName;
|
64
|
this.groupNames = groupNames;
|
65
|
this.password = password;
|
66
|
}
|
67
|
|
68
|
public String getId() {
|
69
|
return id;
|
70
|
}
|
71
|
|
72
|
public String getUserName() {
|
73
|
return userName;
|
74
|
}
|
75
|
|
76
|
public void setUserName(String userName) {
|
77
|
this.userName = userName;
|
78
|
}
|
79
|
|
80
|
public String[] getGroupNames() {
|
81
|
return groupNames;
|
82
|
}
|
83
|
|
84
|
public void setGroupNames(String[] groupNames) {
|
85
|
this.groupNames = groupNames;
|
86
|
}
|
87
|
|
88
|
public String getPassword() {
|
89
|
return password;
|
90
|
}
|
91
|
|
92
|
public void setPassword(String password) {
|
93
|
this.password = password;
|
94
|
}
|
95
|
|
96
|
public Calendar getLastAccessedTime() {
|
97
|
return lastAccessedTime;
|
98
|
}
|
99
|
|
100
|
public void setLastAccessedTime() {
|
101
|
lastAccessedTime.setTime(new Date());
|
102
|
}
|
103
|
|
104
|
public Calendar getCreationTime() {
|
105
|
return creationTime;
|
106
|
}
|
107
|
}
|