KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Calendar JavaDoc;
23
24 import com.sslexplorer.boot.HostService;
25 import com.sslexplorer.policyframework.AbstractResource;
26
27 public class DefaultTunnel extends AbstractResource implements Tunnel {
28
29     int type;
30     String JavaDoc username;
31     boolean autoStart;
32     String JavaDoc transport;
33     int sourcePort;
34     String JavaDoc sourceInterface;
35     HostService destination;
36
37     /**
38      * @param id tunnel id
39      * @param type type
40      * @param autoStart automatically start tunnel upon login
41      * @param transport transport
42      * @param username username
43      * @param sourcePort source port
44      * @param destination destination
45      * @param sourceInterface source interface
46      * @param dateCreated date created
47      * @param dateAmended date amended
48      */

49     public DefaultTunnel(int realmID, String JavaDoc name, String JavaDoc description, int id, int type, boolean autoStart, String JavaDoc transport, String JavaDoc username,
50                     int sourcePort, HostService destination, String JavaDoc sourceInterface, Calendar JavaDoc dateCreated, Calendar JavaDoc dateAmended) {
51         super(realmID, TunnelPlugin.SSL_TUNNEL_RESOURCE_TYPE, id, name, description, dateCreated, dateAmended);
52         this.type = type;
53         this.autoStart = autoStart;
54         this.transport = transport;
55         this.username = username;
56         this.sourcePort = sourcePort;
57         this.sourceInterface = sourceInterface;
58         this.destination = destination;
59     }
60
61     /*
62      * (non-Javadoc)
63      *
64      * @see com.sslexplorer.forwarding.Tunnel#getType()
65      */

66     public int getType() {
67         return type;
68     }
69
70     /*
71      * (non-Javadoc)
72      *
73      * @see com.sslexplorer.forwarding.Tunnel#isAutoStart()
74      */

75     public boolean isAutoStart() {
76         return autoStart;
77     }
78
79     /*
80      * (non-Javadoc)
81      *
82      * @see com.sslexplorer.forwarding.Tunnel#getTransport()
83      */

84     public String JavaDoc getTransport() {
85         return transport;
86     }
87
88     /*
89      * (non-Javadoc)
90      *
91      * @see com.sslexplorer.forwarding.Tunnel#getUsername()
92      */

93     public String JavaDoc getUsername() {
94         return username;
95     }
96
97     /*
98      * (non-Javadoc)
99      *
100      * @see com.sslexplorer.forwarding.Tunnel#getSourcePort()
101      */

102     public int getSourcePort() {
103         return sourcePort;
104     }
105
106     public String JavaDoc getSourceInterface() {
107         return sourceInterface;
108     }
109
110     /*
111      * (non-Javadoc)
112      *
113      * @see com.sslexplorer.forwarding.Tunnel#getDestinationHost()
114      */

115     public HostService getDestination() {
116         return destination;
117     }
118
119     /**
120      * @param autoStart The autoStart to set.
121      */

122     public void setAutoStart(boolean autoStart) {
123         this.autoStart = autoStart;
124     }
125
126     /**
127      * @param destinationHost The destinationHost to set.
128      */

129     public void setDestination(HostService destination) {
130         this.destination = destination;
131     }
132
133     /**
134      * @param sourcePort The sourcePort to set.
135      */

136     public void setSourcePort(int sourcePort) {
137         this.sourcePort = sourcePort;
138     }
139
140     public void setSourceInterface(String JavaDoc sourceInterface) {
141         this.sourceInterface = sourceInterface;
142     }
143
144     /**
145      * @param transport The transport to set.
146      */

147     public void setTransport(String JavaDoc transport) {
148         this.transport = transport;
149     }
150
151     /**
152      * @param type The type to set.
153      */

154     public void setType(int type) {
155         this.type = type;
156     }
157
158     /**
159      * @param username The username to set.
160      */

161     public void setUsername(String JavaDoc username) {
162         this.username = username;
163     }
164 }
165
Popular Tags