KickJava   Java API By Example, From Geeks To Geeks.

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


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.boot.HostService;
23 import com.sslexplorer.policyframework.Resource;
24
25 /**
26  * Extension of {@link com.sslexplorer.policyframework.Resource} that provides
27  * instances of <i>SSL Tunnels</i>, one of SSL-Explorers main resource types.
28  *
29  *
30  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
31  */

32 public interface Tunnel extends Resource {
33
34     /**
35      * The type of tunnel. this may currently only be
36      * {@link TransportType#REMOTE_TUNNEL_ID} or
37      * {@link TransportType#LOCAL_TUNNEL_ID}
38      *
39      * @return tunnel type
40      */

41     public int getType();
42
43     /**
44      * Get if this tunnel should be automatically started when the user logs in.
45      *
46      * @return <code>true</code> if autostart tunnel upon login
47      */

48     public boolean isAutoStart();
49
50     /**
51      * Get the transport protocol to tunnel. Currently
52      * {@link TransportType#TCP_TUNNEL} and {@link TransportType#UDP_TUNNEL} are
53      * supported.
54      *
55      * @return transport protocol
56      */

57     public String JavaDoc getTransport();
58
59     /**
60      * Get the user that this tunnel is attached to, or an empty styring if this
61      * is a global tunnel to be configured for all users.
62      *
63      * @return user id
64      */

65     public String JavaDoc getUsername();
66
67     /**
68      * Get the port that a listener should be opened up on.
69      *
70      * @return source port
71      */

72     public int getSourcePort();
73
74     /**
75      * The source interface of the listening socket.
76      *
77      * @return source interface
78      */

79     public String JavaDoc getSourceInterface();
80
81     /**
82      * Get the destination
83      *
84      * @return destination
85      */

86     public HostService getDestination();
87
88     /**
89      * Set the type of tunnel. this may currently only be
90      * {@link TransportType#REMOTE_TUNNEL_ID} or
91      * {@link TransportType#LOCAL_TUNNEL_ID}
92      *
93      * @param tunnelType tunnel type
94      */

95     public void setType(int tunnelType);
96
97     /**
98      * Set if this tunnel should auto-start when the VPN client is started
99      *
100      * @param autoStart auto-start on VPN client start up
101      */

102     public void setAutoStart(boolean autoStart);
103
104     /**
105      * Set the transport protocol to tunnel. Currently
106      * {@link TransportType#TCP_TUNNEL} and {@link TransportType#UDP_TUNNEL} are
107      * supported.
108      *
109      * @param transport transport protocol
110      */

111     public void setTransport(String JavaDoc transport);
112
113     /**
114      * Set the source port of the tunnel
115      *
116      * @param sourcePort source port
117      */

118     public void setSourcePort(int sourcePort);
119
120     public void setSourceInterface(String JavaDoc sourceInterface);
121
122     /**
123      * Set the destination host / port of the tunnel
124      *
125      * @param destination destination
126      */

127     public void setDestination(HostService destination);
128
129 }
Popular Tags