|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SshTransport
Simple interface wrapper for transport layer communication. An SSH connection requires a transport layer for communication and this interface defines the general contract. Typically SSH will execute over a TCPIP Socket however the use of this interface allows any type of transport that can expose a set of I/O streams. In the simplest form this interface will be implemented for a Socket as follows:
import java.net.Socket;
import java.io.*;
public class SocketTransport extends Socket implements SshTransport {
public SocketProvider(String host, int port) throws IOException {
super(host, port);
}
public String getConnectedHost() {
return getInetAddress().getHostName();
}
** The close, getInputStream and getOutputStream methods are exposed **
** directly by the Socket. **
| Method Summary | |
|---|---|
SshTransport |
duplicate()
Create a new copy of this transport and connect to the same host:port combination. |
java.lang.String |
getHost()
Get the name of the connected host. |
int |
getPort()
Get the port of this connection |
| Methods inherited from interface com.maverick.ssh.SshIO |
|---|
close, getInputStream, getOutputStream |
| Method Detail |
|---|
java.lang.String getHost()
int getPort()
SshTransport duplicate()
throws java.io.IOException
SshException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||