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:
org.apache.sshd.common.util.threads.ExecutorServiceProvider,GitLocationResolverCarrier,org.apache.sshd.server.command.CommandFactory
- Direct Known Subclasses:
GitPackCommandFactory,GitPgmCommandFactory
public abstract class AbstractGitCommandFactory extends org.apache.sshd.server.command.AbstractDelegatingCommandFactory implements org.apache.sshd.common.util.threads.ExecutorServiceProvider, GitLocationResolverCarrier
Helper class for various Git command factories
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcmdPrefixprivate java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService>executorsProviderprivate GitLocationResolverrootDirResolver
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGitCommandFactory(java.lang.String name, java.lang.String cmdPrefix)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractGitCommandcreateGitCommand(java.lang.String command)protected org.apache.sshd.server.command.CommandcreateUnsupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)protected org.apache.sshd.server.command.CommandexecuteSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)java.lang.StringgetCommandPrefix()java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService>getExecutorServiceProvider()GitLocationResolvergetGitLocationResolver()booleanisSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)protected org.apache.sshd.common.util.threads.CloseableExecutorServiceresolveExecutorService(java.lang.String command)AbstractGitCommandFactorywithDelegate(org.apache.sshd.server.command.CommandFactory delegate)AbstractGitCommandFactorywithExecutorServiceProvider(java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider)AbstractGitCommandFactorywithGitLocationResolver(GitLocationResolver rootDirResolver)-
Methods inherited from class org.apache.sshd.server.command.AbstractDelegatingCommandFactory
createCommand, getDelegateCommandFactory, setDelegateCommandFactory, toString
-
Methods 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, warn
-
-
-
-
Field Detail
-
cmdPrefix
private final java.lang.String cmdPrefix
-
rootDirResolver
private GitLocationResolver rootDirResolver
-
executorsProvider
private java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> executorsProvider
-
-
Method Detail
-
getCommandPrefix
public java.lang.String getCommandPrefix()
-
getExecutorServiceProvider
public java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> getExecutorServiceProvider()
- Specified by:
getExecutorServiceProviderin interfaceorg.apache.sshd.common.util.threads.ExecutorServiceProvider
-
withExecutorServiceProvider
public AbstractGitCommandFactory withExecutorServiceProvider(java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.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
public GitLocationResolver getGitLocationResolver()
- Specified by:
getGitLocationResolverin interfaceGitLocationResolverCarrier
-
withGitLocationResolver
public AbstractGitCommandFactory withGitLocationResolver(GitLocationResolver rootDirResolver)
-
withDelegate
public AbstractGitCommandFactory withDelegate(org.apache.sshd.server.command.CommandFactory delegate)
-
isSupportedCommand
public boolean isSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)- Specified by:
isSupportedCommandin classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
executeSupportedCommand
protected org.apache.sshd.server.command.Command executeSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)- Specified by:
executeSupportedCommandin classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
createUnsupportedCommand
protected org.apache.sshd.server.command.Command createUnsupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)- Overrides:
createUnsupportedCommandin classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
resolveExecutorService
protected org.apache.sshd.common.util.threads.CloseableExecutorService resolveExecutorService(java.lang.String command)
-
createGitCommand
protected abstract AbstractGitCommand createGitCommand(java.lang.String command)
-
-