Class BaseGitCommand
- java.lang.Object
-
- org.uberfire.java.nio.fs.jgit.daemon.ssh.BaseGitCommand
-
- All Implemented Interfaces:
Runnable,org.apache.sshd.server.command.Command,org.apache.sshd.server.command.CommandLifecycle,org.apache.sshd.server.SessionAware
- Direct Known Subclasses:
GitReceiveCommand,GitUploadCommand
public abstract class BaseGitCommand extends Object implements org.apache.sshd.server.command.Command, org.apache.sshd.server.SessionAware, Runnable
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringcommandprotected StringrepositoryNameprotected org.eclipse.jgit.transport.resolver.RepositoryResolverrepositoryResolverstatic org.apache.sshd.common.AttributeRepository.AttributeKey<org.jboss.errai.security.shared.api.identity.User>SUBJECT_KEY
-
Constructor Summary
Constructors Constructor Description BaseGitCommand(String command, JGitFileSystemProvider.RepositoryResolverImpl repositoryResolver, ExecutorService executorService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy(org.apache.sshd.server.channel.ChannelSession channel)protected abstract voidexecute(org.eclipse.jgit.lib.Repository repository, InputStream in, OutputStream out, OutputStream err)protected abstract StringgetCommandName()org.jboss.errai.security.shared.api.identity.UsergetUser()voidrun()voidsetErrorStream(OutputStream err)voidsetExitCallback(org.apache.sshd.server.ExitCallback callback)voidsetInputStream(InputStream in)voidsetOutputStream(OutputStream out)voidsetSession(org.apache.sshd.server.session.ServerSession session)voidstart(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env)
-
-
-
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
-
-
Constructor Detail
-
BaseGitCommand
public BaseGitCommand(String command, JGitFileSystemProvider.RepositoryResolverImpl repositoryResolver, ExecutorService executorService)
-
-
Method Detail
-
getCommandName
protected abstract String getCommandName()
-
setInputStream
public void setInputStream(InputStream in)
- Specified by:
setInputStreamin interfaceorg.apache.sshd.server.command.Command
-
setOutputStream
public void setOutputStream(OutputStream out)
- Specified by:
setOutputStreamin interfaceorg.apache.sshd.server.command.Command
-
setErrorStream
public void setErrorStream(OutputStream err)
- Specified by:
setErrorStreamin interfaceorg.apache.sshd.server.command.Command
-
setExitCallback
public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
- Specified by:
setExitCallbackin interfaceorg.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:
startin interfaceorg.apache.sshd.server.command.CommandLifecycle- Throws:
IOException
-
execute
protected abstract void execute(org.eclipse.jgit.lib.Repository repository, InputStream in, OutputStream out, OutputStream err)
-
destroy
public void destroy(org.apache.sshd.server.channel.ChannelSession channel) throws Exception- Specified by:
destroyin interfaceorg.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:
setSessionin interfaceorg.apache.sshd.server.SessionAware
-
-