@ComponentProfile(summary="Connect to a server using the SSH File Transfer Protocol; authentication via a configured authentication provider", tag="connections,sftp") public class StandardSftpConnection extends FileTransferConnection
SftpAuthenticationProvider
.In the adapter configuration file this class is aliased as standard-sftp-connection which is the preferred alternative to the fully qualified classname when building your configuration.
FileTransferConnection.UserInfo
DEFAULT_EXPIRATION, DEFAULT_MAX_CACHE_SIZE
log
Constructor and Description |
---|
StandardSftpConnection() |
StandardSftpConnection(ConfigBuilder config,
SftpAuthenticationProvider prov) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptProtocol(java.lang.String s)
Validate the URL Protocol when a URL is used.
|
protected FileTransferClient |
create(java.lang.String remoteHost,
int port,
FileTransferConnection.UserInfo ui)
Create an instance of the
FileTransferClient for use with the producer or consumer. |
protected FileTransferConnection.UserInfo |
createUserInfo() |
int |
defaultControlPort() |
SftpAuthenticationProvider |
getAuthentication() |
ConfigBuilder |
getConfiguration() |
java.lang.String |
getKnownHostsFile() |
TimeInterval |
getSocketTimeout() |
protected void |
initConnection()
Initialise the underlying connection.
|
void |
setAuthentication(SftpAuthenticationProvider p) |
void |
setConfiguration(ConfigBuilder repo)
Set the config repository.
|
void |
setKnownHostsFile(java.lang.String k) |
void |
setSocketTimeout(TimeInterval t)
The socket timeout in milliseconds for connect / read /write operations.
|
additionalDebug, cacheConnection, closeConnection, connect, disconnect, expirationMillis, forceRelativePath, getAdditionalDebug, getCacheConnection, getCacheExpiration, getDefaultControlPort, getDefaultUserName, getDirectoryRoot, getForceRelativePath, getMaxClientCacheSize, getWindowsWorkAround, maxClientCacheSize, setAdditionalDebug, setCacheConnection, setCacheExpiration, setDefaultControlPort, setDefaultUserName, setForceRelativePath, setMaxClientCache, setWindowsWorkAround, windowsWorkaround, withCacheExpiration
prepareConnection, startConnection, stopConnection
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getLookupName, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setLookupName, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
public StandardSftpConnection()
public StandardSftpConnection(ConfigBuilder config, SftpAuthenticationProvider prov)
protected boolean acceptProtocol(java.lang.String s)
FileTransferConnection
acceptProtocol
in class FileTransferConnection
s
- the URL Protocolprotected FileTransferClient create(java.lang.String remoteHost, int port, FileTransferConnection.UserInfo ui) throws java.io.IOException, FileTransferException, PasswordException
FileTransferConnection
FileTransferClient
for use with the producer or consumer.create
in class FileTransferConnection
remoteHost
- the remote host.port
- the port to connect toui
- a local UserInfo containing username and passwordFileTransferClient
objectjava.io.IOException
- wrapping a general comms error.FileTransferException
- if a protocol specific exception occurred.PasswordException
protected void initConnection() throws CoreException
AdaptrisConnectionImp
initConnection
in class FileTransferConnection
CoreException
- wrapping any exception.NoOpConnection.initConnection()
public TimeInterval getSocketTimeout()
public void setSocketTimeout(TimeInterval t)
t
- The socketTimeout to set, default is 60000protected FileTransferConnection.UserInfo createUserInfo() throws FileTransferException
createUserInfo
in class FileTransferConnection
FileTransferException
public java.lang.String getKnownHostsFile()
public void setKnownHostsFile(java.lang.String k)
public int defaultControlPort()
defaultControlPort
in class FileTransferConnection
public ConfigBuilder getConfiguration()
public void setConfiguration(ConfigBuilder repo)
Use a config repository to set various SSH based settings (such as PreferredAuthentications
or
ServerAliveInterval
.
repo
- the configRepository to setpublic SftpAuthenticationProvider getAuthentication()
public void setAuthentication(SftpAuthenticationProvider p)
p
- the authProvider to set