KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dlog4j > formbean > LoginTrackBean


1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package dlog4j.formbean;
17
18 import java.io.Serializable JavaDoc;
19 import java.util.Date JavaDoc;
20
21 import javax.servlet.http.HttpServletRequest JavaDoc;
22
23 /**
24  * 用于跟踪用户登录信息的对象
25  * @author Liudong
26  */

27 public class LoginTrackBean implements Serializable JavaDoc {
28
29     int id;
30     UserForm user;
31     String JavaDoc ipAddr;
32     Date JavaDoc loginTime;
33     
34     public LoginTrackBean() {
35     }
36     
37     public LoginTrackBean(HttpServletRequest JavaDoc request) {
38         user = UserForm.getLoginUser(request);
39         ipAddr = request.getRemoteAddr();
40         loginTime = new Date JavaDoc();
41     }
42
43     public int getId() {
44         return id;
45     }
46     public void setId(int id) {
47         this.id = id;
48     }
49     public String JavaDoc getIpAddr() {
50         return ipAddr;
51     }
52     public void setIpAddr(String JavaDoc ipAddr) {
53         this.ipAddr = ipAddr;
54     }
55     public Date JavaDoc getLoginTime() {
56         return loginTime;
57     }
58     public void setLoginTime(Date JavaDoc loginTime) {
59         this.loginTime = loginTime;
60     }
61     public UserForm getUser() {
62         return user;
63     }
64     public void setUser(UserForm user) {
65         this.user = user;
66     }
67 }
68
Popular Tags