KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > webapps > addressbook > User


1 package org.jahia.webapps.addressbook;
2
3 import java.util.*;
4
5
6 /**
7  * Holds details of the current logged user, and the current period worked on
8  * by the user (read "worked on" as: "performing actions within the
9  * application").
10  * Details of the user include: login and role.
11  * It is intended that an instance of this class should be placed
12  * in the user's HTTP session.
13  *
14  * @author <a HREF="mailto:boury@mycomponents.com">Stephane Boury</a>
15  * @version 1.0
16  * @see Period
17  */

18 public class User {
19
20     private int id=0;
21     /** the login of this User */
22     private String JavaDoc login = "";
23
24     private String JavaDoc last_name;
25     private String JavaDoc first_name;
26     private String JavaDoc email;
27     private String JavaDoc password;
28
29     /**
30         * Default constructor required by OJB
31         */

32        public User(){
33
34            // accept default values
35
}
36
37
38        public User(int id, String JavaDoc login, String JavaDoc password, String JavaDoc lastname) {
39
40       this.id = id;
41       this.password= password;
42       this.login = login;
43       this.last_name=lastname;
44     }
45
46
47
48
49     /**
50      * Sets the login for this <code>User</code>.
51      *
52      * @param login the new login
53      */

54     public void setLogin(String JavaDoc login) {
55         this.login = login;
56
57     }
58
59     /**
60      * Gets the login of this <code>User</code>.
61      *
62      * @return the <code>User</code> login
63      */

64     public String JavaDoc getLogin() {
65         return login;
66     }
67
68     public int getId() {
69         return id;
70     }
71     public void setId(int id) {
72            this.id =id;
73        }
74
75
76
77
78   public String JavaDoc getPassword() {
79     return password;
80   }
81   public void setPassword(String JavaDoc password) {
82     this.password = password;
83   }
84 }
85
Popular Tags