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, SftpFileSystemAccessorManager, SftpSubsystemConfigurator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSftpSubsystemFactory.Builder
-
Field Summary
Fields Modifier and Type Field Description static UnsupportedAttributePolicyDEFAULT_POLICYprivate ChannelDataReceivererrorChannelDataReceiverprivate SftpErrorStatusDataHandlererrorStatusDataHandlerprivate java.util.function.Supplier<? extends CloseableExecutorService>executorsProviderprivate SftpFileSystemAccessorfileSystemAccessorstatic java.lang.StringNAMEprivate UnsupportedAttributePolicypolicy-
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 CommandcreateSubsystem(ChannelSession channel)ChannelDataReceivergetErrorChannelDataReceiver()SftpErrorStatusDataHandlergetErrorStatusDataHandler()CloseableExecutorServicegetExecutorService()java.util.function.Supplier<? extends CloseableExecutorService>getExecutorServiceProvider()SftpFileSystemAccessorgetFileSystemAccessor()java.lang.StringgetName()UnsupportedAttributePolicygetUnsupportedAttributePolicy()voidsetErrorChannelDataReceiver(ChannelDataReceiver errorChannelDataReceiver)voidsetErrorStatusDataHandler(SftpErrorStatusDataHandler handler)voidsetExecutorServiceProvider(java.util.function.Supplier<? extends CloseableExecutorService> provider)voidsetFileSystemAccessor(SftpFileSystemAccessor accessor)voidsetUnsupportedAttributePolicy(UnsupportedAttributePolicy p)-
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
-
-
-
-
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
-
errorChannelDataReceiver
private ChannelDataReceiver errorChannelDataReceiver
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
getExecutorServiceProvider
public java.util.function.Supplier<? extends CloseableExecutorService> getExecutorServiceProvider()
- Specified by:
getExecutorServiceProviderin interfaceExecutorServiceProvider- Returns:
- A
SupplierofCloseableExecutorServiceto be used when asynchronous execution required. Ifnullthen a single-threaded ad-hoc service is used.
-
setExecutorServiceProvider
public void setExecutorServiceProvider(java.util.function.Supplier<? extends CloseableExecutorService> provider)
- 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
public UnsupportedAttributePolicy getUnsupportedAttributePolicy()
- Specified by:
getUnsupportedAttributePolicyin interfaceSftpUnsupportedAttributePolicyProvider- Returns:
- The
UnsupportedAttributePolicyto use if failed to access some local file attributes
-
setUnsupportedAttributePolicy
public void setUnsupportedAttributePolicy(UnsupportedAttributePolicy p)
- Parameters:
p- TheUnsupportedAttributePolicyto use if failed to access some local file attributes - nevernull
-
getFileSystemAccessor
public SftpFileSystemAccessor getFileSystemAccessor()
- Specified by:
getFileSystemAccessorin interfaceSftpFileSystemAccessorProvider- Returns:
- The
SftpFileSystemAccessorto use for accessing files and directories
-
setFileSystemAccessor
public void setFileSystemAccessor(SftpFileSystemAccessor accessor)
- Specified by:
setFileSystemAccessorin interfaceSftpFileSystemAccessorManager
-
getErrorStatusDataHandler
public SftpErrorStatusDataHandler getErrorStatusDataHandler()
- Specified by:
getErrorStatusDataHandlerin interfaceSftpErrorStatusDataHandlerProvider- Returns:
- The (never
null)SftpErrorStatusDataHandlerto use when generating failed commands error messages
-
setErrorStatusDataHandler
public void setErrorStatusDataHandler(SftpErrorStatusDataHandler handler)
-
getExecutorService
public CloseableExecutorService getExecutorService()
- Specified by:
getExecutorServicein interfaceExecutorServiceCarrier- Returns:
- The
CloseableExecutorServiceto use
-
getErrorChannelDataReceiver
public ChannelDataReceiver getErrorChannelDataReceiver()
- Specified by:
getErrorChannelDataReceiverin interfaceSftpErrorDataChannelReceiverProvider- Returns:
- A
ChannelDataReceiverto handle optional STDERR data received during SFTP session. Ifnullthen any received such data is ignored.
-
setErrorChannelDataReceiver
public void setErrorChannelDataReceiver(ChannelDataReceiver errorChannelDataReceiver)
-
createSubsystem
public Command createSubsystem(ChannelSession channel) throws java.io.IOException
- Specified by:
createSubsystemin interfaceSubsystemFactory- Parameters:
channel- TheChannelSessionthrough which the command has been received- Returns:
- a non
nullCommandinstance representing the subsystem to be run - Throws:
java.io.IOException- if failed to create the instance
-
-