Class CommandModule

java.lang.Object
com.google.inject.AbstractModule
com.google.gerrit.extensions.config.FactoryModule
com.google.gerrit.lifecycle.LifecycleModule
com.google.gerrit.sshd.CommandModule
All Implemented Interfaces:
com.google.inject.Module
Direct Known Subclasses:
DefaultCommandModule, ExternalIdCommandsModule, IndexCommandsModule, LfsPluginAuthCommand.LfsPluginAuthCommandModule, PluginCommandModule, SequenceCommandsModule, SingleCommandPluginModule

public abstract class CommandModule extends com.google.gerrit.lifecycle.LifecycleModule
Module to register commands in the SSH daemon.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CommandModule(boolean slaveMode)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    alias(CommandName parent, String name, Class<? extends BaseCommand> clazz)
    Alias one command to another.
    protected void
    alias(String from, String to)
    Alias one command to another.
    protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command>
    Configure a command to be invoked by name.
    protected void
    command(CommandName parent, Class<? extends BaseCommand> clazz)
    Configure a command to be invoked by name.
    protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command>
    command(CommandName parent, String name)
    Configure a command to be invoked by name.
    protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command>
    Configure a command to be invoked by name.

    Methods inherited from class com.google.gerrit.lifecycle.LifecycleModule

    listener

    Methods inherited from class com.google.gerrit.extensions.config.FactoryModule

    factory

    Methods inherited from class com.google.inject.AbstractModule

    addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestInjection, requestStaticInjection, requireBinding, requireBinding

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • slaveMode

      protected final boolean slaveMode
  • Constructor Details

    • CommandModule

      protected CommandModule(boolean slaveMode)
  • Method Details

    • command

      protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command> command(String name)
      Configure a command to be invoked by name.
      Parameters:
      name - the name of the command the client will provide in order to call the command.
      Returns:
      a binding that must be bound to a non-singleton provider for a Command object.
    • command

      protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command> command(CommandName name)
      Configure a command to be invoked by name.
      Parameters:
      name - the name of the command the client will provide in order to call the command.
      Returns:
      a binding that must be bound to a non-singleton provider for a Command object.
    • command

      protected com.google.inject.binder.LinkedBindingBuilder<org.apache.sshd.server.command.Command> command(CommandName parent, String name)
      Configure a command to be invoked by name.
      Parameters:
      parent - context of the parent command, that this command is a subcommand of.
      name - the name of the command the client will provide in order to call the command.
      Returns:
      a binding that must be bound to a non-singleton provider for a Command object.
    • command

      protected void command(CommandName parent, Class<? extends BaseCommand> clazz)
      Configure a command to be invoked by name. The command is bound to the passed class.
      Parameters:
      parent - context of the parent command, that this command is a subcommand of.
      clazz - class of the command with CommandMetaData annotation to retrieve the name and the description from
    • alias

      protected void alias(CommandName parent, String name, Class<? extends BaseCommand> clazz)
      Alias one command to another. The alias is bound to the passed class.
      Parameters:
      parent - context of the parent command, that this command is a subcommand of.
      name - the name of the command the client will provide in order to call the command.
      clazz - class of the command with CommandMetaData annotation to retrieve the description from
    • alias

      protected void alias(String from, String to)
      Alias one command to another.
      Parameters:
      from - the new command name that when called will actually delegate to to's implementation.
      to - name of an already registered command that will perform the action when from is invoked by a client.