Class BaseGitCommand

  • All Implemented Interfaces:
    Runnable, org.apache.sshd.server.command.Command, org.apache.sshd.server.command.CommandDirectErrorStreamAware, org.apache.sshd.server.command.CommandDirectInputStreamAware, org.apache.sshd.server.command.CommandDirectOutputStreamAware, org.apache.sshd.server.command.CommandDirectStreamsAware, org.apache.sshd.server.command.CommandLifecycle, org.apache.sshd.server.session.ServerSessionAware
    Direct Known Subclasses:
    GitReceiveCommand, GitUploadCommand

    public abstract class BaseGitCommand
    extends Object
    implements org.apache.sshd.server.command.Command, org.apache.sshd.server.session.ServerSessionAware, Runnable
    • Field Detail

      • SUBJECT_KEY

        public static final org.apache.sshd.common.AttributeRepository.AttributeKey<org.jboss.errai.security.shared.api.identity.User> SUBJECT_KEY
      • command

        protected final String command
      • repositoryName

        protected final String repositoryName
      • repositoryResolver

        protected final org.eclipse.jgit.transport.resolver.RepositoryResolver repositoryResolver
    • Method Detail

      • getCommandName

        protected abstract String getCommandName()
      • setInputStream

        public void setInputStream​(InputStream in)
        Specified by:
        setInputStream in interface org.apache.sshd.server.command.CommandDirectInputStreamAware
      • setOutputStream

        public void setOutputStream​(OutputStream out)
        Specified by:
        setOutputStream in interface org.apache.sshd.server.command.CommandDirectOutputStreamAware
      • setErrorStream

        public void setErrorStream​(OutputStream err)
        Specified by:
        setErrorStream in interface org.apache.sshd.server.command.CommandDirectErrorStreamAware
      • setExitCallback

        public void setExitCallback​(org.apache.sshd.server.ExitCallback callback)
        Specified by:
        setExitCallback in interface org.apache.sshd.server.command.Command
      • start

        public void start​(org.apache.sshd.server.channel.ChannelSession channel,
                          org.apache.sshd.server.Environment env)
                   throws IOException
        Specified by:
        start in interface org.apache.sshd.server.command.CommandLifecycle
        Throws:
        IOException
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • destroy

        public void destroy​(org.apache.sshd.server.channel.ChannelSession channel)
                     throws Exception
        Specified by:
        destroy in interface org.apache.sshd.server.command.CommandLifecycle
        Throws:
        Exception
      • getUser

        public org.jboss.errai.security.shared.api.identity.User getUser()
      • setSession

        public void setSession​(org.apache.sshd.server.session.ServerSession session)
        Specified by:
        setSession in interface org.apache.sshd.server.session.ServerSessionAware