Package org.apache.solr.cli
Class SolrCLI
java.lang.Object
org.apache.solr.cli.SolrCLI
- All Implemented Interfaces:
CLIO
Command-line utility for working with Solr.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcheckSslStoreSysProp(String solrInstallDir, String key) static ToolfindTool(String[] args, ToolRuntime runtime) static org.apache.commons.cli.HelpFormatterstatic StringgetOptionWithDeprecatedAndDefault(org.apache.commons.cli.CommandLine cli, org.apache.commons.cli.Option opt, org.apache.commons.cli.Option deprecated, String def) Returns the value of the option with the given name, or the value of the deprecated option.static voidRuns a tool.static org.apache.commons.cli.CommandLineparseCmdLine(Tool tool, String[] args) static org.apache.solr.common.util.NamedList<Object> postJsonToSolr(org.apache.solr.client.solrj.SolrClient solrClient, String updatePath, String jsonBody) static voidstatic voidstatic voidprintGreen(Object message) Console print using green colorstatic voidConsole print using red colorstatic voidprintToolHelp(Tool tool) Prints tool help for a given toolstatic org.apache.commons.cli.CommandLineprocessCommandLineArgs(Tool tool, String[] args) Parses the command-line arguments passed by the user.static Stringuptime(long uptimeMs)
-
Constructor Details
-
SolrCLI
public SolrCLI()
-
-
Method Details
-
main
Runs a tool.- Throws:
Exception
-
findTool
- Throws:
Exception
-
parseCmdLine
-
checkSslStoreSysProp
-
getOptionWithDeprecatedAndDefault
public static String getOptionWithDeprecatedAndDefault(org.apache.commons.cli.CommandLine cli, org.apache.commons.cli.Option opt, org.apache.commons.cli.Option deprecated, String def) Returns the value of the option with the given name, or the value of the deprecated option. If both values are null, then it returns the default value.If this method is marked as unused by your IDE, it means we have no deprecated CLI options currently, congratulations! This method is preserved for the next time we need to deprecate a CLI option.
-
processCommandLineArgs
Parses the command-line arguments passed by the user. -
printToolHelp
Prints tool help for a given tool -
getFormatter
public static org.apache.commons.cli.HelpFormatter getFormatter() -
postJsonToSolr
public static org.apache.solr.common.util.NamedList<Object> postJsonToSolr(org.apache.solr.client.solrj.SolrClient solrClient, String updatePath, String jsonBody) throws Exception - Throws:
Exception
-
uptime
-
print
-
printGreen
Console print using green color -
printRed
Console print using red color -
print
-