Package org.apache.sshd.git
Class AbstractGitCommandFactory
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.command.AbstractDelegatingCommandFactory
org.apache.sshd.git.AbstractGitCommandFactory
- All Implemented Interfaces:
ExecutorServiceProvider,GitLocationResolverCarrier,CommandFactory
- Direct Known Subclasses:
GitPackCommandFactory,GitPgmCommandFactory
public abstract class AbstractGitCommandFactory
extends AbstractDelegatingCommandFactory
implements ExecutorServiceProvider, GitLocationResolverCarrier
Helper class for various Git command factories
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate Supplier<? extends CloseableExecutorService>private GitLocationResolverFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractGitCommandcreateGitCommand(String command) protected CommandcreateUnsupportedCommand(ChannelSession channel, String command) protected CommandexecuteSupportedCommand(ChannelSession channel, String command) Supplier<? extends CloseableExecutorService>booleanisSupportedCommand(ChannelSession channel, String command) protected CloseableExecutorServiceresolveExecutorService(String command) withDelegate(CommandFactory delegate) withExecutorServiceProvider(Supplier<? extends CloseableExecutorService> provider) withGitLocationResolver(GitLocationResolver rootDirResolver) Methods inherited from class org.apache.sshd.server.command.AbstractDelegatingCommandFactory
createCommand, getDelegateCommandFactory, setDelegateCommandFactory, toStringMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.util.threads.ExecutorServiceProvider
resolveExecutorService
-
Field Details
-
cmdPrefix
-
rootDirResolver
-
executorsProvider
-
-
Constructor Details
-
AbstractGitCommandFactory
- Parameters:
name- Command factory logical namecmdPrefix- The command prefix used to detect and intercept GIT commands handled by this factory (nevernull/empty)
-
-
Method Details
-
getCommandPrefix
-
getExecutorServiceProvider
- Specified by:
getExecutorServiceProviderin interfaceExecutorServiceProvider- Returns:
- A
SupplierofCloseableExecutorServiceto be used when asynchronous execution required. Ifnullthen a single-threaded ad-hoc service is used.
-
withExecutorServiceProvider
public AbstractGitCommandFactory withExecutorServiceProvider(Supplier<? extends CloseableExecutorService> provider) - Parameters:
provider- ASupplierofCloseableExecutorServiceto be used when starting a Git command execution. Ifnullthen a single-threaded ad-hoc service is used.- Returns:
- Self instance
-
getGitLocationResolver
- Specified by:
getGitLocationResolverin interfaceGitLocationResolverCarrier
-
withGitLocationResolver
-
withDelegate
-
isSupportedCommand
- Specified by:
isSupportedCommandin classAbstractDelegatingCommandFactory- Parameters:
channel- TheChannelSessionthrough which the command was receivedcommand- The command about to be executed- Returns:
trueif this command is supported by the command factory,falseif it will be passed on to thedelegatefactory
-
executeSupportedCommand
- Specified by:
executeSupportedCommandin classAbstractDelegatingCommandFactory
-
createUnsupportedCommand
- Overrides:
createUnsupportedCommandin classAbstractDelegatingCommandFactory
-
resolveExecutorService
-
createGitCommand
-