alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/ThreadDAO.java,v 1.21 2005/01/18 11:52:19 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.21 $
 * $Date: 2005/01/18 11:52:19 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 */
package com.mvnforum.db;

import java.sql.Timestamp;
import java.util.Collection;

import net.myvietnam.mvncore.exception.AssertionException;
import net.myvietnam.mvncore.exception.CreateException;
import net.myvietnam.mvncore.exception.DatabaseException;
import net.myvietnam.mvncore.exception.ObjectNotFoundException;
import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException;

public interface ThreadDAO {

    public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Thread";

    public void findByPrimaryKey(int threadID)
        throws ObjectNotFoundException, DatabaseException;

    public int createThread(int forumID, String memberName, String lastPostMemberName,
                        String threadTopic, String threadBody, int threadVoteCount,
                        int threadVoteTotalStars, Timestamp threadCreationDate, Timestamp threadLastPostDate,
                        int threadType, int threadOption, int threadStatus,
                        int threadHasPoll, int threadViewCount, int threadReplyCount,
                        String threadIcon, int threadDuration, int threadAttachCount /* to backup */)
        throws ObjectNotFoundException, CreateException, DatabaseException, ForeignKeyNotFoundException;

    public void delete(int threadID)
        throws DatabaseException, ObjectNotFoundException;

    public void delete_inForum(int forumID)
        throws DatabaseException;

    public void updateForumID(int threadID, // primary key
                               int forumID)
        throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException;

    public void updateThreadStatus(int threadID, // primary key
                                   int threadStatus)
        throws ObjectNotFoundException, DatabaseException;

    public void updateThreadType(int threadID, // primary key
                                 int threadType)
        throws ObjectNotFoundException, DatabaseException;

    public void updateTopic_Body_Icon(int threadID, // primary key
                                      String threadTopic, String threadBody, String threadIcon)
        throws ObjectNotFoundException, DatabaseException;

    public void increaseReplyCount(int threadID)
        throws DatabaseException, ObjectNotFoundException;

    public void updateLastPostMemberName(int threadID, // primary key
                                         String lastPostMemberName)
        throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException;

    public void updateLastPostDate(int threadID, // primary key
                                   Timestamp threadLastPostDate)
        throws ObjectNotFoundException, DatabaseException;

    public void updateThreadAttachCount(int threadID,
                                        int count)
        throws ObjectNotFoundException, DatabaseException;

    public ThreadBean getThread(int threadID)
        throws ObjectNotFoundException, DatabaseException;

    public int getNumberOfEnableThreads_inForum(int forumID)
        throws AssertionException, DatabaseException;

    public int getNumberOfDisableThreads_inForum(int forumID)
        throws AssertionException, DatabaseException;

    public int getNumberOfNormalEnableThreads_inForum(int forumID)
        throws AssertionException, DatabaseException;

    public int getNumberOfEnableThreads()
        throws AssertionException, DatabaseException;

    public Collection getEnableThreads_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException;

    public int getNumberOfDisableThreads()
        throws AssertionException, DatabaseException;

    public Collection getDisableBeans_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException;

    public Collection getNormalEnableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException;

    public Collection getAllEnableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException;

    public Collection getDisableThreads_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException;

    // Should Enable only ???
    public Collection getThreads_inFavorite_inMember(int memberID)
        throws DatabaseException;

    public Collection getEnableStickies_inForum(int forumID)
        throws DatabaseException;

    public Collection getEnableForumAnnouncements_inForum(int forumID)
        throws DatabaseException;

    public Collection getEnableGlobalAnnouncements()
        throws DatabaseException;

    public void increaseViewCount(int threadID)
        throws DatabaseException, ObjectNotFoundException;

    public void updateReplyCount(int threadID, // primary key
                                 int threadReplyCount)
        throws IllegalArgumentException, DatabaseException, ObjectNotFoundException;

    public int getPreviousEnableThread(int forumID, int threadID)
        throws DatabaseException, AssertionException;

    public int getNextEnableThread(int forumID, int threadID)
        throws DatabaseException, AssertionException;

    public Collection getEnableThreads_inGlobal(Timestamp sinceDate)
        throws DatabaseException;

    public Collection getEnableThreads_inCategory(int categoryID, Timestamp sinceDate)
        throws DatabaseException;

    public Collection getEnableThreads_inForum(int forumID, Timestamp sinceDate)
        throws DatabaseException;

    public Collection getEnableThreads_inThread(int threadID, Timestamp sinceDate)
        throws DatabaseException;

    public int getNumberOfEnableThreadsWithPendingPosts()
        throws AssertionException, DatabaseException;

    public int getNumberOfEnableThreadsWithPendingPosts_inForum(int forumID)
        throws AssertionException, DatabaseException;

    /**
     * This method is used to get enable threads that having at least one pending post (for moderation)
     *
     * Note: current implementation use the NOSCROLL method which is quite slow
     *
     * @param offset
     * @param rowsToReturn
     * @param sort
     * @param order
     * @return
     * @throws java.lang.IllegalArgumentException if the arguments are not valid
     * @throws DatabaseException
     */
    public Collection getEnableThreadsWithPendingPosts_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException, ObjectNotFoundException;

    public Collection getEnableThreadsWithPendingPosts_inForum_withSortSupport_limit(int forumID, int offset, int rowsToReturn, String sort, String order)
        throws IllegalArgumentException, DatabaseException, ObjectNotFoundException;

}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.