KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > jforum > dao > PrivateMessageDAO


1 /*
2  * Copyright (c) 2003, Rafael Steil
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms,
6  * with or without modification, are permitted provided
7  * that the following conditions are met:
8  * 1) Redistributions of source code must retain the above
9  * copyright notice, this list of conditions and the
10  * following disclaimer.
11  * 2) Redistributions in binary form must reproduce the
12  * above copyright notice, this list of conditions and
13  * the following disclaimer in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of "Rafael Steil" nor
16  * the names of its contributors may be used to endorse
17  * or promote products derived from this software without
18  * specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
21  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
22  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
23  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
26  * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
31  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
33  * IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
37  *
38  * This file creation date: 20/05/2004 - 15:37:25
39  * The JForum Project
40  * http://www.jforum.net
41  */

42 package net.jforum.dao;
43
44 import java.util.List JavaDoc;
45
46 import net.jforum.entities.PrivateMessage;
47 import net.jforum.entities.User;
48
49 /**
50  * @author Rafael Steil
51  * @version $Id: PrivateMessageDAO.java,v 1.4 2005/07/26 03:04:28 rafaelsteil Exp $
52  */

53 public interface PrivateMessageDAO
54 {
55     /**
56      * Send a new <code>PrivateMessage</code>
57      *
58      * @param pm The pm to add
59      * @throws Exception
60      */

61     public void send(PrivateMessage pm) throws Exception JavaDoc;
62     
63     /**
64      * Deletes a collection of private messages.
65      * Each instance should at least have the private message
66      * id and the owner user id.
67      *
68      * @param pm
69      * @throws Exception
70      */

71     public void delete(PrivateMessage[] pm) throws Exception JavaDoc;
72     
73     /**
74      * Update the type of some private message.
75      * You should pass as argument a <code>PrivateMessage</code> instance
76      * with the pm's id and the new message status. There is no need to
77      * fill the other members.
78      *
79      * @param pm The instance to update
80      * @throws Exception
81      */

82     public void updateType(PrivateMessage pm) throws Exception JavaDoc;
83     
84     /**
85      * Selects all messages from the user's inbox.
86      *
87      * @param user The user to fetch the messages
88      * @return A <code>List</code> with all messages found. Each
89      * entry is a <code>PrivateMessage</code> entry.
90      * @throws Exception
91      */

92     public List JavaDoc selectFromInbox(User user) throws Exception JavaDoc;
93     
94     /**
95      * Selects all messages from the user's sent box.
96      *
97      * @param user The user to fetch the messages
98      * @return A <code>List</code> with all messages found. Each
99      * entry is a <code>PrivateMessage</code> entry.
100      * @throws Exception
101      */

102     public List JavaDoc selectFromSent(User user) throws Exception JavaDoc;
103     
104     /**
105      * Gets a <code>PrivateMessage</code> by its id.
106      *
107      * @param pm A <code>PrivateMessage</code> instance containing the pm's id
108      * to retrieve
109      * @return The pm contents
110      * @throws Exception
111      */

112     public PrivateMessage selectById(PrivateMessage pm) throws Exception JavaDoc;
113 }
114
Popular Tags