1 24 package org.riotfamily.riot.security.session; 25 26 import java.io.Serializable ; 27 import java.util.Date ; 28 29 34 public class SessionMetaData implements Serializable { 35 36 private String userId; 37 38 private String userName; 39 40 private Date loginDate; 41 42 private Date lastLoginDate; 43 44 private String loginIP; 45 46 private String lastLoginIP; 47 48 49 public SessionMetaData() { 50 } 51 52 public SessionMetaData(String userId) { 53 this.userId = userId; 54 } 55 56 void sessionStarted(String userName, String loginIP) { 57 this.userName = userName; 58 this.loginIP = loginIP; 59 this.loginDate = new Date (); 60 } 61 62 void sessionEnded() { 63 lastLoginDate = loginDate; 64 lastLoginIP = loginIP; 65 } 66 67 public String getUserId() { 68 return userId; 69 } 70 71 public void setUserId(String userId) { 72 this.userId = userId; 73 } 74 75 public String getUserName() { 76 return userName; 77 } 78 79 public void setUserName(String userName) { 80 this.userName = userName; 81 } 82 83 public Date getLastLoginDate() { 84 return lastLoginDate; 85 } 86 87 public void setLastLoginDate(Date lastLoginDate) { 88 this.lastLoginDate = lastLoginDate; 89 } 90 91 public String getLastLoginIP() { 92 return lastLoginIP; 93 } 94 95 public void setLastLoginIP(String lastLoginIP) { 96 this.lastLoginIP = lastLoginIP; 97 } 98 99 } 100 | Popular Tags |