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.String
cmdPrefix
private java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService>
executorsProvider
private GitLocationResolver
rootDirResolver
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractGitCommandFactory(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 AbstractGitCommand
createGitCommand(java.lang.String command)
protected org.apache.sshd.server.command.Command
createUnsupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)
protected org.apache.sshd.server.command.Command
executeSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)
java.lang.String
getCommandPrefix()
java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService>
getExecutorServiceProvider()
GitLocationResolver
getGitLocationResolver()
boolean
isSupportedCommand(org.apache.sshd.server.channel.ChannelSession channel, java.lang.String command)
protected org.apache.sshd.common.util.threads.CloseableExecutorService
resolveExecutorService(java.lang.String command)
AbstractGitCommandFactory
withDelegate(org.apache.sshd.server.command.CommandFactory delegate)
AbstractGitCommandFactory
withExecutorServiceProvider(java.util.function.Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider)
AbstractGitCommandFactory
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
-
-
-
-
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:
getExecutorServiceProvider
in 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
- 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
public GitLocationResolver getGitLocationResolver()
- Specified by:
getGitLocationResolver
in 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:
isSupportedCommand
in 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:
executeSupportedCommand
in 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:
createUnsupportedCommand
in 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)
-
-