KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > MessageDAO


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageDAO.java,v 1.30 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.30 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  * @author: Mai Nguyen
40  */

41 package com.mvnforum.db;
42
43 import java.sql.Timestamp JavaDoc;
44 import java.util.Collection JavaDoc;
45
46 import net.myvietnam.mvncore.exception.*;
47
48 public interface MessageDAO {
49
50     public static final String JavaDoc TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Message";
51
52     public void findByPrimaryKey(int messageID)
53         throws ObjectNotFoundException, DatabaseException;
54
55     public int create(String JavaDoc folderName, int memberID, int messageSenderID,
56                       String JavaDoc messageSenderName, String JavaDoc messageToList, String JavaDoc messageCcList,
57                       String JavaDoc messageBccList, String JavaDoc messageTopic, String JavaDoc messageBody,
58                       int messageType, int messageOption, int messageStatus,
59                       int messageReadStatus, int messageNotify, String JavaDoc messageIcon,
60                       int messageAttachCount, String JavaDoc messageIP, Timestamp JavaDoc messageCreationDate)
61         throws CreateException, DatabaseException, ForeignKeyNotFoundException;
62
63     // This method is used to get all messages for delete all messages (include public) in folder
64
public Collection JavaDoc getAllMessages_inMember_inFolder_withSortSupport_limit(int memberID, String JavaDoc folderName, int offset, int rowsToReturn, String JavaDoc sort, String JavaDoc order)
65         throws IllegalArgumentException JavaDoc, DatabaseException;
66
67     // This method is used to list Non public messages in MyMessage
68
public Collection JavaDoc getNonPublicMessages_inMember_inFolder_withSortSupport_limit(int memberID, String JavaDoc folderName, int offset, int rowsToReturn, String JavaDoc sort, String JavaDoc order)
69         throws IllegalArgumentException JavaDoc, DatabaseException;
70
71     public MessageBean getMessage(int messageID)
72         throws ObjectNotFoundException, DatabaseException;
73
74     public int getNumberOfNonPublicMessages_inMember(int memberID)
75         throws AssertionException, DatabaseException;
76
77     public void updateMessageReadStatus(int messageID, int memberID, int messageReadStatus)
78         throws ObjectNotFoundException, DatabaseException;
79
80     public void deleteMessage(int messageID, int memberID)
81         throws DatabaseException, ObjectNotFoundException;
82
83     public void deleteSenderMessages(int senderID)
84         throws DatabaseException;
85
86     //@todo: should we update also based on MemberID ???
87
public void updateAttachCount(int messageID, // primary key
88
int messageAttachCount)
89         throws ObjectNotFoundException, DatabaseException;
90
91     public void updateFolderName(int messageID, // primary key
92
int memberID, String JavaDoc folderName)
93         throws ObjectNotFoundException, DatabaseException;
94
95     public void deleteMessages_inFolderName_inMember(String JavaDoc folderName, int memberID)
96         throws DatabaseException;
97
98     public Collection JavaDoc getPublicMessages()
99         throws DatabaseException ;
100
101     public int getNumberOfNonPublicMessages_inMember_inFolder(int memberID, String JavaDoc folderName)
102         throws AssertionException, DatabaseException;
103
104     public int getNumberOfUnreadNonPublicMessages_inMember_inFolder(int memberID, String JavaDoc folderName)
105         throws AssertionException, DatabaseException;
106
107     public int getNumberOfAllMessages_inMember_inFolder(int memberID, String JavaDoc folderName)
108         throws AssertionException, DatabaseException;
109
110     public int getNumberOfUnreadAllMessages_inMember_inFolder(int memberID, String JavaDoc folderName)
111         throws AssertionException, DatabaseException;
112
113 }
114
Popular Tags