Interface ShellCommandsProvider

All Known Implementing Classes:
AdminShell, ClientShell, ConfigShell

public interface ShellCommandsProvider
Commands provider for Pulsar shell.
  • Method Details

    • getName

      String getName()
      Name of the commands. This will be used as program name.
      Returns:
    • getServiceUrl

      String getServiceUrl()
      Current service url for connecting to brokers. If the provider doesn't need brokers connection or the service url is not set it must return null.
      Returns:
      service url
    • getAdminUrl

      String getAdminUrl()
      Current admin url for connecting to pulsar admin. If the provider doesn't need brokers connection or the admin url is not set it must return null.
      Returns:
      admin url
    • setupState

      void setupState(Properties properties)
      Init state before a command is executed. If the implementing class rely on JCommander, it's suggested to not recycle JCommander objects because they are meant to single-shot usage.
      Parameters:
      properties -
    • cleanupState

      void cleanupState(Properties properties)
      Cleanup state after a command is executed. If the implementing class rely on JCommander, it's suggested to not recycle JCommander objects because they are meant to single-shot usage.
      Parameters:
      properties -
    • getJCommander

      com.beust.jcommander.JCommander getJCommander()
      Return JCommander instance, if exists.
      Returns:
    • runCommand

      boolean runCommand(String[] args) throws Exception
      Run command for the passed args.
      Parameters:
      args - arguments for the command. Note that the first word of the user command is omitted.
      Throws:
      Exception - if any error occurs. The shell session will not be closed.