Package org.apache.pulsar.shell
Class AdminShell
java.lang.Object
org.apache.pulsar.admin.cli.PulsarAdminTool
org.apache.pulsar.shell.AdminShell
- All Implemented Interfaces:
ShellCommandsProvider
Pulsar Admin tool extension for Pulsar shell.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pulsar.admin.cli.PulsarAdminTool
PulsarAdminTool.RootParams -
Field Summary
Fields inherited from class org.apache.pulsar.admin.cli.PulsarAdminTool
adminBuilder, commandMap, customCommandFactories, jcommander, rootParams -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupState(Properties properties) Cleanup state after a command is executed.Current admin url for connecting to pulsar admin.com.beust.jcommander.JCommanderReturn JCommander instance, if exists.getName()Name of the commands.Current service url for connecting to brokers.booleanrunCommand(String[] args) Run command for the passed args.voidsetupState(Properties properties) Init state before a command is executed.Methods inherited from class org.apache.pulsar.admin.cli.PulsarAdminTool
createAdminBuilder, initJCommander, initRootParamsFromProperties, main, run, setupCommands
-
Constructor Details
-
AdminShell
- Throws:
Exception
-
-
Method Details
-
getName
Description copied from interface:ShellCommandsProviderName of the commands. This will be used as program name.- Specified by:
getNamein interfaceShellCommandsProvider- Returns:
-
getServiceUrl
Description copied from interface:ShellCommandsProviderCurrent 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.- Specified by:
getServiceUrlin interfaceShellCommandsProvider- Returns:
- service url
-
getAdminUrl
Description copied from interface:ShellCommandsProviderCurrent 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.- Specified by:
getAdminUrlin interfaceShellCommandsProvider- Returns:
- admin url
-
setupState
Description copied from interface:ShellCommandsProviderInit 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.- Specified by:
setupStatein interfaceShellCommandsProvider
-
getJCommander
public com.beust.jcommander.JCommander getJCommander()Description copied from interface:ShellCommandsProviderReturn JCommander instance, if exists.- Specified by:
getJCommanderin interfaceShellCommandsProvider- Returns:
-
cleanupState
Description copied from interface:ShellCommandsProviderCleanup 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.- Specified by:
cleanupStatein interfaceShellCommandsProvider
-
runCommand
Description copied from interface:ShellCommandsProviderRun command for the passed args.- Specified by:
runCommandin interfaceShellCommandsProvider- 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.
-