KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > business > mail > message > MessageNotFoundException


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: MessageNotFoundException.java,v $
31  * Revision 1.2 2005/04/09 17:20:01 colinmacleod
32  * Changed copyright text to GPL v2 explicitly.
33  *
34  * Revision 1.1.1.1 2005/03/10 17:51:17 colinmacleod
35  * Restructured ivata op around Hibernate/PicoContainer.
36  * Renamed ivata groupware.
37  *
38  * Revision 1.5 2004/11/12 15:57:25 colinmacleod
39  * Removed dependencies on SSLEXT.
40  * Moved Persistence classes to ivata masks.
41  *
42  * Revision 1.4 2004/07/13 19:48:12 colinmacleod
43  * Moved project to POJOs from EJBs.
44  * Applied PicoContainer to services layer (replacing session EJBs).
45  * Applied Hibernate to persistence layer (replacing entity EJBs).
46  *
47  * Revision 1.3 2004/03/21 21:16:39 colinmacleod
48  * Shortened name to ivata op.
49  *
50  * Revision 1.2 2004/02/01 22:07:32 colinmacleod
51  * Added full names to author tags
52  *
53  * Revision 1.1.1.1 2004/01/27 20:59:57 colinmacleod
54  * Moved ivata openportal to SourceForge..
55  *
56  * Revision 1.2 2003/10/15 14:11:33 colin
57  * fixing for XDoclet
58  *
59  * Revision 1.1 2003/02/24 19:09:24 colin
60  * moved to business
61  *
62  * Revision 1.3 2003/02/04 17:39:21 colin
63  * copyright notice
64  *
65  * Revision 1.2 2002/11/19 14:12:16 colin
66  * added 'additional information' constructor
67  *
68  * Revision 1.1 2002/11/12 09:11:28 colin
69  * added with restructuring of mail subsystem
70  * -----------------------------------------------------------------------------
71  */

72 package com.ivata.groupware.business.mail.message;
73
74 import com.ivata.mask.util.SystemException;
75
76
77 /**
78  * <p>Thrown by {@link com.ivata.groupware.business.mail.MailBean MailBean} if there is
79  * a requested mail cannot be located.</p>
80  *
81  * @since 2002-11-10
82  * @author Colin MacLeod
83  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
84  * @version $Revision: 1.2 $
85  */

86 public class MessageNotFoundException extends SystemException {
87     /**
88      * <p>Creates a new <code>MailNotFoundException</code> using the given
89      * details about the message which could not be found.</p>
90      *
91      * @param folderName the name of the folder where the message was being
92      * looked for.
93      * @param messageId the unique identifier of the message which could not be
94      * found.
95      */

96     public MessageNotFoundException(String JavaDoc folderName, String JavaDoc messageId) {
97         this (folderName, messageId, (Throwable JavaDoc)null);
98     }
99     /**
100      * <p>Creates a new <code>MailNotFoundException</code> using the given
101      * details about the message which could not be found.</p>
102      *
103      * @param folderName the name of the folder where the message was being
104      * looked for.
105      * @param messageId the unique identifier of the message which could not be
106      * found.
107      * @param cause root exception which caused this to happen.
108      */

109     public MessageNotFoundException(String JavaDoc folderName, String JavaDoc messageId,
110             Throwable JavaDoc cause) {
111         super("ERROR in Mail: no message with id '"
112                 + messageId
113                 + "' in folder '"
114                 + folderName
115                 + "'.",
116                 cause);
117     }
118
119     /**
120      * <p>Creates a new <code>MailNotFoundException</code> using the given
121      * details about the message which could not be found. This constructor
122      * provides extra information about a message which could not be located due
123      * to programming or configuration errors.</p>
124      *
125      * @param folderName the name of the folder where the message was being
126      * looked for.
127      * @param messageId the unique identifier of the message which could not be
128      * found.
129      * @param additionalInformation a clear message indicating an additional
130      * cause of the exception (such as "this folder does not exist").
131      */

132     public MessageNotFoundException(String JavaDoc folderName, String JavaDoc messageId,
133             String JavaDoc additionalInformation) {
134         this (folderName, messageId, additionalInformation, null);
135     }
136     /**
137      * <p>Creates a new <code>MailNotFoundException</code> using the given
138      * details about the message which could not be found. This constructor
139      * provides extra information about a message which could not be located due
140      * to programming or configuration errors.</p>
141      *
142      * @param folderName the name of the folder where the message was being
143      * looked for.
144      * @param messageId the unique identifier of the message which could not be
145      * found.
146      * @param additionalInformation a clear message indicating an additional
147      * cause of the exception (such as "this folder does not exist").
148      */

149     public MessageNotFoundException(String JavaDoc folderName, String JavaDoc messageId,
150             String JavaDoc additionalInformation, Throwable JavaDoc cause) {
151         super("ERROR in Mail: could not retrieve message '"
152                 + messageId
153                 + "' from folder '"
154                 + folderName
155                 + "': "
156                 + additionalInformation
157                 + ".",
158                 cause);
159     }
160 }
161
Popular Tags