Class SftpSubsystemFactory
- java.lang.Object
-
- org.apache.sshd.server.subsystem.sftp.AbstractSftpEventListenerManager
-
- org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory
-
- All Implemented Interfaces:
NamedResource
,ExecutorServiceProvider
,ManagedExecutorServiceSupplier
,SftpEventListenerManager
,SftpFileSystemAccessorManager
,SubsystemFactory
public class SftpSubsystemFactory extends AbstractSftpEventListenerManager implements ManagedExecutorServiceSupplier, SubsystemFactory, SftpEventListenerManager, SftpFileSystemAccessorManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SftpSubsystemFactory.Builder
-
Field Summary
Fields Modifier and Type Field Description static UnsupportedAttributePolicy
DEFAULT_POLICY
private SftpErrorStatusDataHandler
errorStatusDataHandler
private java.util.function.Supplier<? extends CloseableExecutorService>
executorsProvider
private SftpFileSystemAccessor
fileSystemAccessor
static java.lang.String
NAME
private UnsupportedAttributePolicy
policy
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Constructor Summary
Constructors Constructor Description SftpSubsystemFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Command
createSubsystem(ChannelSession channel)
SftpErrorStatusDataHandler
getErrorStatusDataHandler()
java.util.function.Supplier<? extends CloseableExecutorService>
getExecutorServiceProvider()
SftpFileSystemAccessor
getFileSystemAccessor()
java.lang.String
getName()
UnsupportedAttributePolicy
getUnsupportedAttributePolicy()
void
setErrorStatusDataHandler(SftpErrorStatusDataHandler handler)
void
setExecutorServiceProvider(java.util.function.Supplier<? extends CloseableExecutorService> provider)
void
setFileSystemAccessor(SftpFileSystemAccessor accessor)
void
setUnsupportedAttributePolicy(UnsupportedAttributePolicy p)
-
Methods inherited from class org.apache.sshd.server.subsystem.sftp.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.server.subsystem.sftp.SftpEventListenerManager
addSftpEventListener, getSftpEventListenerProxy, removeSftpEventListener
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
DEFAULT_POLICY
public static final UnsupportedAttributePolicy DEFAULT_POLICY
-
executorsProvider
private java.util.function.Supplier<? extends CloseableExecutorService> executorsProvider
-
policy
private UnsupportedAttributePolicy policy
-
fileSystemAccessor
private SftpFileSystemAccessor fileSystemAccessor
-
errorStatusDataHandler
private SftpErrorStatusDataHandler errorStatusDataHandler
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
getExecutorServiceProvider
public java.util.function.Supplier<? extends CloseableExecutorService> 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
public void setExecutorServiceProvider(java.util.function.Supplier<? extends CloseableExecutorService> provider)
- 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
public UnsupportedAttributePolicy getUnsupportedAttributePolicy()
-
setUnsupportedAttributePolicy
public void setUnsupportedAttributePolicy(UnsupportedAttributePolicy p)
- Parameters:
p
- TheUnsupportedAttributePolicy
to use if failed to access some local file attributes - nevernull
-
getFileSystemAccessor
public SftpFileSystemAccessor getFileSystemAccessor()
- Specified by:
getFileSystemAccessor
in interfaceSftpFileSystemAccessorManager
-
setFileSystemAccessor
public void setFileSystemAccessor(SftpFileSystemAccessor accessor)
- Specified by:
setFileSystemAccessor
in interfaceSftpFileSystemAccessorManager
-
getErrorStatusDataHandler
public SftpErrorStatusDataHandler getErrorStatusDataHandler()
-
setErrorStatusDataHandler
public void setErrorStatusDataHandler(SftpErrorStatusDataHandler handler)
-
createSubsystem
public Command createSubsystem(ChannelSession channel) throws java.io.IOException
- 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:
java.io.IOException
- if failed to create the instance
-
-