Package org.apache.sshd.sftp.server
Class SftpSubsystemFactory
java.lang.Object
org.apache.sshd.sftp.server.AbstractSftpEventListenerManager
org.apache.sshd.sftp.server.SftpSubsystemFactory
- All Implemented Interfaces:
NamedResource,ExecutorServiceCarrier,ExecutorServiceProvider,ManagedExecutorServiceSupplier,SubsystemFactory,SftpErrorDataChannelReceiverProvider,SftpErrorStatusDataHandlerProvider,SftpEventListenerManager,SftpFileSystemAccessorManager,SftpFileSystemAccessorProvider,SftpSubsystemConfigurator,SftpUnsupportedAttributePolicyProvider
public class SftpSubsystemFactory
extends AbstractSftpEventListenerManager
implements ManagedExecutorServiceSupplier, SubsystemFactory, SftpEventListenerManager, SftpFileSystemAccessorManager, SftpSubsystemConfigurator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnsupportedAttributePolicyprivate ChannelDataReceiverprivate SftpErrorStatusDataHandlerprivate Supplier<? extends CloseableExecutorService> private SftpFileSystemAccessorstatic final Stringprivate UnsupportedAttributePolicyFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSubsystem(ChannelSession channel) Supplier<? extends CloseableExecutorService> getName()voidsetErrorChannelDataReceiver(ChannelDataReceiver errorChannelDataReceiver) voidvoidsetExecutorServiceProvider(Supplier<? extends CloseableExecutorService> provider) voidsetFileSystemAccessor(SftpFileSystemAccessor accessor) voidMethods inherited from class org.apache.sshd.sftp.server.AbstractSftpEventListenerManager
addSftpEventListener, getRegisteredListeners, getSftpEventListenerProxy, removeSftpEventListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.util.threads.ExecutorServiceProvider
resolveExecutorServiceMethods inherited from interface org.apache.sshd.sftp.server.SftpEventListenerManager
addSftpEventListener, getSftpEventListenerProxy, removeSftpEventListener
-
Field Details
-
NAME
- See Also:
-
DEFAULT_POLICY
-
executorsProvider
-
policy
-
fileSystemAccessor
-
errorStatusDataHandler
-
errorChannelDataReceiver
-
-
Constructor Details
-
SftpSubsystemFactory
public SftpSubsystemFactory()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
getExecutorServiceProvider
- Specified by:
getExecutorServiceProviderin interfaceExecutorServiceProvider- Returns:
- A
SupplierofCloseableExecutorServiceto be used when asynchronous execution required. Ifnullthen a single-threaded ad-hoc service is used.
-
setExecutorServiceProvider
- Specified by:
setExecutorServiceProviderin interfaceManagedExecutorServiceSupplier- Parameters:
provider- TheSupplierofCloseableExecutorService-s to be used when asynchronous execution is required. Ifnullthen a single-threaded ad-hoc service is used.
-
getUnsupportedAttributePolicy
- Specified by:
getUnsupportedAttributePolicyin interfaceSftpUnsupportedAttributePolicyProvider- Returns:
- The
UnsupportedAttributePolicyto use if failed to access some local file attributes
-
setUnsupportedAttributePolicy
- Parameters:
p- TheUnsupportedAttributePolicyto use if failed to access some local file attributes - nevernull
-
getFileSystemAccessor
- Specified by:
getFileSystemAccessorin interfaceSftpFileSystemAccessorProvider- Returns:
- The
SftpFileSystemAccessorto use for accessing files and directories
-
setFileSystemAccessor
- Specified by:
setFileSystemAccessorin interfaceSftpFileSystemAccessorManager
-
getErrorStatusDataHandler
- Specified by:
getErrorStatusDataHandlerin interfaceSftpErrorStatusDataHandlerProvider- Returns:
- The (never
null)SftpErrorStatusDataHandlerto use when generating failed commands error messages
-
setErrorStatusDataHandler
-
getExecutorService
- Specified by:
getExecutorServicein interfaceExecutorServiceCarrier- Returns:
- The
CloseableExecutorServiceto use
-
getErrorChannelDataReceiver
- Specified by:
getErrorChannelDataReceiverin interfaceSftpErrorDataChannelReceiverProvider- Returns:
- A
ChannelDataReceiverto handle optional STDERR data received during SFTP session. Ifnullthen any received such data is ignored.
-
setErrorChannelDataReceiver
-
createSubsystem
- Specified by:
createSubsystemin interfaceSubsystemFactory- Parameters:
channel- TheChannelSessionthrough which the command has been received- Returns:
- a non
nullCommandinstance representing the subsystem to be run - Throws:
IOException- if failed to create the instance
-