public class ScpCommandFactory extends AbstractDelegatingCommandFactory implements org.apache.sshd.common.util.threads.ManagedExecutorServiceSupplier, ScpFileOpenerHolder, Cloneable, ShellFactory, ShellFactorySelector
CommandFactory can be used as a standalone command factory or can be used to augment another
CommandFactory and provides SCP support.ScpCommand,
ScpShell| Modifier and Type | Class and Description |
|---|---|
static class |
ScpCommandFactory.Builder
A useful
ObjectBuilder for ScpCommandFactory |
| Modifier and Type | Field and Description |
|---|---|
static String |
SCP_FACTORY_NAME |
log| Constructor and Description |
|---|
ScpCommandFactory() |
createCommand, createUnsupportedCommand, getDelegateCommandFactory, setDelegateCommandFactory, toStringdebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitresolveExecutorServiceselectShellFactorysplitpublic static final String SCP_FACTORY_NAME
public ScpFileOpener getScpFileOpener()
getScpFileOpener in interface ScpFileOpenerHolderScpFileOpener set via call to ScpFileOpenerHolder.setScpFileOpener(ScpFileOpener)public void setScpFileOpener(ScpFileOpener fileOpener)
setScpFileOpener in interface ScpFileOpenerHolderfileOpener - The default ScpFileOpener to use - if null then a default opener is usedpublic Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> getExecutorServiceProvider()
getExecutorServiceProvider in interface org.apache.sshd.common.util.threads.ExecutorServiceProviderpublic void setExecutorServiceProvider(Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider)
setExecutorServiceProvider in interface org.apache.sshd.common.util.threads.ManagedExecutorServiceSupplierpublic int getSendBufferSize()
public void setSendBufferSize(int sendSize)
sendSize - Size (in bytes) of buffer to use when sending filesScpHelper.MIN_SEND_BUFFER_SIZEpublic int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveSize)
receiveSize - Size (in bytes) of buffer to use when receiving filesScpHelper.MIN_RECEIVE_BUFFER_SIZEpublic boolean addEventListener(ScpTransferEventListener listener)
listener - The ScpTransferEventListener to addtrue if this is a new listener instance, false if the
listener is already registeredIllegalArgumentException - if null listenerpublic boolean removeEventListener(ScpTransferEventListener listener)
listener - The ScpTransferEventListener to removetrue if the listener was registered and removed, false if the
listener was not registered to begin withIllegalArgumentException - if null listenerpublic boolean isSupportedCommand(ChannelSession channel, String command)
isSupportedCommand in class AbstractDelegatingCommandFactoryprotected Command executeSupportedCommand(ChannelSession channel, String command)
executeSupportedCommand in class AbstractDelegatingCommandFactorypublic ShellFactory getDelegateShellFactory()
ShellFactory to use if selectShellFactory(ChannelSession) decides not to
use itself as the ShellFactory - default=InteractiveProcessShellFactory.setDelegateShellFactory(ShellFactory)public void setDelegateShellFactory(ShellFactory delegateShellFactory)
delegateShellFactory - The ShellFactory to use if selectShellFactory(ChannelSession)
decides not to use itself as the ShellFactory. If null then it will
always decide to use itself regardless of the ChannelSessionselectShellFactory(ChannelSession)public ShellFactory selectShellFactory(ChannelSession channelSession) throws IOException
selectShellFactory in interface ShellFactorySelectorIOExceptionpublic Command createShell(ChannelSession channel) throws IOException
createShell in interface ShellFactoryIOExceptionprotected org.apache.sshd.common.util.threads.CloseableExecutorService resolveExecutorService(String command)
public ScpCommandFactory clone()
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.