Source Code Cross Referenced for User.java in  » Content-Management-System » contineo » org » contineo » core » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » contineo » org.contineo.core.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.contineo.core.security;
002:
003:        import java.io.Serializable;
004:        import java.util.HashSet;
005:        import java.util.Iterator;
006:        import java.util.Set;
007:
008:        import org.apache.commons.lang.builder.ReflectionToStringBuilder;
009:        import org.contineo.core.CryptBean;
010:
011:        /**
012:         * This class represents a user.
013:         * 
014:         * @author Michael Scholz
015:         * @author Marco Meschieri
016:         * @version 1.0
017:         */
018:        public class User implements  Serializable {
019:
020:            private static final long serialVersionUID = 8093874904302301982L;
021:
022:            private String userName = "";
023:
024:            private String password = "";
025:
026:            private String name = "";
027:
028:            private String firstName = "";
029:
030:            private String street = "";
031:
032:            private String postalcode = "";
033:
034:            private String city = "";
035:
036:            private String country = "";
037:
038:            private String language = "";
039:
040:            private String email = "";
041:
042:            private String telephone = "";
043:
044:            private Set<Group> groups = new HashSet<Group>();
045:
046:            private String[] groupNames;
047:
048:            // Only for GUI
049:            private String repass;
050:
051:            public User() {
052:            }
053:
054:            public String getRepass() {
055:                return repass;
056:            }
057:
058:            public void setRepass(String repass) {
059:                this .repass = repass;
060:            }
061:
062:            public String getUserName() {
063:                return userName;
064:            }
065:
066:            public String getPassword() {
067:                return password;
068:            }
069:
070:            public String getName() {
071:                return name;
072:            }
073:
074:            public String getFirstName() {
075:                return firstName;
076:            }
077:
078:            public String getStreet() {
079:                return street;
080:            }
081:
082:            public String getPostalcode() {
083:                return postalcode;
084:            }
085:
086:            public String getCity() {
087:                return city;
088:            }
089:
090:            public String getCountry() {
091:                return country;
092:            }
093:
094:            public String getLanguage() {
095:                return language;
096:            }
097:
098:            public String getEmail() {
099:                return email;
100:            }
101:
102:            public String getTelephone() {
103:                return telephone;
104:            }
105:
106:            public String[] getGroupNames() {
107:                return groupNames;
108:            }
109:
110:            public void setUserName(String uname) {
111:                userName = uname;
112:            }
113:
114:            public void setPassword(String pwd) {
115:                password = pwd;
116:            }
117:
118:            /**
119:             * Sets the password and encode it
120:             * 
121:             * @param pwd The password in readable format
122:             */
123:            public void setDecodedPassword(String pwd) {
124:                if ((pwd != null) && !pwd.trim().equals("")) {
125:                    password = CryptBean.cryptString(pwd);
126:                }
127:            }
128:
129:            public String getDecodedPassword() {
130:                return password;
131:            }
132:
133:            public void setName(String nm) {
134:                name = nm;
135:            }
136:
137:            public void setFirstName(String fname) {
138:                firstName = fname;
139:            }
140:
141:            public void setStreet(String str) {
142:                street = str;
143:            }
144:
145:            public void setPostalcode(String pc) {
146:                postalcode = pc;
147:            }
148:
149:            public void setCity(String ct) {
150:                city = ct;
151:            }
152:
153:            public void setCountry(String cnt) {
154:                country = cnt;
155:            }
156:
157:            public void setLanguage(String lang) {
158:                language = lang;
159:            }
160:
161:            public void setEmail(String mail) {
162:                email = mail;
163:            }
164:
165:            public void setTelephone(String phone) {
166:                telephone = phone;
167:            }
168:
169:            public void setGroupNames(String[] grp) {
170:                groupNames = grp;
171:            }
172:
173:            public void initGroupNames() {
174:                try {
175:                    groupNames = new String[groups.size()];
176:
177:                    Iterator iter = groups.iterator();
178:                    int i = 0;
179:
180:                    while (iter.hasNext()) {
181:                        Group ug = (Group) iter.next();
182:                        groupNames[i] = ug.getGroupName();
183:                        i++;
184:                    }
185:                } catch (Exception e) {
186:                    ;
187:                }
188:            }
189:
190:            public void reset() {
191:                userName = "";
192:                password = "";
193:                name = "";
194:                firstName = "";
195:                street = "";
196:                postalcode = "";
197:                city = "";
198:                country = "";
199:                language = "";
200:                email = "";
201:                telephone = "";
202:                groups = new HashSet<Group>();
203:                groupNames = null;
204:            }
205:
206:            public String toString() {
207:                // return ReflectionToStringBuilder.toString(this);
208:                return (new ReflectionToStringBuilder(this ) {
209:                    protected boolean accept(java.lang.reflect.Field f) {
210:                        return super .accept(f);
211:                    } // end method accept
212:                }).toString();
213:            }
214:
215:            @Override
216:            public boolean equals(Object obj) {
217:                if (!(obj instanceof  User))
218:                    return false;
219:
220:                User other = (User) obj;
221:                return other.getUserName().equals(this .getUserName());
222:            }
223:
224:            @Override
225:            public int hashCode() {
226:                return userName.hashCode();
227:            }
228:
229:            public Set<Group> getGroups() {
230:                return groups;
231:            }
232:
233:            public void setGroups(Set<Group> groups) {
234:                this.groups = groups;
235:            }
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.