Interface StatefulProxyConnector
-
- All Superinterfaces:
org.apache.sshd.client.session.ClientProxyConnector
- All Known Implementing Classes:
AbstractClientProxyConnector
,HttpClientConnector
,Socks5ClientConnector
public interface StatefulProxyConnector extends org.apache.sshd.client.session.ClientProxyConnector
Some proxy connections are stateful and require the exchange of multiple request-reply messages. The defaultClientProxyConnector
has only support for sending a message; replies get routed through the Ssh session, and don't get back to this proxy connector. Augment the interface so that the session can know when to route messages received to the proxy connector, and when to start handling them itself.
-
-
Field Summary
Fields Modifier and Type Field Description static String
TIMEOUT_PROPERTY
A property key for a session property defining the timeout for setting up the proxy connection.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
messageReceived(org.apache.sshd.common.io.IoSession session, org.apache.sshd.common.util.Readable buffer)
Handle a received message.void
runWhenDone(Callable<Void> command)
Runscommand
once the proxy connection is established.
-
-
-
Field Detail
-
TIMEOUT_PROPERTY
static final String TIMEOUT_PROPERTY
A property key for a session property defining the timeout for setting up the proxy connection.
-
-
Method Detail
-
messageReceived
void messageReceived(org.apache.sshd.common.io.IoSession session, org.apache.sshd.common.util.Readable buffer) throws Exception
Handle a received message.- Parameters:
session
- to use for writing databuffer
- received data- Throws:
Exception
- if data cannot be read, or the connection attempt fails
-
runWhenDone
void runWhenDone(Callable<Void> command) throws Exception
Runscommand
once the proxy connection is established. May be called multiple times; commands are run sequentially. If the proxy connection is already established,command
is executed directly synchronously.- Parameters:
command
- operation to run- Throws:
Exception
- if the operation is run synchronously and throws an exception
-
-