KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > agent > client > util > TunnelConfiguration


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.agent.client.util;
21
22
23 /**
24  * Describe the configuration of a <i>Tunnel</i>, be it
25  * <i>Remote</i> or <i>Local</i>
26  *
27  * @author Lee David Painter <a HREF="mailto: lee@3sp.com">&lt;lee@3sp.com&gt;</a>
28  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
29  */

30 public interface TunnelConfiguration {
31
32     /**
33      * Local tunnel
34      */

35     public final static int LOCAL_TUNNEL = 0;
36     
37     /**
38      * Remote tunnel
39      */

40     public final static int REMOTE_TUNNEL = 1;
41
42     /**
43      * TCP tunnel
44      */

45     public final static String JavaDoc TCP_TUNNEL = "TCP"; //$NON-NLS-1$
46

47     /**
48      * UDP tunnel
49      */

50     public final static String JavaDoc UDP_TUNNEL = "UDP"; //$NON-NLS-1$
51

52     /**
53      * Is this a permanent listener
54      *
55      * @return permanent listener
56      */

57     public boolean isPermanent();
58
59     /**
60      * Get the name of this listener
61      *
62      * @return name
63      */

64     public String JavaDoc getName();
65
66     /**
67      * Is this a non permanent tunnel, should we only allow one connection then
68      * exit?
69      *
70      * @return temporary single connection
71      */

72     public boolean isTemporarySingleConnect();
73     
74     /**
75      * The unique tunnel id
76      *
77      * @return tunnel id
78      */

79     public int getId();
80
81     /**
82      * The type of tunnel. this may currently only be
83      * <code>Tunnel.LOCAL_TUNNEL</code> or <code>Tunnel.REMOTE_TUNNEL</code>.
84      *
85      * @return tunnel type
86      */

87     public int getType();
88
89     /**
90      * Get the transport protocol to tunnel. Currently
91      * <code>Tunnel.TCP_TUNNEL</code> and <code>Tunnel.UDP_TUNNEL</code> are
92      * supported.
93      *
94      * @return transport protocol
95      */

96     public String JavaDoc getTransport();
97
98
99     /**
100      * Get the port that a listener should be opened up on.
101      * If -1 is returned the listener should attempt to find
102      * a free port.
103      *
104      * @return source port
105      */

106     public int getSourcePort();
107     
108     /**
109      * Get the source interface address to use. This will overide
110      * both {@link #isAllowExternalHosts()} and {@link #isLocalhostWorkaround()}.
111      * <p>
112      * If <code>null</code> or empty string, the address will be determined by the aforementioned
113      * flags.
114      *
115      * @return source interface address
116      */

117
118     public String JavaDoc getSourceInterface();
119
120     /**
121      * Get the port that should be forward to
122      *
123      * @return destination port
124      */

125     public int getDestinationPort();
126
127     /**
128      * Get the host that should be forward to
129      *
130      * @return destination host
131      */

132     public String JavaDoc getDestinationHost();
133
134     /**
135      * Set the source port being used.
136      *
137      * @param port port
138      */

139     public void setSourcePort(int port);
140     
141     /**
142      * Get the Id of the launch session this tunnel was launched
143      * under.
144      *
145      * @return launch session
146      */

147     public String JavaDoc getLaunchId();
148
149 }
150
Popular Tags