001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/WatchBean.java,v 1.14 2007/10/18 04:36:25 lexuanttkhtn Exp $
003: * $Author: lexuanttkhtn $
004: * $Revision: 1.14 $
005: * $Date: 2007/10/18 04:36:25 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author: Minh Nguyen
039: * @author: Mai Nguyen
040: */
041: package com.mvnforum.db;
042:
043: import java.sql.Timestamp;
044:
045: /*
046: * Included columns: WatchID, MemberID, CategoryID, ForumID, ThreadID,
047: * WatchType, WatchOption, WatchStatus, WatchCreationDate, WatchLastSentDate,
048: * WatchEndDate
049: * Excluded columns:
050: */
051: public class WatchBean {
052: /*************************************************************************
053: * NOTE: below constants MUST NOT be changed IN ALL CASES,
054: * or it will break the compatibility
055: *************************************************************************/
056: public final static int WATCH_OPTION_DEFAULT = 0;
057: public final static int WATCH_OPTION_LIVE = 1;
058: public final static int WATCH_OPTION_HOURLY = 2;
059: public final static int WATCH_OPTION_DAILY = 3;
060: public final static int WATCH_OPTION_WEEKLY = 4;
061:
062: public final static int WATCH_TYPE_DEFAULT = 0;
063: public final static int WATCH_TYPE_DIGEST = 1;
064: public final static int WATCH_TYPE_NONDIGEST = 2;
065:
066: public final static int SELECT_GLOBAL_WATCH = 0;
067: public final static int SELECT_CATEGORY_WATCH = 1;
068: public final static int SELECT_FORUM_WATCH = 2;
069: public final static int SELECT_THREAD_WATCH = 3;
070:
071: private int watchID;
072: private int memberID;
073: private int categoryID;
074: private int forumID;
075: private int threadID;
076: private int watchType;
077: private int watchOption;
078: private int watchStatus;
079: private Timestamp watchCreationDate;
080: private Timestamp watchLastSentDate;
081: private Timestamp watchEndDate;
082:
083: public int getWatchID() {
084: return watchID;
085: }
086:
087: public void setWatchID(int watchID) {
088: this .watchID = watchID;
089: }
090:
091: public int getMemberID() {
092: return memberID;
093: }
094:
095: public void setMemberID(int memberID) {
096: this .memberID = memberID;
097: }
098:
099: public int getCategoryID() {
100: return categoryID;
101: }
102:
103: public void setCategoryID(int categoryID) {
104: this .categoryID = categoryID;
105: }
106:
107: public int getForumID() {
108: return forumID;
109: }
110:
111: public void setForumID(int forumID) {
112: this .forumID = forumID;
113: }
114:
115: public int getThreadID() {
116: return threadID;
117: }
118:
119: public void setThreadID(int threadID) {
120: this .threadID = threadID;
121: }
122:
123: public int getWatchType() {
124: return watchType;
125: }
126:
127: public void setWatchType(int watchType) {
128: this .watchType = watchType;
129: }
130:
131: public int getWatchOption() {
132: return watchOption;
133: }
134:
135: public void setWatchOption(int watchOption) {
136: this .watchOption = watchOption;
137: }
138:
139: public int getWatchStatus() {
140: return watchStatus;
141: }
142:
143: public void setWatchStatus(int watchStatus) {
144: this .watchStatus = watchStatus;
145: }
146:
147: public Timestamp getWatchCreationDate() {
148: return watchCreationDate;
149: }
150:
151: public void setWatchCreationDate(Timestamp watchCreationDate) {
152: this .watchCreationDate = watchCreationDate;
153: }
154:
155: public Timestamp getWatchLastSentDate() {
156: return watchLastSentDate;
157: }
158:
159: public void setWatchLastSentDate(Timestamp watchLastSentDate) {
160: this .watchLastSentDate = watchLastSentDate;
161: }
162:
163: public Timestamp getWatchEndDate() {
164: return watchEndDate;
165: }
166:
167: public void setWatchEndDate(Timestamp watchEndDate) {
168: this .watchEndDate = watchEndDate;
169: }
170:
171: // Store the ThreadBean if this is a Thread Watch
172: ThreadBean threadBean = null;
173:
174: public ThreadBean getThreadBean() {
175: return threadBean;
176: }
177:
178: public void setThreadBean(ThreadBean threadBean) {
179: this .threadBean = threadBean;
180: }
181:
182: static public void validateWatchType(int type)
183: throws IllegalArgumentException {
184: if ((type < WATCH_TYPE_DEFAULT)
185: || (type > WATCH_TYPE_NONDIGEST)) {
186: throw new IllegalArgumentException("Invalid WatchType = "
187: + type);
188: }
189: }
190:
191: static public void validateWatchOption(int option)
192: throws IllegalArgumentException {
193: if ((option < WATCH_OPTION_DEFAULT)
194: || (option > WATCH_OPTION_WEEKLY)) {
195: throw new IllegalArgumentException("Invalid WatchOption = "
196: + option);
197: }
198: }
199:
200: static public void validateWatchSelect(int select)
201: throws IllegalArgumentException {
202: if ((select < SELECT_GLOBAL_WATCH)
203: || (select > SELECT_THREAD_WATCH)) {
204: throw new IllegalArgumentException("Invalid WatchSelect = "
205: + select);
206: }
207: }
208:
209: } //end of class WatchBean
|