Class AbstractClientProxyConnector

    • Field Detail

      • remoteAddress

        protected final InetSocketAddress remoteAddress
        The ultimate remote address to connect to.
      • proxyUser

        protected String proxyUser
        The user to authenticate at the proxy with.
      • proxyPassword

        protected char[] proxyPassword
        The password to use for authentication at the proxy.
    • Constructor Detail

      • AbstractClientProxyConnector

        public AbstractClientProxyConnector​(@NonNull
                                            InetSocketAddress proxyAddress,
                                            InetSocketAddress remoteAddress,
                                            String proxyUser,
                                            char[] proxyPassword)
        proxyAddress - of the proxy server we're connecting to
        remoteAddress - of the target server to connect to
        proxyUser - to authenticate at the proxy with; may be null
        proxyPassword - to authenticate at the proxy with; may be null
    • Method Detail

      • init

        protected void init​(org.apache.sshd.client.session.ClientSession session)
        Initializes this instance. Installs itself as proxy handler on the session.
        session - to initialize for
      • getTimeout

        protected long getTimeout()
        Obtains the timeout for the whole rest of the proxy connection protocol.
        the timeout in milliseconds, always > 0L
      • adjustTimeout

        protected void adjustTimeout()
        Adjusts the timeout calculation to not account of elapsed time since the last time the timeout was gotten. Can be used for instance to ignore time spent in user dialogs be counted against the overall proxy connection protocol timeout.
      • setDone

        protected void setDone​(boolean success)
                        throws Exception
        Sets the "done" flag.
        success - whether the connector terminated successfully.
        Exception - if starting ssh fails
      • runWhenDone

        public void runWhenDone​(Callable<Void> starter)
                         throws Exception
        Description copied from interface: StatefulProxyConnector
        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.
        Specified by:
        runWhenDone in interface StatefulProxyConnector
        starter - operation to run
        Exception - if the operation is run synchronously and throws an exception
      • clearPassword

        protected void clearPassword()
        Clears the proxy password.