Class SshClientManager

java.lang.Object
io.gem.api.SshClientManager
All Implemented Interfaces:
AutoCloseable

public final class SshClientManager extends Object implements AutoCloseable
Owns the small set of Apache SSHD clients shared by compatible SBK-GEM connections.

Each remote node still receives an independent authenticated ClientSession and TCP connection. Compatible nodes share only client-level MINA connector, scheduler, and lifecycle infrastructure. Connections with different host-key or authentication policies never share a client.

  • Constructor Details

    • SshClientManager

      public SshClientManager()
      Create an empty manager that starts shared SSH clients on demand.
  • Method Details

    • sessionFor

      public SshSession sessionFor(ConnectionConfig connection, ExecutorService controlExecutor, ExecutorService transferExecutor, ExecutorService commandExecutor, int diagnosticBytes, int copyBufferBytes)
      Create an independently managed node session backed by the appropriate shared client.
      Parameters:
      connection - remote connection configuration
      controlExecutor - bounded connection and control-operation executor
      transferExecutor - bounded deployment transfer executor
      commandExecutor - virtual-thread executor for long-running remote commands
      diagnosticBytes - maximum stdout/stderr bytes retained per command
      copyBufferBytes - read buffer bytes used by each bulk SCP upload
      Returns:
      independent node session
    • size

      public int size()
      Return the number of distinct client policy groups, primarily for lifecycle diagnostics and tests.
      Returns:
      managed SSH client count
    • close

      public void close()
      Stop every managed client after its node sessions have closed.
      Specified by:
      close in interface AutoCloseable