001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.blog.database;
031:
032: import org.blojsom.blog.User;
033:
034: import java.util.Date;
035: import java.util.Map;
036: import java.util.HashMap;
037: import java.io.Serializable;
038:
039: /**
040: * DatabaseUser
041: *
042: * @author David Czarnecki
043: * @version $Id: DatabaseUser.java,v 1.6 2007/01/17 02:35:16 czarneckid Exp $
044: * @since blojsom 3.0
045: */
046: public class DatabaseUser implements User, Serializable {
047:
048: protected Integer _id;
049: protected Integer _blogId;
050: protected String _userLogin;
051: protected String _userPassword;
052: protected String _userName;
053: protected String _userEmail;
054: protected String _userStatus;
055: protected Date _userRegistered;
056: protected Map _metaData;
057:
058: /**
059: * Create a new instance of the database user
060: */
061: public DatabaseUser() {
062: }
063:
064: /**
065: * Get the user ID
066: *
067: * @return User ID
068: */
069: public Integer getId() {
070: return _id;
071: }
072:
073: /**
074: * Set the user ID
075: *
076: * @param id User ID
077: */
078: public void setId(Integer id) {
079: _id = id;
080: }
081:
082: /**
083: * Get the blog ID
084: *
085: * @return Blog ID
086: */
087: public Integer getBlogId() {
088: return _blogId;
089: }
090:
091: /**
092: * Set the blog ID
093: *
094: * @param blogId Blog ID
095: */
096: public void setBlogId(Integer blogId) {
097: _blogId = blogId;
098: }
099:
100: /**
101: * Get the user login
102: *
103: * @return User login
104: */
105: public String getUserLogin() {
106: return _userLogin;
107: }
108:
109: /**
110: * Set the user login
111: *
112: * @param userLogin User login
113: */
114: public void setUserLogin(String userLogin) {
115: _userLogin = userLogin;
116: }
117:
118: /**
119: * Get the password
120: *
121: * @return Password
122: */
123: public String getUserPassword() {
124: return _userPassword;
125: }
126:
127: /**
128: * Set the password
129: *
130: * @param userPassword Password
131: */
132: public void setUserPassword(String userPassword) {
133: _userPassword = userPassword;
134: }
135:
136: /**
137: * Get the user name
138: *
139: * @return User name
140: */
141: public String getUserName() {
142: return _userName;
143: }
144:
145: /**
146: * Set the user name
147: *
148: * @param userName User name
149: */
150: public void setUserName(String userName) {
151: _userName = userName;
152: }
153:
154: /**
155: * Get the user e-mail
156: *
157: * @return User e-mail
158: */
159: public String getUserEmail() {
160: return _userEmail;
161: }
162:
163: /**
164: * Set the user e-mail
165: *
166: * @param userEmail User e-mail
167: */
168: public void setUserEmail(String userEmail) {
169: _userEmail = userEmail;
170: }
171:
172: /**
173: * Get the user registered date
174: *
175: * @return User registered date
176: */
177: public Date getUserRegistered() {
178: return _userRegistered;
179: }
180:
181: /**
182: * Set the user registered date
183: *
184: * @param userRegistered User registered date
185: */
186: public void setUserRegistered(Date userRegistered) {
187: _userRegistered = userRegistered;
188: }
189:
190: /**
191: * Get the user status
192: *
193: * @return User status
194: */
195: public String getUserStatus() {
196: return _userStatus;
197: }
198:
199: /**
200: * Set the user status
201: *
202: * @param userStatus User status
203: */
204: public void setUserStatus(String userStatus) {
205: _userStatus = userStatus;
206: }
207:
208: /**
209: * Get the meta-data
210: *
211: * @return Meta-data
212: */
213: public Map getMetaData() {
214: if (_metaData == null) {
215: return new HashMap();
216: }
217:
218: return _metaData;
219: }
220:
221: /**
222: * Set the meta-data
223: *
224: * @param metaData Meta-data
225: */
226: public void setMetaData(Map metaData) {
227: _metaData = metaData;
228: }
229: }
|