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.common.util.runtimedb.vo;
025:
026: import java.io.Serializable;
027: import java.util.Date;
028:
029: /**
030: * @author LPS
031: *
032: */
033: public class ConsoleUserVO implements Serializable, Cloneable {
034: // create table ConsoleUser(UserId bigint not null generated always as identity
035: // constraint pk_User primary key,
036: // Login varchar(126) not null ,
037: // Password varchar(126) not null,
038: // Type varchar(24) not null,
039: // Name varchar(126),
040: // Email varchar(64),
041: // Notes varchar(4096),
042: // LastUpdated TimeStamp not null);
043:
044: /**
045: *
046: */
047: private static final long serialVersionUID = 222029120683188063L;
048:
049: private long userId;
050: private String login;
051: private String password;
052: private String type;
053: private String name;
054: private String email;
055: private String notes;
056: private long timeout;
057: private Date lastUpdated;
058:
059: /**
060: * @return the email
061: */
062: public String getEmail() {
063: return email == null ? "" : email;
064: }
065:
066: /**
067: * @param email the email to set
068: */
069: public void setEmail(String email) {
070: this .email = email == null ? "" : email;
071: }
072:
073: /**
074: * @return the lastUpdated
075: */
076: public Date getLastUpdated() {
077: return lastUpdated;
078: }
079:
080: /**
081: * @param lastUpdated the lastUpdated to set
082: */
083: public void setLastUpdated(Date lastUpdated) {
084: this .lastUpdated = lastUpdated;
085: }
086:
087: /**
088: * @return the login
089: */
090: public String getLogin() {
091: return login;
092: }
093:
094: /**
095: * @param login the login to set
096: */
097: public void setLogin(String login) {
098: this .login = login;
099: }
100:
101: /**
102: * @return the name
103: */
104: public String getName() {
105: return name;
106: }
107:
108: /**
109: * @param name the name to set
110: */
111: public void setName(String name) {
112: this .name = name;
113: }
114:
115: /**
116: * @return the notes
117: */
118: public String getNotes() {
119: return notes;
120: }
121:
122: /**
123: * @param notes the notes to set
124: */
125: public void setNotes(String notes) {
126: this .notes = notes;
127: }
128:
129: /**
130: * @return the password
131: */
132: public String getPassword() {
133: return password;
134: }
135:
136: /**
137: * @param password the password to set
138: */
139: public void setPassword(String password) {
140: this .password = password;
141: }
142:
143: /**
144: * @return the type
145: */
146: public String getType() {
147: return type;
148: }
149:
150: /**
151: * @param type the type to set
152: */
153: public void setType(String type) {
154: this .type = type;
155: }
156:
157: /**
158: * @return the userId
159: */
160: public long getUserId() {
161: return userId;
162: }
163:
164: /**
165: * @param userId the userId to set
166: */
167: public void setUserId(long userId) {
168: this .userId = userId;
169: }
170:
171: public String toString() {
172: return "->Id=" + getUserId() + "\t| Login=" + getLogin()
173: + "\t| Password=UNABLE TO DISPLAY" + "\t| Name="
174: + getName() + "\t| Email=" + getEmail() + "\t| Notes="
175: + getNotes() + "\t| Timeout=" + getTimeout()
176: + "\t| Type=" + getType() + "\t| Timestanmp="
177: + getLastUpdated();
178: }
179:
180: public boolean equals(Object o) {
181: if (o instanceof ConsoleUserVO) {
182: ConsoleUserVO usr = (ConsoleUserVO) o;
183: if (usr.getUserId() == getUserId()
184: && usr.getLogin().equals(getLogin())
185: && usr.getName().equals(getName())
186: && usr.getPassword().equals(getPassword())
187: && usr.getType().equals(getType())
188: && usr.getLastUpdated().equals(getLastUpdated())
189: && usr.getEmail().equals(getEmail())
190: && usr.getNotes().equals(getNotes()))
191: return true;
192: }
193: return false;
194: }
195:
196: public ConsoleUserVO clone() {
197: ConsoleUserVO user = new ConsoleUserVO();
198: user.setEmail(getEmail());
199: user.setLastUpdated(getLastUpdated());
200: user.setLogin(getLogin());
201: user.setName(getName());
202: user.setNotes(getNotes());
203: user.setPassword(getPassword());
204: user.setType(getType());
205: user.setUserId(getUserId());
206: user.setTimeout(getTimeout());
207: return user;
208: }
209:
210: /**
211: * @return the timeout
212: */
213: public long getTimeout() {
214: return timeout;
215: }
216:
217: /**
218: * @param timeout the timeout to set
219: */
220: public void setTimeout(long timeout) {
221: this.timeout = timeout;
222: }
223: }
|