public class ScpCommandFactory extends AbstractDelegatingCommandFactory implements ScpFileOpenerHolder, Cloneable, org.apache.sshd.common.util.threads.ExecutorServiceCarrier
CommandFactory can be used as a standalone command factory
or can be used to augment another CommandFactory and provides
SCP support.ScpCommand| 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() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEventListener(ScpTransferEventListener listener) |
ScpCommandFactory |
clone() |
protected Command |
executeSupportedCommand(String command) |
org.apache.sshd.common.util.threads.CloseableExecutorService |
getExecutorService() |
int |
getReceiveBufferSize() |
ScpFileOpener |
getScpFileOpener() |
int |
getSendBufferSize() |
boolean |
isSupportedCommand(String command) |
boolean |
removeEventListener(ScpTransferEventListener listener) |
void |
setExecutorService(org.apache.sshd.common.util.threads.CloseableExecutorService service) |
void |
setReceiveBufferSize(int receiveSize) |
void |
setScpFileOpener(ScpFileOpener fileOpener) |
void |
setSendBufferSize(int sendSize) |
createCommand, createUnsupportedCommand, getDelegateCommandFactory, setDelegateCommandFactory, toStringgetSimplifiedLoggerpublic 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 org.apache.sshd.common.util.threads.CloseableExecutorService getExecutorService()
getExecutorService in interface org.apache.sshd.common.util.threads.ExecutorServiceCarrierpublic void setExecutorService(org.apache.sshd.common.util.threads.CloseableExecutorService service)
service - An CloseableExecutorService to be used when
starting ScpCommand execution. If null then a single-threaded
ad-hoc service is used. Note: the service will not be shutdown
when the command is terminated - unless it is the ad-hoc service, which will be
shutdown regardlesspublic 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(String command)
isSupportedCommand in class AbstractDelegatingCommandFactoryprotected Command executeSupportedCommand(String command)
executeSupportedCommand in class AbstractDelegatingCommandFactorypublic ScpCommandFactory clone()
Copyright © 2018–2019 The Apache Software Foundation. All rights reserved.