public class SimpleScpClientImpl extends AbstractLoggingBean implements SimpleScpClient
Modifier and Type | Field and Description |
---|---|
private SimpleClient |
clientInstance |
private ScpClientCreator |
scpClientCreator |
log
Constructor and Description |
---|
SimpleScpClientImpl() |
SimpleScpClientImpl(SimpleClient client) |
SimpleScpClientImpl(SimpleClient client,
ScpClientCreator scpClientCreator) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected CloseableScpClient |
createScpClient(ClientSession session) |
protected CloseableScpClient |
createScpClient(ClientSession session,
ScpClient client) |
protected CloseableScpClient |
createScpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) |
SimpleClient |
getClient() |
ScpClientCreator |
getScpClientCreator() |
boolean |
isOpen() |
CloseableScpClient |
scpLogin(java.net.SocketAddress target,
java.lang.String username,
java.security.KeyPair identity)
Creates an SCP session using the provided credentials
|
CloseableScpClient |
scpLogin(java.net.SocketAddress target,
java.lang.String username,
java.lang.String password)
Creates an SCP session using the provided credentials
|
void |
setClient(SimpleClient client) |
void |
setScpClientCreator(ScpClientCreator scpClientCreator) |
getSimplifiedLogger
private SimpleClient clientInstance
private ScpClientCreator scpClientCreator
public SimpleScpClientImpl()
public SimpleScpClientImpl(SimpleClient client)
public SimpleScpClientImpl(SimpleClient client, ScpClientCreator scpClientCreator)
public SimpleClient getClient()
public void setClient(SimpleClient client)
public ScpClientCreator getScpClientCreator()
public void setScpClientCreator(ScpClientCreator scpClientCreator)
public CloseableScpClient scpLogin(java.net.SocketAddress target, java.lang.String username, java.lang.String password) throws java.io.IOException
SimpleScpClient
scpLogin
in interface SimpleScpClient
target
- The target SocketAddress
username
- Usernamepassword
- PasswordCloseableScpClient
- Note: closing the client also closes its
underlying sessionjava.io.IOException
- If failed to login or authenticatepublic CloseableScpClient scpLogin(java.net.SocketAddress target, java.lang.String username, java.security.KeyPair identity) throws java.io.IOException
SimpleScpClient
scpLogin
in interface SimpleScpClient
target
- The target SocketAddress
username
- Usernameidentity
- The KeyPair
identityCloseableScpClient
- Note: closing the client also closes its
underlying sessionjava.io.IOException
- If failed to login or authenticateprotected CloseableScpClient createScpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) throws java.io.IOException
java.io.IOException
protected CloseableScpClient createScpClient(ClientSession session) throws java.io.IOException
java.io.IOException
protected CloseableScpClient createScpClient(ClientSession session, ScpClient client) throws java.io.IOException
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
java.io.IOException