KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > security > ExtensionException


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.security;
21
22 import com.sslexplorer.core.CoreException;
23
24
25 /**
26  * Specialisation of {@link CoreException} for exceptions generate during
27  * use of <i>Extensions</i>.
28  *
29  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
30  */

31 public class ExtensionException extends CoreException {
32     /**
33      * Extension requires agent which is not available
34      */

35     public final static int NO_AGENT = 1;
36     
37     /**
38      * The agent refused to launch the application
39      */

40     public final static int AGENT_REFUSED_LAUNCH = 2;
41
42     /**
43      * Generic failed to launch error
44      */

45     public final static int FAILED_TO_LAUNCH = 3;
46
47     /**
48      * A request for an unknown application extension has been made.
49      */

50     public final static int INVALID_EXTENSION = 4;
51
52
53     /**
54      * Generic internal error processing an extension.
55      */

56     public static final int INTERNAL_ERROR = 5;
57
58     /**
59      * Failed to parse descriptor. The XML descriptor could not be parsed
60      * because something is fundamentally wrong with the format of the file.
61      */

62     public static final int FAILED_TO_PARSE_DESCRIPTOR = 6;
63
64     /**
65      * Unknown extension type. Arg0 is the requested type, Arg1 is the id
66      * of the extension bundle attempting to use the type
67      */

68     public static final int UNKNOWN_EXTENSION_TYPE = 7;
69     
70     /**
71      * The descriptor was passed but contains invalid details.
72      */

73     public static final int FAILED_TO_PROCESS_DESCRIPTOR = 8;
74
75     /**
76      * The version of SSL-Explorer hosting the plugin is not
77      * sufficient. Arg0 is the plugin name, Arg1 is the required version
78      */

79     public static final int INSUFFICIENT_SSLEXPLORER_HOST_VERSION = 9;
80     
81     /**
82      * The plugin instance could not be created for some reason.
83      * Arg0 will be the plugin name, Arg1 will be the plugin class name
84      * and Arg2 will be the error text.
85      */

86     public static final int FAILED_TO_CREATE_PLUGIN_INSTANCE = 10;
87
88     /**
89      * The bundle is not in the required state for the requested operation.
90      * Arg0 will contain the bundle name and Arg1 will contain any additional
91      * information.
92      */

93     public static final int INVALID_EXTENSION_BUNDLE_STATUS = 11;
94
95     /**
96      * Unknown plugin. Arg0 is the plugin id
97      */

98     public static final int UNKNOWN_PLUGIN = 12;
99
100     /**
101      * An attempt was made to start an extension that requires
102      * a dependency that is not installed. Arg0 is the dependency
103      * name required, Arg1 is the bundle that requries the
104      * dependency.
105      */

106     public static final int DEPENDENCY_NOT_INSTALLED = 13;
107
108     /**
109      * An attempt was made to start an extension that requires
110      * a dependency that is not started. Arg0 is the dependency
111      * name required, Arg1 is the bundle that requries the
112      * dependency.
113      */

114     public static final int DEPENDENCY_NOT_STARTED = 14;
115
116     /**
117      * Licensing error. Arg0 is the message.
118      */

119     public static final int LICENSE_ERROR = 15;
120     
121     /**
122      * Error category
123      */

124     public final static String JavaDoc ERROR_CATEGORY = "extensions";
125
126
127
128     /**
129      * Constructor.
130      *
131      * @param code
132      */

133     public ExtensionException(int code) {
134         super(code, ERROR_CATEGORY);
135     }
136
137     /**
138      * Constructor.
139      *
140      * @param code
141      * @param bundle
142      * @param cause
143      * @param arg0
144      * @param arg1
145      * @param arg2
146      * @param arg3
147      */

148     public ExtensionException(int code, String JavaDoc bundle, Throwable JavaDoc cause, String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2, String JavaDoc arg3) {
149         super(code, ERROR_CATEGORY, bundle, cause, arg0, arg1, arg2, arg3);
150     }
151
152     /**
153      * Constructor.
154      *
155      * @param code
156      * @param bundle
157      * @param cause
158      * @param arg0
159      */

160     public ExtensionException(int code,String JavaDoc bundle, Throwable JavaDoc cause, String JavaDoc arg0) {
161         super(code, ERROR_CATEGORY, bundle, cause, arg0);
162     }
163
164     /**
165      * Constructor.
166      *
167      * @param code
168      * @param bundle
169      * @param cause
170      */

171     public ExtensionException(int code, String JavaDoc bundle, Throwable JavaDoc cause) {
172         super(code, ERROR_CATEGORY, bundle, cause);
173     }
174
175     /**
176      * Constructor.
177      *
178      * @param code
179      * @param arg0
180      */

181     public ExtensionException(int code, String JavaDoc arg0) {
182         super(code, ERROR_CATEGORY, arg0);
183     }
184
185     /**
186      * Constructor.
187      *
188      * @param code
189      * @param arg0
190      * @param arg1
191      */

192     public ExtensionException(int code, String JavaDoc arg0, String JavaDoc arg1) {
193         super(code, ERROR_CATEGORY, DEFAULT_BUNDLE, null, arg0, arg1, null, null);
194     }
195
196     /**
197      * Constructor.
198      *
199      * @param code
200      * @param cause
201      */

202     public ExtensionException(int code, Throwable JavaDoc cause) {
203         super(code, ERROR_CATEGORY, DEFAULT_BUNDLE, cause, cause.getMessage());
204     }
205
206     /**
207      * Constructor.
208      *
209      * @param code
210      * @param cause
211      * @param arg0
212      */

213     public ExtensionException(int code, Throwable JavaDoc cause, String JavaDoc arg0) {
214         super(code, ERROR_CATEGORY, DEFAULT_BUNDLE, cause, arg0);
215     }
216
217     /**
218      * Constructor.
219      *
220      * @param code
221      * @param arg0
222      * @param arg1
223      * @param arg2
224      * @param cause
225      */

226     public ExtensionException(int code, String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2, Throwable JavaDoc cause) {
227         super(code, ERROR_CATEGORY, DEFAULT_BUNDLE, cause, arg0, arg1, arg2, null);
228     }
229 }
230
Popular Tags