|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Transport
Transport layer of the SSH protocol.
| Method Summary | |
|---|---|
void |
addHostKeyVerifier(HostKeyVerifier hkv)
Adds the specified verifier. |
void |
disconnect()
Send a disconnection packet with reason as DisconnectReason.BY_APPLICATION, and closes this transport. |
void |
disconnect(DisconnectReason reason)
Send a disconnect packet with the given reason, and closes this transport. |
void |
disconnect(DisconnectReason reason,
String message)
Send a disconnect packet with the given reason and message, and closes this
transport. |
void |
doKex()
Do key exchange and algorithm negotiation. |
String |
getClientVersion()
|
Config |
getConfig()
|
DisconnectListener |
getDisconnectListener()
|
int |
getHeartbeatInterval()
|
String |
getRemoteHost()
|
int |
getRemotePort()
|
String |
getServerVersion()
Returns the version string as sent by the SSH server for identification purposes, e.g. |
Service |
getService()
|
byte[] |
getSessionID()
|
int |
getTimeout()
|
void |
init(String host,
int port,
InputStream in,
OutputStream out)
Sets the host information and the streams to be used by this transport. |
boolean |
isAuthenticated()
|
boolean |
isRunning()
|
void |
join()
Joins the thread calling this method to the transport's death. |
void |
join(int timeout,
TimeUnit unit)
Joins the thread calling this method to the transport's death. |
void |
reqService(Service service)
Request a SSH service represented by a Service instance. |
long |
sendUnimplemented()
Sends SSH_MSG_UNIMPLEMENTED in response to the last packet received. |
void |
setAuthenticated()
Informs this transport that authentication has been completed. |
void |
setDisconnectListener(DisconnectListener listener)
Specify a listener that will be notified upon disconnection. |
void |
setHeartbeatInterval(int interval)
|
void |
setService(Service service)
Sets the currently active Service. |
void |
setTimeout(int timeout)
Set a timeout for methods that may block. |
long |
write(SSHPacket payload)
Write a packet over this transport. |
| Methods inherited from interface net.schmizz.sshj.common.SSHPacketHandler |
|---|
handle |
| Method Detail |
|---|
void init(String host,
int port,
InputStream in,
OutputStream out)
throws TransportException
TransportException is thrown in case of SSH protocol version incompatibility.
host - server's hostnameport - server's portin - input stream for the connectionout - output stream for the connection
TransportException - if there is an error during exchange of identification informationvoid addHostKeyVerifier(HostKeyVerifier hkv)
hkv - the host key verifier
void doKex()
throws TransportException
TransportException - if there was an error during key exchangeString getClientVersion()
Config getConfig()
Config associated with this transport.int getTimeout()
void setTimeout(int timeout)
timeout - the timeout in secondsint getHeartbeatInterval()
void setHeartbeatInterval(int interval)
interval - the interval in seconds, 0 means no hearbeatString getRemoteHost()
int getRemotePort()
String getServerVersion()
init(java.lang.String, int, java.io.InputStream, java.io.OutputStream), it will be null.
null)byte[] getSessionID()
Service getService()
Service instance.
void reqService(Service service)
throws TransportException
Service instance. A separate call to setService(net.schmizz.sshj.Service) is not
needed.
service - the SSH service to be requested
TransportException - if the request failed for any reasonvoid setService(Service service)
Service. Handling of non-transport-layer packets is delegated to that service.
For this method to be successful, at least one service request via reqService(net.schmizz.sshj.Service) must have been successful
(not necessarily for the service being set).
service - (null-ok) the Serviceboolean isAuthenticated()
void setAuthenticated()
long sendUnimplemented()
throws TransportException
TransportException - if an error occured sending the packetboolean isRunning()
init(java.lang.String, int, java.io.InputStream, java.io.OutputStream) and
has not been disconnected.
void join()
throws TransportException
TransportException - if the transport dies of an exception
void join(int timeout,
TimeUnit unit)
throws TransportException
TransportException - if the transport dies of an exceptionvoid disconnect()
DisconnectReason.BY_APPLICATION, and closes this transport.
void disconnect(DisconnectReason reason)
reason, and closes this transport.
reason - reason for disconnecting
void disconnect(DisconnectReason reason,
String message)
reason and message, and closes this
transport.
reason - the reason code for this disconnectmessage - the text message
long write(SSHPacket payload)
throws TransportException
payload SSHPacket should have 5 bytes free at the beginning to avoid a performance penalty
associated with making space for header bytes (packet length, padding length).
payload - the SSHPacket containing data to send
TransportException - if an error occurred sending the packetvoid setDisconnectListener(DisconnectListener listener)
listener that will be notified upon disconnection.
listener - DisconnectListener getDisconnectListener()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||