Source Code Cross Referenced for ThreadBean.java in  » Forum » mvnforum-1.1 » com » mvnforum » db » 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 » Forum » mvnforum 1.1 » com.mvnforum.db 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/ThreadBean.java,v 1.26 2007/12/17 09:09:40 minhnn Exp $
003:         * $Author: minhnn $
004:         * $Revision: 1.26 $
005:         * $Date: 2007/12/17 09:09:40 $
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:        import java.util.Collection;
045:
046:        import net.myvietnam.mvncore.util.StringUtil;
047:
048:        /*
049:         * Included columns: ThreadID, ForumID, MemberName, LastPostMemberName, ThreadTopic,
050:         *                   ThreadBody, ThreadVoteCount, ThreadVoteTotalStars, ThreadCreationDate, ThreadLastPostDate,
051:         *                   ThreadType, ThreadOption, ThreadStatus, ThreadHasPoll, ThreadViewCount,
052:         *                   ThreadReplyCount, ThreadIcon, ThreadDuration
053:         * Excluded columns:
054:         */
055:        public class ThreadBean {
056:            /*************************************************************************
057:             * NOTE: below constants MUST NOT be changed IN ALL CASES,
058:             *       or it will break the compatibility
059:             *************************************************************************/
060:            /**
061:             * The default value mean thread is enable and normal
062:             */
063:            public final static int THREAD_STATUS_DEFAULT = 0;
064:
065:            /**
066:             * The disable thread is invisible for normal user and visible to moderator
067:             */
068:            public final static int THREAD_STATUS_DISABLED = 1;
069:
070:            /**
071:             * No changes (edit, attach, reply) could be maded, moderator
072:             * have to change this status before making any changes is possible
073:             */
074:            public final static int THREAD_STATUS_LOCKED = 2;
075:
076:            /**
077:             * Noone can reply, but moderator can change it.
078:             */
079:            public final static int THREAD_STATUS_CLOSED = 3;
080:
081:            /**
082:             * Thread type is traditional
083:             */
084:            public final static int THREAD_TYPE_DEFAULT = 0;
085:
086:            public final static int THREAD_TYPE_STICKY = 1;
087:
088:            public final static int THREAD_TYPE_FORUM_ANNOUNCEMENT = 2;
089:
090:            public final static int THREAD_TYPE_GLOBAL_ANNOUNCEMENT = 3;
091:
092:            public final static int THREAD_PRIORITY_NORMAL = 0;
093:
094:            public final static int THREAD_PRIORITY_LOW = 1;
095:
096:            public final static int THREAD_PRIORITY_HIGH = 2;
097:
098:            private int threadID;
099:            private int forumID;
100:            private String memberName;
101:            private String lastPostMemberName;
102:            private String threadTopic;
103:            private String threadBody;
104:            private int threadVoteCount;
105:            private int threadVoteTotalStars;
106:            private Timestamp threadCreationDate;
107:            private Timestamp threadLastPostDate;
108:            private int threadType;
109:            private int threadOption;
110:            private int threadStatus;
111:            private int threadHasPoll;
112:            private int threadViewCount;
113:            private int threadReplyCount;
114:            private String threadIcon;
115:            private int threadDuration;
116:            private int threadAttachCount;
117:            private int threadPriority;
118:
119:            public int getThreadID() {
120:                return threadID;
121:            }
122:
123:            public void setThreadID(int threadID) {
124:                this .threadID = threadID;
125:            }
126:
127:            public int getForumID() {
128:                return forumID;
129:            }
130:
131:            public void setForumID(int forumID) {
132:                this .forumID = forumID;
133:            }
134:
135:            public String getMemberName() {
136:                return memberName;
137:            }
138:
139:            public void setMemberName(String memberName) {
140:                this .memberName = memberName;
141:            }
142:
143:            public String getLastPostMemberName() {
144:                return lastPostMemberName;
145:            }
146:
147:            public void setLastPostMemberName(String lastPostMemberName) {
148:                this .lastPostMemberName = lastPostMemberName;
149:            }
150:
151:            public String getThreadTopic() {
152:                return threadTopic;
153:            }
154:
155:            public void setThreadTopic(String threadTopic) {
156:                this .threadTopic = threadTopic;
157:            }
158:
159:            public String getThreadBody() {
160:                return threadBody;
161:            }
162:
163:            public void setThreadBody(String threadBody) {
164:                this .threadBody = threadBody;
165:            }
166:
167:            public int getThreadVoteCount() {
168:                return threadVoteCount;
169:            }
170:
171:            public void setThreadVoteCount(int threadVoteCount) {
172:                this .threadVoteCount = threadVoteCount;
173:            }
174:
175:            public int getThreadVoteTotalStars() {
176:                return threadVoteTotalStars;
177:            }
178:
179:            public void setThreadVoteTotalStars(int threadVoteTotalStars) {
180:                this .threadVoteTotalStars = threadVoteTotalStars;
181:            }
182:
183:            public Timestamp getThreadCreationDate() {
184:                return threadCreationDate;
185:            }
186:
187:            public void setThreadCreationDate(Timestamp threadCreationDate) {
188:                this .threadCreationDate = threadCreationDate;
189:            }
190:
191:            public Timestamp getThreadLastPostDate() {
192:                return threadLastPostDate;
193:            }
194:
195:            public void setThreadLastPostDate(Timestamp threadLastPostDate) {
196:                this .threadLastPostDate = threadLastPostDate;
197:            }
198:
199:            public int getThreadPriority() {
200:                return threadPriority;
201:            }
202:
203:            public void setThreadPriority(int threadPriority) {
204:                this .threadPriority = threadPriority;
205:            }
206:
207:            public int getThreadType() {
208:                return threadType;
209:            }
210:
211:            public void setThreadType(int threadType) {
212:                this .threadType = threadType;
213:            }
214:
215:            public int getThreadOption() {
216:                return threadOption;
217:            }
218:
219:            public void setThreadOption(int threadOption) {
220:                this .threadOption = threadOption;
221:            }
222:
223:            public int getThreadStatus() {
224:                return threadStatus;
225:            }
226:
227:            public void setThreadStatus(int threadStatus) {
228:                this .threadStatus = threadStatus;
229:            }
230:
231:            public int getThreadHasPoll() {
232:                return threadHasPoll;
233:            }
234:
235:            public void setThreadHasPoll(int threadHasPoll) {
236:                this .threadHasPoll = threadHasPoll;
237:            }
238:
239:            public int getThreadViewCount() {
240:                return threadViewCount;
241:            }
242:
243:            public void setThreadViewCount(int threadViewCount) {
244:                this .threadViewCount = threadViewCount;
245:            }
246:
247:            public int getThreadReplyCount() {
248:                return threadReplyCount;
249:            }
250:
251:            public void setThreadReplyCount(int threadReplyCount) {
252:                this .threadReplyCount = threadReplyCount;
253:            }
254:
255:            public String getThreadIcon() {
256:                return threadIcon;
257:            }
258:
259:            public void setThreadIcon(String threadIcon) {
260:                this .threadIcon = StringUtil.getEmptyStringIfNull(threadIcon);
261:            }
262:
263:            public int getThreadDuration() {
264:                return threadDuration;
265:            }
266:
267:            public void setThreadDuration(int threadDuration) {
268:                this .threadDuration = threadDuration;
269:            }
270:
271:            public int getThreadAttachCount() {
272:                return this .threadAttachCount;
273:            }
274:
275:            public void setThreadAttachCount(int attachCount) {
276:                this .threadAttachCount = attachCount;
277:            }
278:
279:            /************************************************
280:             * Customized methods come below
281:             ************************************************/
282:            private int threadPendingPostCount;
283:
284:            public int getThreadPendingPostCount() {
285:                return threadPendingPostCount;
286:            }
287:
288:            public void setThreadPendingPostCount(int threadPendingPostCount) {
289:                this .threadPendingPostCount = threadPendingPostCount;
290:            }
291:
292:            private Collection pendingPosts;
293:
294:            public Collection getPendingPosts() {
295:                return pendingPosts;
296:            }
297:
298:            public void setPendingPosts(Collection pendingPosts) {
299:                this .pendingPosts = pendingPosts;
300:            }
301:
302:            static public void validateThreadStatus(int status)
303:                    throws IllegalArgumentException {
304:                if ((status < THREAD_TYPE_DEFAULT)
305:                        || (status > THREAD_STATUS_CLOSED)) {
306:                    throw new IllegalArgumentException(
307:                            "Invalid ThreadStatus = " + status);
308:                }
309:            }
310:
311:            static public void validateThreadType(int type)
312:                    throws IllegalArgumentException {
313:                if ((type < THREAD_TYPE_DEFAULT)
314:                        || (type > THREAD_TYPE_GLOBAL_ANNOUNCEMENT)) {
315:                    throw new IllegalArgumentException("Invalid ThreadType = "
316:                            + type);
317:                }
318:            }
319:
320:            public void ensureStatusCanReply() throws IllegalArgumentException {
321:                if ((getThreadStatus() == ThreadBean.THREAD_STATUS_LOCKED)
322:                        || (getThreadStatus() == ThreadBean.THREAD_STATUS_CLOSED)) {
323:                    // or we can throw AssertionError. indicate that the gui MUST hide the option
324:                    //@todo : localize me
325:                    throw new IllegalStateException(
326:                            "Cannot reply when the thread is closed or locked.");
327:                }
328:            }
329:
330:            public void ensureStatusCanEdit() throws IllegalArgumentException {
331:                if (getThreadStatus() == ThreadBean.THREAD_STATUS_LOCKED) {
332:                    // or we can throw AssertionError. indicate that the gui MUST hide the option
333:                    //@todo : localize me
334:                    throw new IllegalStateException(
335:                            "Cannot edit post when the thread is locked.");
336:                }
337:            }
338:
339:        } //end of class ThreadBean
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.