001: /**
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: * ConsoleUserVO
022: * LPS
023: * Oct 22, 2007
024: */package com.bostechcorp.cbesb.console.common;
025:
026: import java.io.Serializable;
027: import java.util.Date;
028:
029: import com.google.gwt.user.client.rpc.IsSerializable;
030:
031: /**
032: * @author LPS
033: *
034: */
035: public class ConsoleUserInfo implements IsSerializable, Cloneable {
036:
037: // create table ConsoleUser(UserId bigint not null generated always as identity
038: // constraint pk_User primary key,
039: // Login varchar(126) not null ,
040: // Password varchar(126) not null,
041: // Type varchar(24) not null,
042: // Name varchar(126),
043: // Email varchar(64),
044: // Notes varchar(4096),
045: // LastUpdated TimeStamp not null);
046:
047: /**
048: *
049: */
050: private static final long serialVersionUID = 222029120683188063L;
051:
052: private long userId;
053: private String login;
054: private String password;
055: private String type;
056: private String name;
057: private String email;
058: private String notes;
059: private long timeout;
060: private Date lastUpdated;
061:
062: /**
063: * @return the email
064: */
065: public String getEmail() {
066: return email == null ? "" : email;
067: }
068:
069: /**
070: * @param email the email to set
071: */
072: public void setEmail(String email) {
073: this .email = email == null ? "" : email;
074: }
075:
076: /**
077: * @return the lastUpdated
078: */
079: public Date getLastUpdated() {
080: return lastUpdated;
081: }
082:
083: /**
084: * @param lastUpdated the lastUpdated to set
085: */
086: public void setLastUpdated(Date lastUpdated) {
087: this .lastUpdated = lastUpdated;
088: }
089:
090: /**
091: * @return the login
092: */
093: public String getLogin() {
094: return login;
095: }
096:
097: /**
098: * @param login the login to set
099: */
100: public void setLogin(String login) {
101: this .login = login;
102: }
103:
104: /**
105: * @return the name
106: */
107: public String getName() {
108: return name;
109: }
110:
111: /**
112: * @param name the name to set
113: */
114: public void setName(String name) {
115: this .name = name;
116: }
117:
118: /**
119: * @return the notes
120: */
121: public String getNotes() {
122: return notes;
123: }
124:
125: /**
126: * @param notes the notes to set
127: */
128: public void setNotes(String notes) {
129: this .notes = notes;
130: }
131:
132: /**
133: * @return the password
134: */
135: public String getPassword() {
136: return password;
137: }
138:
139: /**
140: * @param password the password to set
141: */
142: public void setPassword(String password) {
143: this .password = password;
144: }
145:
146: /**
147: * @return the type
148: */
149: public String getType() {
150: return type;
151: }
152:
153: /**
154: * @param type the type to set
155: */
156: public void setType(String type) {
157: this .type = type;
158: }
159:
160: /**
161: * @return the userId
162: */
163: public long getUserId() {
164: return userId;
165: }
166:
167: /**
168: * @param userId the userId to set
169: */
170: public void setUserId(long userId) {
171: this .userId = userId;
172: }
173:
174: public String toString() {
175: return "->Id=" + getUserId() + "\t| Login=" + getLogin()
176: + "\t| Password=UNABLE TO DISPLAY" + "\t| Name="
177: + getName() + "\t| Email=" + getEmail() + "\t| Notes="
178: + getNotes() + "\t| Timeout=" + getTimeout()
179: + "\t| Type=" + getType() + "\t| Timestanmp="
180: + getLastUpdated();
181: }
182:
183: public boolean equals(Object o) {
184: if (o instanceof ConsoleUserInfo) {
185: ConsoleUserInfo usr = (ConsoleUserInfo) o;
186: if (usr.getUserId() == getUserId()
187: && usr.getLogin().equals(getLogin())
188: && usr.getName().equals(getName())
189: && usr.getPassword().equals(getPassword())
190: && usr.getType().equals(getType())
191: && usr.getLastUpdated().equals(getLastUpdated())
192: && usr.getEmail().equals(getEmail())
193: && usr.getNotes().equals(getNotes()))
194: return true;
195: }
196: return false;
197: }
198:
199: public ConsoleUserInfo clone() {
200: ConsoleUserInfo user = new ConsoleUserInfo();
201: user.setEmail(getEmail());
202: user.setLastUpdated(getLastUpdated());
203: user.setLogin(getLogin());
204: user.setName(getName());
205: user.setNotes(getNotes());
206: user.setPassword(getPassword());
207: user.setType(getType());
208: user.setUserId(getUserId());
209: user.setTimeout(getTimeout());
210: return user;
211: }
212:
213: /**
214: * @return the timeout
215: */
216: public long getTimeout() {
217: return timeout;
218: }
219:
220: /**
221: * @param timeout the timeout to set
222: */
223: public void setTimeout(long timeout) {
224: this.timeout = timeout;
225: }
226: }
|