public class SftpSubsystemFactory extends AbstractSftpEventListenerManager implements ManagedExecutorServiceSupplier, SubsystemFactory, SftpEventListenerManager, SftpFileSystemAccessorManager, SftpSubsystemConfigurator
Modifier and Type | Class and Description |
---|---|
static class |
SftpSubsystemFactory.Builder |
Modifier and Type | Field and Description |
---|---|
static UnsupportedAttributePolicy |
DEFAULT_POLICY |
static String |
NAME |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
SftpSubsystemFactory() |
Modifier and Type | Method and Description |
---|---|
Command |
createSubsystem(ChannelSession channel) |
ChannelDataReceiver |
getErrorChannelDataReceiver() |
SftpErrorStatusDataHandler |
getErrorStatusDataHandler() |
CloseableExecutorService |
getExecutorService() |
Supplier<? extends CloseableExecutorService> |
getExecutorServiceProvider() |
SftpFileSystemAccessor |
getFileSystemAccessor() |
String |
getName() |
UnsupportedAttributePolicy |
getUnsupportedAttributePolicy() |
void |
setErrorChannelDataReceiver(ChannelDataReceiver errorChannelDataReceiver) |
void |
setErrorStatusDataHandler(SftpErrorStatusDataHandler handler) |
void |
setExecutorServiceProvider(Supplier<? extends CloseableExecutorService> provider) |
void |
setFileSystemAccessor(SftpFileSystemAccessor accessor) |
void |
setUnsupportedAttributePolicy(UnsupportedAttributePolicy p) |
addSftpEventListener, getRegisteredListeners, getSftpEventListenerProxy, removeSftpEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolveExecutorService
createSubsystem
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
addSftpEventListener, getSftpEventListenerProxy, removeSftpEventListener
public static final String NAME
public static final UnsupportedAttributePolicy DEFAULT_POLICY
public String getName()
getName
in interface NamedResource
public Supplier<? extends CloseableExecutorService> getExecutorServiceProvider()
getExecutorServiceProvider
in interface ExecutorServiceProvider
Supplier
of CloseableExecutorService
to be used when asynchronous execution required.
If null
then a single-threaded ad-hoc service is used.public void setExecutorServiceProvider(Supplier<? extends CloseableExecutorService> provider)
setExecutorServiceProvider
in interface ManagedExecutorServiceSupplier
provider
- The Supplier
of CloseableExecutorService
-s to be used when asynchronous execution
is required. If null
then a single-threaded ad-hoc service is used.public UnsupportedAttributePolicy getUnsupportedAttributePolicy()
getUnsupportedAttributePolicy
in interface SftpUnsupportedAttributePolicyProvider
UnsupportedAttributePolicy
to use if failed to access some local file attributespublic void setUnsupportedAttributePolicy(UnsupportedAttributePolicy p)
p
- The UnsupportedAttributePolicy
to use if failed to access some local file attributes - never
null
public SftpFileSystemAccessor getFileSystemAccessor()
getFileSystemAccessor
in interface SftpFileSystemAccessorProvider
SftpFileSystemAccessor
to use for accessing files and directoriespublic void setFileSystemAccessor(SftpFileSystemAccessor accessor)
setFileSystemAccessor
in interface SftpFileSystemAccessorManager
public SftpErrorStatusDataHandler getErrorStatusDataHandler()
getErrorStatusDataHandler
in interface SftpErrorStatusDataHandlerProvider
null
) SftpErrorStatusDataHandler
to use when generating failed commands error
messagespublic void setErrorStatusDataHandler(SftpErrorStatusDataHandler handler)
public CloseableExecutorService getExecutorService()
getExecutorService
in interface ExecutorServiceCarrier
CloseableExecutorService
to usepublic ChannelDataReceiver getErrorChannelDataReceiver()
getErrorChannelDataReceiver
in interface SftpErrorDataChannelReceiverProvider
ChannelDataReceiver
to handle optional STDERR data received during SFTP session. If
null
then any received such data is ignored.public void setErrorChannelDataReceiver(ChannelDataReceiver errorChannelDataReceiver)
public Command createSubsystem(ChannelSession channel) throws IOException
createSubsystem
in interface SubsystemFactory
channel
- The ChannelSession
through which the command has been receivednull
Command
instance representing the subsystem to be runIOException
- if failed to create the instanceCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.