KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > tunnels > TunnelException


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.tunnels;
21
22 import com.sslexplorer.core.CoreException;
23
24
25 /**
26  * Specialisation of {@link CoreException} for exceptions generate during
27  * use of tunnels.
28  *
29  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
30  */

31 public class TunnelException extends CoreException {
32     /**
33      * Remote tunnel already opened by you
34      */

35     public final static int REMOTE_TUNNEL_IN_USE = 1;
36     
37     /**
38      * Remote tunnel already opened by someone else
39      */

40     public final static int REMOTE_TUNNEL_LOCKED = 2;
41     
42     /**
43      * Requested port on server is already in use
44      */

45     public final static int PORT_ALREADY_IN_USE = 3;
46     
47     /**
48      * General internal error during processing of tunnels. Exception text
49      * will be arg0
50      */

51     public final static int INTERNAL_ERROR = 4;
52
53     /**
54      * Agent refused to start local tunnel
55      */

56     public final static int AGENT_REFUSED_LOCAL_TUNNEL = 5;
57
58     /**
59      * Agent refused to stop a local tunnel
60      */

61     public final static int AGENT_REFUSED_LOCAL_TUNNEL_STOP = 6;
62     
63     /**
64      * Error category
65      */

66     public final static String JavaDoc ERROR_CATEGORY = "tunnels";
67
68     /**
69      * Constructor.
70      *
71      * @param code
72      */

73     public TunnelException(int code) {
74         super(code, ERROR_CATEGORY);
75     }
76
77     /**
78      * Constructor.
79      *
80      * @param code
81      * @param cause
82      * @param arg0
83      * @param arg1
84      * @param arg2
85      * @param arg3
86      */

87     public TunnelException(int code, Throwable JavaDoc cause, String JavaDoc arg0, String JavaDoc arg1, String JavaDoc arg2, String JavaDoc arg3) {
88         super(code, ERROR_CATEGORY, TunnelPlugin.MESSAGE_RESOURCES_KEY, cause, arg0, arg1, arg2, arg3);
89     }
90
91     /**
92      * Constructor.
93      *
94      * @param code
95      * @param cause
96      * @param arg0
97      */

98     public TunnelException(int code,Throwable JavaDoc cause, String JavaDoc arg0) {
99         super(code, ERROR_CATEGORY, TunnelPlugin.MESSAGE_RESOURCES_KEY, cause, arg0);
100     }
101
102     /**
103      * Constructor.
104      *
105      * @param code
106      * @param bundle
107      * @param cause
108      */

109     public TunnelException(int code, Throwable JavaDoc cause) {
110         super(code, ERROR_CATEGORY, TunnelPlugin.MESSAGE_RESOURCES_KEY, cause);
111     }
112
113     /**
114      * Constructor.
115      *
116      * @param code
117      * @param arg0
118      */

119     public TunnelException(int code, String JavaDoc arg0) {
120         super(code, ERROR_CATEGORY, arg0);
121     }
122 }
123
Popular Tags