Class SshClientManager
java.lang.Object
io.gem.api.SshClientManager
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreate an empty manager that starts shared SSH clients on demand. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stop every managed client after its node sessions have closed.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.intsize()Return the number of distinct client policy groups, primarily for lifecycle diagnostics and tests.
-
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 configurationcontrolExecutor- bounded connection and control-operation executortransferExecutor- bounded deployment transfer executorcommandExecutor- virtual-thread executor for long-running remote commandsdiagnosticBytes- maximum stdout/stderr bytes retained per commandcopyBufferBytes- 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:
closein interfaceAutoCloseable
-