01: /* Copyright 2004 Inderjeet Singh. All rights reserved. You may not modify,
02: * use, reproduce or distribute this software except in compliance with the
03: * terms of the license at http://tcpmon.dev.java.net/
04: * $Id: TunnelConfig.java,v 1.3 2004/11/09 20:32:15 inder Exp $ */
05:
06: package tcpmon;
07:
08: /**
09: * @author Inderjeet Singh
10: */
11: public final class TunnelConfig {
12:
13: public TunnelConfig(String serverHost, int serverPort,
14: int localPort, boolean startTunnel) {
15: this .serverName = serverHost;
16: this .serverPort = serverPort;
17: this .localPort = localPort;
18: this .startTunnel = startTunnel;
19: }
20:
21: public TunnelConfig(String serverHost, String serverPort,
22: String localPort, boolean startTunnel) {
23: this .serverName = serverHost;
24: try {
25: this .serverPort = Integer.parseInt(serverPort);
26: this .localPort = Integer.parseInt(localPort);
27: } catch (Exception e) {
28: throw new RuntimeException(e);
29: }
30: this .startTunnel = startTunnel;
31: }
32:
33: public String toString() {
34: return localPort + ":" + serverName + ":" + serverPort + ":"
35: + startTunnel;
36: }
37:
38: public final String serverName;
39: public final int serverPort;
40: public final int localPort;
41: public final boolean startTunnel;
42: }
|