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 UnsupportedAttributePolicy
private ChannelDataReceiver
private SftpErrorStatusDataHandler
private Supplier<? extends CloseableExecutorService>
private SftpFileSystemAccessor
static final String
private UnsupportedAttributePolicy
Fields 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()
void
setErrorChannelDataReceiver
(ChannelDataReceiver errorChannelDataReceiver) void
void
setExecutorServiceProvider
(Supplier<? extends CloseableExecutorService> provider) void
setFileSystemAccessor
(SftpFileSystemAccessor accessor) void
Methods inherited from class org.apache.sshd.sftp.server.AbstractSftpEventListenerManager
addSftpEventListener, getRegisteredListeners, getSftpEventListenerProxy, removeSftpEventListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.util.threads.ExecutorServiceProvider
resolveExecutorService
Methods 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:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
getExecutorServiceProvider
- Specified by:
getExecutorServiceProvider
in interfaceExecutorServiceProvider
- Returns:
- A
Supplier
ofCloseableExecutorService
to be used when asynchronous execution required. Ifnull
then a single-threaded ad-hoc service is used.
-
setExecutorServiceProvider
- Specified by:
setExecutorServiceProvider
in interfaceManagedExecutorServiceSupplier
- Parameters:
provider
- TheSupplier
ofCloseableExecutorService
-s to be used when asynchronous execution is required. Ifnull
then a single-threaded ad-hoc service is used.
-
getUnsupportedAttributePolicy
- Specified by:
getUnsupportedAttributePolicy
in interfaceSftpUnsupportedAttributePolicyProvider
- Returns:
- The
UnsupportedAttributePolicy
to use if failed to access some local file attributes
-
setUnsupportedAttributePolicy
- Parameters:
p
- TheUnsupportedAttributePolicy
to use if failed to access some local file attributes - nevernull
-
getFileSystemAccessor
- Specified by:
getFileSystemAccessor
in interfaceSftpFileSystemAccessorProvider
- Returns:
- The
SftpFileSystemAccessor
to use for accessing files and directories
-
setFileSystemAccessor
- Specified by:
setFileSystemAccessor
in interfaceSftpFileSystemAccessorManager
-
getErrorStatusDataHandler
- Specified by:
getErrorStatusDataHandler
in interfaceSftpErrorStatusDataHandlerProvider
- Returns:
- The (never
null
)SftpErrorStatusDataHandler
to use when generating failed commands error messages
-
setErrorStatusDataHandler
-
getExecutorService
- Specified by:
getExecutorService
in interfaceExecutorServiceCarrier
- Returns:
- The
CloseableExecutorService
to use
-
getErrorChannelDataReceiver
- Specified by:
getErrorChannelDataReceiver
in interfaceSftpErrorDataChannelReceiverProvider
- Returns:
- A
ChannelDataReceiver
to handle optional STDERR data received during SFTP session. Ifnull
then any received such data is ignored.
-
setErrorChannelDataReceiver
-
createSubsystem
- Specified by:
createSubsystem
in interfaceSubsystemFactory
- Parameters:
channel
- TheChannelSession
through which the command has been received- Returns:
- a non
null
Command
instance representing the subsystem to be run - Throws:
IOException
- if failed to create the instance
-