001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageDAO.java,v 1.34 2007/12/17 09:09:40 minhnn Exp $
003: * $Author: minhnn $
004: * $Revision: 1.34 $
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.exception.*;
047:
048: public interface MessageDAO {
049:
050: public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX
051: + "Message";
052:
053: public void findByPrimaryKey(int messageID)
054: throws ObjectNotFoundException, DatabaseException;
055:
056: public int create(String folderName, int memberID,
057: int messageSenderID, String messageSenderName,
058: String messageToList, String messageCcList,
059: String messageBccList, String messageTopic,
060: String messageBody, int messageType, int messageOption,
061: int messageStatus, int messageReadStatus,
062: int messageNotify, String messageIcon,
063: int messageAttachCount, String messageIP,
064: Timestamp messageCreationDate) throws CreateException,
065: DatabaseException, ForeignKeyNotFoundException;
066:
067: // This method is used to get all messages for delete all messages (include public) in folder
068: public Collection getAllMessages_inMember_inFolder_withSortSupport_limit(
069: int memberID, String folderName, int offset,
070: int rowsToReturn, String sort, String order)
071: throws IllegalArgumentException, DatabaseException;
072:
073: // This method is used to list Non public messages in MyMessage
074: public Collection getNonPublicMessages_inMember_inFolder_withSortSupport_limit(
075: int memberID, String folderName, int offset,
076: int rowsToReturn, String sort, String order)
077: throws IllegalArgumentException, DatabaseException;
078:
079: public MessageBean getMessage(int messageID)
080: throws ObjectNotFoundException, DatabaseException;
081:
082: public int getNumberOfNonPublicMessages_inMember(int memberID)
083: throws DatabaseException;
084:
085: public void updateMessageReadStatus(int messageID, int memberID,
086: int messageReadStatus) throws ObjectNotFoundException,
087: DatabaseException;
088:
089: public void deleteMessage(int messageID, int memberID)
090: throws DatabaseException, ObjectNotFoundException;
091:
092: public void deleteSenderMessages(int senderID)
093: throws DatabaseException;
094:
095: //@todo: should we update also based on MemberID ???
096: public void updateAttachCount(int messageID, // primary key
097: int messageAttachCount) throws ObjectNotFoundException,
098: DatabaseException;
099:
100: public void updateFolderName(int messageID, // primary key
101: int memberID, String folderName)
102: throws ObjectNotFoundException, DatabaseException;
103:
104: public void deleteMessages_inFolderName_inMember(String folderName,
105: int memberID) throws DatabaseException;
106:
107: public Collection getPublicMessages() throws DatabaseException;
108:
109: public int getNumberOfNonPublicMessages_inMember_inFolder(
110: int memberID, String folderName) throws DatabaseException;
111:
112: public int getNumberOfUnreadNonPublicMessages_inMember_inFolder(
113: int memberID, String folderName) throws DatabaseException;
114:
115: public int getNumberOfAllMessages_inMember_inFolder(int memberID,
116: String folderName) throws DatabaseException;
117:
118: public int getNumberOfUnreadAllMessages_inMember_inFolder(
119: int memberID, String folderName) throws DatabaseException;
120:
121: }
|