1 /*
2  * File    : TRTrackerServerException.java
3  * Created : 5 Oct. 2003
4  * By      : Parg
5  *
6  * Azureus - a Java Bittorrent client
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details ( see the LICENSE file ).
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22 
23 package org.gudy.azureus2.core3.tracker.server;
24 
25 import java.util.Map;
26 
27 public class
28 TRTrackerServerException
29 	extends Exception
30 {
31 	private int		response_code	= -1;
32 	private String	response_text;
33 	private Map		response_headers;
34 
35 	private boolean	user_message;
36 	private Map		error_map;
37 
38 	public
TRTrackerServerException( int _response_code, String _response_text, Map _response_headers )39 	TRTrackerServerException(
40 		int		_response_code,
41 		String	_response_text,
42 		Map		_response_headers )
43 	{
44 		response_code		= _response_code;
45 		response_text		= _response_text;
46 		response_headers	= _response_headers;
47 	}
48 
49 	public
TRTrackerServerException( String str )50 	TRTrackerServerException(
51 		String		str )
52 	{
53 		super(str);
54 	}
55 
56 	public
TRTrackerServerException( String str, Throwable e )57 	TRTrackerServerException(
58 		String		str,
59 		Throwable	e )
60 	{
61 		super(str,e);
62 	}
63 
64 	public int
getResponseCode()65 	getResponseCode()
66 	{
67 		return( response_code );
68 	}
69 
70 	public String
getResponseText()71 	getResponseText()
72 	{
73 		return( response_text );
74 	}
75 
76 	public Map
getResponseHeaders()77 	getResponseHeaders()
78 	{
79 		return( response_headers );
80 	}
81 
82 
83 	public void
setUserMessage( boolean b )84 	setUserMessage(
85 		boolean	b )
86 	{
87 		user_message	= b;
88 	}
89 
90 	public boolean
isUserMessage()91 	isUserMessage()
92 	{
93 		return( user_message );
94 	}
95 
96 	public void
setErrorEntries( Map map )97 	setErrorEntries(
98 		Map		map )
99 	{
100 		error_map	= map;
101 	}
102 
103 	public Map
getErrorEntries()104 	getErrorEntries()
105 	{
106 		return( error_map );
107 	}
108 }
109