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
FieldsModifier and TypeFieldDescriptionprivate final String
private Supplier
<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> private GitLocationResolver
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractGitCommand
createGitCommand
(String command) protected org.apache.sshd.server.command.Command
createUnsupportedCommand
(org.apache.sshd.server.channel.ChannelSession channel, String command) protected org.apache.sshd.server.command.Command
executeSupportedCommand
(org.apache.sshd.server.channel.ChannelSession channel, String command) Supplier
<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> boolean
isSupportedCommand
(org.apache.sshd.server.channel.ChannelSession channel, String command) protected org.apache.sshd.common.util.threads.CloseableExecutorService
resolveExecutorService
(String command) withDelegate
(org.apache.sshd.server.command.CommandFactory delegate) withExecutorServiceProvider
(Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider) withGitLocationResolver
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.util.threads.ExecutorServiceProvider
resolveExecutorService
-
Field Details
-
cmdPrefix
-
rootDirResolver
-
executorsProvider
private Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> 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
public Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> getExecutorServiceProvider()- Specified by:
getExecutorServiceProvider
in interfaceorg.apache.sshd.common.util.threads.ExecutorServiceProvider
-
withExecutorServiceProvider
public AbstractGitCommandFactory withExecutorServiceProvider(Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider) - Parameters:
provider
- ASupplier
ofCloseableExecutorService
to be used when starting a Git command execution. Ifnull
then a single-threaded ad-hoc service is used.- Returns:
- Self instance
-
getGitLocationResolver
- Specified by:
getGitLocationResolver
in interfaceGitLocationResolverCarrier
-
withGitLocationResolver
-
withDelegate
public AbstractGitCommandFactory withDelegate(org.apache.sshd.server.command.CommandFactory delegate) -
isSupportedCommand
public boolean isSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, String command) - Specified by:
isSupportedCommand
in classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
executeSupportedCommand
protected org.apache.sshd.server.command.Command executeSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, String command) - Specified by:
executeSupportedCommand
in classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
createUnsupportedCommand
protected org.apache.sshd.server.command.Command createUnsupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, String command) - Overrides:
createUnsupportedCommand
in classorg.apache.sshd.server.command.AbstractDelegatingCommandFactory
-
resolveExecutorService
protected org.apache.sshd.common.util.threads.CloseableExecutorService resolveExecutorService(String command) -
createGitCommand
-