public class SshClientPool extends Object
Constructor and Description |
---|
SshClientPool(ExecutorService executor,
SshClientFactory factory) |
SshClientPool(ExecutorService executor,
SshClientFactory factory,
long processingInterval) |
Modifier and Type | Method and Description |
---|---|
void |
checkin(SshClient client)
Check in an idle client.
|
SshClient |
checkout(String host,
int port,
String username)
Check out an available client.
|
SshClient |
checkout(String host,
int port,
String username,
SshClientFactory factory)
Check out an available client.
|
int |
getClientCount()
Return the total number of clients in the pool
|
int |
getClientCount(String host,
int port,
String username)
Return the total number of clients in the pool for a given host/port/user combination.
|
protected boolean |
processIdle(SshClient client)
Process an idle event for the client.
|
void |
setClientSocketTimeout(long clientSocketTimeout)
When allowing a client time on its socket, how many milliseconds should the socket
timeout be set to.
|
public SshClientPool(ExecutorService executor, SshClientFactory factory)
executor
- factory
- public SshClientPool(ExecutorService executor, SshClientFactory factory, long processingInterval)
executor
- factory
- processingInterval
- public void checkin(SshClient client)
client
- public SshClient checkout(String host, int port, String username) throws SshException, IOException
SshClientFactory
.host
- port
- username
- SshException
IOException
public SshClient checkout(String host, int port, String username, SshClientFactory factory) throws SshException, IOException
SshClientFactory
.host
- port
- username
- factory
- SshException
IOException
public void setClientSocketTimeout(long clientSocketTimeout)
clientSocketTimeout
- default is 1000msprotected boolean processIdle(SshClient client)
client
- public int getClientCount()
Copyright © 2024. All rights reserved.