|
@@ -23,7 +23,6 @@
|
23
|
23
|
package com.dmdirc.parser.irc;
|
24
|
24
|
|
25
|
25
|
import java.net.URI;
|
26
|
|
-import java.net.URISyntaxException;
|
27
|
26
|
|
28
|
27
|
/**
|
29
|
28
|
* Contains Server information.
|
|
@@ -37,42 +36,11 @@ public class ServerInfo {
|
37
|
36
|
* structure is changed (or anything else that would prevent serialized
|
38
|
37
|
* objects being unserialized with the new class).
|
39
|
38
|
*/
|
40
|
|
- private static final long serialVersionUID = 1;
|
41
|
|
- /** Are we using a socks proxy (Default: false). */
|
42
|
|
- private boolean useSocksProxy;
|
43
|
|
- /** Proxy server to connect to (Default: "127.0.0.1"). */
|
44
|
|
- private String proxyHost = "127.0.0.1";
|
45
|
|
- /** Port server listens on for client connections (Default: 8080). */
|
46
|
|
- private int proxyPort = 1080;
|
47
|
|
- /** Proxy username if required. */
|
48
|
|
- private String proxyUser = "";
|
49
|
|
- /** Proxy password if required. */
|
50
|
|
- private String proxyPass = "";
|
|
39
|
+ private static final long serialVersionUID = 2;
|
|
40
|
+
|
51
|
41
|
/** URI used to create this ServerInfo if applicable. */
|
52
|
42
|
private URI uri;
|
53
|
43
|
|
54
|
|
- /**
|
55
|
|
- * Constructor using specifed host, port and password, SSL/Proxy must be
|
56
|
|
- * specifed separately.
|
57
|
|
- *
|
58
|
|
- * @param serverHost Host to use
|
59
|
|
- * @param serverPort Port to use
|
60
|
|
- * @param serverPass Password to use
|
61
|
|
- */
|
62
|
|
- public ServerInfo(final String serverHost, final int serverPort,
|
63
|
|
- final String serverPass) {
|
64
|
|
- try {
|
65
|
|
- uri = new URI("irc", serverPass, serverHost, serverPort, null,
|
66
|
|
- null, null);
|
67
|
|
- } catch (URISyntaxException ex) {
|
68
|
|
- try {
|
69
|
|
- uri = new URI("irc", null, "127.0.0.1", -1, null, null, null);
|
70
|
|
- } catch (URISyntaxException ex1) {
|
71
|
|
- //Won't happen
|
72
|
|
- }
|
73
|
|
- }
|
74
|
|
- }
|
75
|
|
-
|
76
|
44
|
/**
|
77
|
45
|
* Creates a new ServerInfo which will represent the server described by
|
78
|
46
|
* the specified URI.
|
|
@@ -132,96 +100,6 @@ public class ServerInfo {
|
132
|
100
|
return "ircs".equals(uri.getScheme());
|
133
|
101
|
}
|
134
|
102
|
|
135
|
|
- /**
|
136
|
|
- * Set if we are connecting via a socks proxy.
|
137
|
|
- *
|
138
|
|
- * @param newValue true if we are using socks, else false
|
139
|
|
- */
|
140
|
|
- public void setUseSocks(final boolean newValue) {
|
141
|
|
- useSocksProxy = newValue;
|
142
|
|
- }
|
143
|
|
-
|
144
|
|
- /**
|
145
|
|
- * Get if we are connecting via a socks proxy.
|
146
|
|
- *
|
147
|
|
- * @return true if we are using socks, else false
|
148
|
|
- */
|
149
|
|
- public boolean getUseSocks() {
|
150
|
|
- return useSocksProxy;
|
151
|
|
- }
|
152
|
|
-
|
153
|
|
- /**
|
154
|
|
- * Set the Proxy hostname.
|
155
|
|
- *
|
156
|
|
- * @param newValue Value to set to.
|
157
|
|
- */
|
158
|
|
- public void setProxyHost(final String newValue) {
|
159
|
|
- proxyHost = newValue;
|
160
|
|
- }
|
161
|
|
-
|
162
|
|
- /**
|
163
|
|
- * Get the Proxy hostname.
|
164
|
|
- *
|
165
|
|
- * @return Current Proxy hostname
|
166
|
|
- */
|
167
|
|
- public String getProxyHost() {
|
168
|
|
- return proxyHost;
|
169
|
|
- }
|
170
|
|
-
|
171
|
|
- /**
|
172
|
|
- * Set the Proxy port.
|
173
|
|
- *
|
174
|
|
- * @param newValue Value to set to.
|
175
|
|
- */
|
176
|
|
- public void setProxyPort(final int newValue) {
|
177
|
|
- proxyPort = newValue;
|
178
|
|
- }
|
179
|
|
-
|
180
|
|
- /**
|
181
|
|
- * Get the Proxy port.
|
182
|
|
- *
|
183
|
|
- * @return Current Proxy port
|
184
|
|
- */
|
185
|
|
- public int getProxyPort() {
|
186
|
|
- return proxyPort;
|
187
|
|
- }
|
188
|
|
-
|
189
|
|
- /**
|
190
|
|
- * Set the Proxy username.
|
191
|
|
- *
|
192
|
|
- * @param newValue Value to set to.
|
193
|
|
- */
|
194
|
|
- public void setProxyUser(final String newValue) {
|
195
|
|
- proxyUser = newValue;
|
196
|
|
- }
|
197
|
|
-
|
198
|
|
- /**
|
199
|
|
- * Get the Proxy username.
|
200
|
|
- *
|
201
|
|
- * @return Current Proxy username
|
202
|
|
- */
|
203
|
|
- public String getProxyUser() {
|
204
|
|
- return proxyUser;
|
205
|
|
- }
|
206
|
|
-
|
207
|
|
- /**
|
208
|
|
- * Set the Proxy password.
|
209
|
|
- *
|
210
|
|
- * @param newValue Value to set to.
|
211
|
|
- */
|
212
|
|
- public void setProxyPass(final String newValue) {
|
213
|
|
- proxyPass = newValue;
|
214
|
|
- }
|
215
|
|
-
|
216
|
|
- /**
|
217
|
|
- * Get the Proxy password.
|
218
|
|
- *
|
219
|
|
- * @return Current Proxy password
|
220
|
|
- */
|
221
|
|
- public String getProxyPass() {
|
222
|
|
- return proxyPass;
|
223
|
|
- }
|
224
|
|
-
|
225
|
103
|
/**
|
226
|
104
|
* Retrieves a String describing any channels included in this ServerInfo's
|
227
|
105
|
* URI.
|