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 Details

    • cmdPrefix

      private final String cmdPrefix
    • rootDirResolver

      private GitLocationResolver rootDirResolver
    • executorsProvider

      private Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> executorsProvider
  • Constructor Details

    • AbstractGitCommandFactory

      protected AbstractGitCommandFactory(String name, String cmdPrefix)
      Parameters:
      name - Command factory logical name
      cmdPrefix - The command prefix used to detect and intercept GIT commands handled by this factory (never null/empty)
  • Method Details

    • getCommandPrefix

      public String getCommandPrefix()
    • getExecutorServiceProvider

      public Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> getExecutorServiceProvider()
      Specified by:
      getExecutorServiceProvider in interface org.apache.sshd.common.util.threads.ExecutorServiceProvider
    • withExecutorServiceProvider

      public AbstractGitCommandFactory withExecutorServiceProvider(Supplier<? extends org.apache.sshd.common.util.threads.CloseableExecutorService> provider)
      Parameters:
      provider - A Supplier of CloseableExecutorService to be used when starting a Git command execution. If null then a single-threaded ad-hoc service is used.
      Returns:
      Self instance
    • getGitLocationResolver

      public GitLocationResolver getGitLocationResolver()
      Specified by:
      getGitLocationResolver in interface GitLocationResolverCarrier
    • 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, String command)
      Specified by:
      isSupportedCommand in class org.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 class org.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 class org.apache.sshd.server.command.AbstractDelegatingCommandFactory
    • resolveExecutorService

      protected org.apache.sshd.common.util.threads.CloseableExecutorService resolveExecutorService(String command)
    • createGitCommand

      protected abstract AbstractGitCommand createGitCommand(String command)