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 default ClientProxyConnector 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 final String
    A property key for a session property defining the timeout for setting up the proxy connection.
  • Method Summary

    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
    Runs command once the proxy connection is established.

    Methods inherited from interface org.apache.sshd.client.session.ClientProxyConnector

    sendClientProxyMetadata
  • Field Details

    • TIMEOUT_PROPERTY

      static final String TIMEOUT_PROPERTY
      A property key for a session property defining the timeout for setting up the proxy connection.
  • Method Details

    • 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 data
      buffer - received data
      Throws:
      Exception - if data cannot be read, or the connection attempt fails
    • runWhenDone

      void runWhenDone(Callable<Void> command) throws Exception
      Runs command 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