Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/transport/AbsTransport.java @ 31:139394237973 tn5250
start tn5250 integration
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 10 Jun 2014 12:00:07 -0700 |
parents | d738f6b876fe |
children | 7ac846a07ed4 |
comparison
equal
deleted
inserted
replaced
30:d738f6b876fe | 31:139394237973 |
---|---|
33 /** | 33 /** |
34 * @author Kenny Root | 34 * @author Kenny Root |
35 * | 35 * |
36 */ | 36 */ |
37 public abstract class AbsTransport { | 37 public abstract class AbsTransport { |
38 HostBean host; | |
39 TerminalBridge bridge; | |
40 TerminalManager manager; | 38 TerminalManager manager; |
41 | 39 TerminalBridge bridge; |
42 String emulation; | 40 HostBean host; |
41 vt320 buffer; | |
42 String emulation; | |
43 | 43 |
44 public AbsTransport() {} | 44 public AbsTransport() {} |
45 | |
46 public AbsTransport(HostBean host, TerminalBridge bridge, TerminalManager manager) { | |
47 this.host = host; | |
48 this.bridge = bridge; | |
49 this.manager = manager; | |
50 } | |
51 | 45 |
52 /** | 46 /** |
53 * @return protocol part of the URI | 47 * @return protocol part of the URI |
54 */ | 48 */ |
55 public static String getProtocolName() { | 49 public static String getProtocolName() { |
56 return "unknown"; | 50 return "unknown"; |
57 } | 51 } |
58 | |
59 | 52 |
60 /** | 53 /** |
61 * Encode the current transport into a URI that can be passed via intent calls. | 54 * Encode the current transport into a URI that can be passed via intent calls. |
62 * @return URI to host | 55 * @return URI to host |
63 */ | 56 */ |
145 | 138 |
146 public void setUseAuthAgent(String useAuthAgent) { | 139 public void setUseAuthAgent(String useAuthAgent) { |
147 // do nothing | 140 // do nothing |
148 } | 141 } |
149 | 142 |
150 public void setEmulation(String emulation) { | |
151 this.emulation = emulation; | |
152 } | |
153 | |
154 public String getEmulation() { | 143 public String getEmulation() { |
155 return emulation; | 144 return emulation; |
156 } | 145 } |
157 | 146 |
158 public void setHost(HostBean host) { | 147 public void setLinks(TerminalManager manager, TerminalBridge bridge, HostBean host, vt320 buffer, String emulation) { |
159 this.host = host; | 148 this.manager = manager; |
160 } | 149 this.bridge = bridge; |
161 | 150 this.host = host; |
162 public void setBridge(TerminalBridge bridge) { | 151 this.buffer = buffer; |
163 this.bridge = bridge; | 152 this.emulation = emulation; |
164 } | |
165 | |
166 public void setManager(TerminalManager manager) { | |
167 this.manager = manager; | |
168 } | 153 } |
169 | 154 |
170 /** | 155 /** |
171 * Whether or not this transport type can forward ports. | 156 * Whether or not this transport type can forward ports. |
172 * @return true on ability to forward ports | 157 * @return true on ability to forward ports |
248 public boolean uploadFile(String localFile, String remoteFile, | 233 public boolean uploadFile(String localFile, String remoteFile, |
249 String remoteFolder, String mode) { | 234 String remoteFolder, String mode) { |
250 return false; | 235 return false; |
251 } | 236 } |
252 | 237 |
238 | |
239 /** | |
240 * @return int default port for protocol | |
241 */ | |
242 public abstract int getDefaultPort(); | |
253 public abstract boolean isConnected(); | 243 public abstract boolean isConnected(); |
254 public abstract boolean isSessionOpen(); | 244 public abstract boolean isSessionOpen(); |
255 public abstract boolean isAuthenticated(); | 245 public abstract boolean isAuthenticated(); |
256 | |
257 /** | |
258 * @return int default port for protocol | |
259 */ | |
260 public abstract int getDefaultPort(); | |
261 | 246 |
262 /** | 247 /** |
263 * @param username | 248 * @param username |
264 * @param hostname | 249 * @param hostname |
265 * @param port | 250 * @param port |
300 } | 285 } |
301 | 286 |
302 /** | 287 /** |
303 * @return a key listener | 288 * @return a key listener |
304 */ | 289 */ |
305 public TerminalKeyListener getTerminalKeyListener(TerminalManager manager, TerminalBridge bridge, vt320 buffer, String encoding) { | 290 public TerminalKeyListener getTerminalKeyListener() { |
306 return new TerminalKeyListener(manager, bridge, buffer, encoding); | 291 return new TerminalKeyListener(manager, bridge, buffer, host.getEncoding()); |
307 } | 292 } |
308 | 293 |
309 } | 294 } |