Class 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  
      • Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        log
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractGitCommandFactory​(java.lang.String name, java.lang.String cmdPrefix)  
    • Field Detail

      • cmdPrefix

        private final java.lang.String cmdPrefix
      • executorsProvider

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

      • AbstractGitCommandFactory

        protected AbstractGitCommandFactory​(java.lang.String name,
                                            java.lang.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 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 interface org.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 - 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
      • isSupportedCommand

        public boolean isSupportedCommand​(org.apache.sshd.server.channel.ChannelSession channel,
                                          java.lang.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,
                                                                                 java.lang.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,
                                                                                  java.lang.String command)
        Overrides:
        createUnsupportedCommand in class org.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)