Java Doc for SshConnection.java in  » Net » ssh-web-proxy » com » ericdaugherty » sshwebproxy » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » ssh web proxy » com.ericdaugherty.sshwebproxy 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ericdaugherty.sshwebproxy.SshConnection

SshConnection
public class SshConnection implements SshConstants(Code)
SshConnection represents an Ssh connection between the local host and a remote ssh daemon. A single SshConnection may contain multiple channels, which may be file transfer channels or shell channels.
author:
   Eric Daugherty



Constructor Summary
public  SshConnection(SshClient sshClient, String connectionInfo)
     Initialize a new SshConnection with the SshClient connection.
public  SshConnection(String host, int port, String username, String password)
     Create a new SshConnection to the specified location with the specified username and password.
public  SshConnection(String host, int port, String username, byte[] key, String keyPassPhrase)
     Create a new SshConnection to the specified location with the specified username and key.

Method Summary
public  voidclose()
     Closes all open channels and the current SshConnection.
public  voidcloseChannel(String channelId)
     Close a specfic channel.
public  voidcloseChannel(SshChannel sshChannel)
     Close a specfic channel.
public  SshChannelgetChannel(String channelId)
     Returns the requested channel.
Parameters:
  channelId - the channel's unique id.
public  CollectiongetChannels()
    
public  StringgetConnectionInfo()
     Returns information about this connection.
public static  StringgetConnectionInfo(String host, String port, String username)
     Helper method to return the connection info.
public static  StringgetConnectionInfo(String host, int port, String username)
     Helper method to return the connection info.
public  FileChannelgetFileChannel(String channelId)
     Returns the requested channel.
Parameters:
  channelId - the channel's unique id.
public  ShellChannelgetShellChannel(String channelId)
     Returns the requested channel.
Parameters:
  channelId - the channel's unique id.
public  CollectiongetShellChannels()
     Returns a collection of all ShellChannels associated with this connection.
public  booleanisOpen()
     Returns true if this SshConnection is open.
public  FileChannelopenFileChannel()
     Open a new File Channel for this connection.
public  ShellChannelopenShellChannel()
     Open a new Shell Channel for this connection.
public  StringtoString()
     Return a string representation of this connection.


Constructor Detail
SshConnection
public SshConnection(SshClient sshClient, String connectionInfo)(Code)
Initialize a new SshConnection with the SshClient connection.
Parameters:
  sshClient - the sshClient that represents the connection.



SshConnection
public SshConnection(String host, int port, String username, String password) throws SshConnectException(Code)
Create a new SshConnection to the specified location with the specified username and password.
Parameters:
  host - the remote host to connect to.
Parameters:
  port - the port to connect to.
Parameters:
  username - the username to login with.
Parameters:
  password - the password to login with.
throws:
  SshConnectException - thrown if the connection attempt failes for any reason.



SshConnection
public SshConnection(String host, int port, String username, byte[] key, String keyPassPhrase) throws SshConnectException(Code)
Create a new SshConnection to the specified location with the specified username and key.
Parameters:
  host - the remote host to connect to.
Parameters:
  port - the port to connect to.
Parameters:
  username - the username to login with.
Parameters:
  key - the SSH Key as a byte array.
Parameters:
  keyPassPhrase - the passPharse for the key (optional)
throws:
  SshConnectException - thrown if the connection attempt failes for any reason.




Method Detail
close
public void close()(Code)
Closes all open channels and the current SshConnection.



closeChannel
public void closeChannel(String channelId)(Code)
Close a specfic channel. This calls channel.close() and removes it from the channel list.
Parameters:
  channelId - the channel to remove.



closeChannel
public void closeChannel(SshChannel sshChannel)(Code)
Close a specfic channel. This calls channel.close() and removes it from the channel list.
Parameters:
  sshChannel - the channel to remove.



getChannel
public SshChannel getChannel(String channelId)(Code)
Returns the requested channel.
Parameters:
  channelId - the channel's unique id. the requested channel, or null if it does not exist.



getChannels
public Collection getChannels()(Code)
Returns all channels



getConnectionInfo
public String getConnectionInfo()(Code)
Returns information about this connection. The information consists of the username, the host, and the port. The result is formatted as: username@host:port formated string: username@host:port



getConnectionInfo
public static String getConnectionInfo(String host, String port, String username)(Code)
Helper method to return the connection info.
Parameters:
  host -
Parameters:
  port -
Parameters:
  username - a propertly formatted connection info string.



getConnectionInfo
public static String getConnectionInfo(String host, int port, String username)(Code)
Helper method to return the connection info.
Parameters:
  host -
Parameters:
  port -
Parameters:
  username - a propertly formatted connection info string.



getFileChannel
public FileChannel getFileChannel(String channelId)(Code)
Returns the requested channel.
Parameters:
  channelId - the channel's unique id. the requested channel, or null if it does not exist.



getShellChannel
public ShellChannel getShellChannel(String channelId)(Code)
Returns the requested channel.
Parameters:
  channelId - the channel's unique id. the requested channel, or null if it does not exist.



getShellChannels
public Collection getShellChannels()(Code)
Returns a collection of all ShellChannels associated with this connection. will never be null.



isOpen
public boolean isOpen()(Code)
Returns true if this SshConnection is open. true if it is open.



openFileChannel
public FileChannel openFileChannel() throws SshConnectException(Code)
Open a new File Channel for this connection. a newly opened FileChannel
throws:
  SshConnectException - if the channel could not be opened.



openShellChannel
public ShellChannel openShellChannel() throws SshConnectException(Code)
Open a new Shell Channel for this connection. a newly opened ShellChannel
throws:
  SshConnectException - if the channel could not be opened.



toString
public String toString()(Code)
Return a string representation of this connection.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.