public class CommandLineProcessor extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
CommandLineProcessor.DatasourceType |
static class |
CommandLineProcessor.RequestType |
static class |
CommandLineProcessor.ResourceType |
Modifier | Constructor and Description |
---|---|
protected |
CommandLineProcessor(String[] args)
Parses the command line and handles the situation where it isn't a valid import or export or rest request
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static String |
getErrorMessage() |
static Exception |
getException()
Returns information about any exception encountered (if one was generated)
|
protected String |
getOptionValue(String option,
boolean required,
boolean emptyOk)
Returns the option value from the command line
|
protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository |
getRepository()
Why does this return a web service? Going directly to the IUnifiedRepository requires the following:
PentahoSessionHolder setup including password and tenant ID.
|
protected CommandLineProcessor.RequestType |
getRequestType() |
static void |
main(String[] args)
How this class is executed from the command line.
|
protected static void |
printHelp() |
void |
setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository) |
protected CommandLineProcessor(String[] args) throws org.apache.commons.cli.ParseException
args
- the command line argumentsorg.apache.commons.cli.ParseException
- indicates that neither (or both) an import and/or export have been requestpublic static void main(String[] args) throws Exception
args
- Exception
public static Exception getException()
Exception
that was generated, or null
if none was generatedpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected CommandLineProcessor.RequestType getRequestType()
public void setRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository)
protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository() throws org.apache.commons.cli.ParseException, org.pentaho.di.core.exception.KettleException
org.apache.commons.cli.ParseException
org.pentaho.di.core.exception.KettleException
protected String getOptionValue(String option, boolean required, boolean emptyOk) throws org.apache.commons.cli.ParseException
option
- the option whose value should be returned (NOTE: null
will be returned if the option was not
provided)required
- indicates if the option is requiredemptyOk
- indicates if a blank value is acceptablenull
if none was providedorg.apache.commons.cli.ParseException
- indicates the required or non-blank value was not providedpublic static String getErrorMessage()
protected static void printHelp()
Copyright © 2020 Hitachi Vantara. All rights reserved.