net.shibboleth.metadata.cli
Class SimpleCommandLineArguments

java.lang.Object
  extended by net.shibboleth.metadata.cli.SimpleCommandLineArguments

public class SimpleCommandLineArguments
extends Object

Command line arguments for the SimpleCommandLine command line tool.


Field Summary
private  jargs.gnu.CmdLineParser cliParser
          The configured command line parser.
private  boolean help
          Help has been requested.
private  jargs.gnu.CmdLineParser.Option helpOption
          Option object for the --help option.
private  String inFile
          Provided input file name for the Spring configuration file.
private  String logConfig
          Name of a specific logging configuration, if one has been requested.
private  jargs.gnu.CmdLineParser.Option logConfigOption
          Option object for the --logConfig option.
private  String pipelineName
          Provided name for the pipeline bean to execute.
private  boolean quiet
          Quiet logging has been requested.
private  jargs.gnu.CmdLineParser.Option quietOption
          Option object for the --quiet option.
private  boolean verbose
          Verbose logging has been requested.
private  jargs.gnu.CmdLineParser.Option verboseOption
          Option object for the --verbose option.
 
Constructor Summary
SimpleCommandLineArguments()
          Constructor.
 
Method Summary
 boolean doHelp()
          Indicates the presence of the --help option.
 boolean doQuietOutput()
          Indicates the presence of the --quiet option.
 boolean doVerboseOutput()
          Indicates the presence of the --verbose option.
private  void errorAndExit(String error)
          Prints the error message to STDERR and then exits.
 String getInputFile()
          Gets the parsed input file name from the command line.
 String getLoggingConfiguration()
          Gets the name of the requested logging configuration file from the command line.
 String getPipelineName()
          Returns the name of the pipeline bean to execute from the command line.
 void parseCommandLineArguments(String[] args)
          Parse an array of command-line arguments as passed to the main program.
 void printHelp(PrintStream out)
          Print command line help instructions.
private  void validateCommandLineArguments()
          Validate the provided command line arguments, for example issuing an error if they are inconsistent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inFile

@Nullable
private String inFile
Provided input file name for the Spring configuration file.


pipelineName

@Nullable
private String pipelineName
Provided name for the pipeline bean to execute.


verbose

private boolean verbose
Verbose logging has been requested.


verboseOption

@Nonnull
private final jargs.gnu.CmdLineParser.Option verboseOption
Option object for the --verbose option.


quiet

private boolean quiet
Quiet logging has been requested.


quietOption

@Nonnull
private final jargs.gnu.CmdLineParser.Option quietOption
Option object for the --quiet option.


logConfig

@Nullable
private String logConfig
Name of a specific logging configuration, if one has been requested.


logConfigOption

@Nonnull
private final jargs.gnu.CmdLineParser.Option logConfigOption
Option object for the --logConfig option.


help

private boolean help
Help has been requested.


helpOption

@Nonnull
private final jargs.gnu.CmdLineParser.Option helpOption
Option object for the --help option.


cliParser

@Nonnull
private final jargs.gnu.CmdLineParser cliParser
The configured command line parser.

Constructor Detail

SimpleCommandLineArguments

public SimpleCommandLineArguments()
Constructor.

Method Detail

parseCommandLineArguments

public void parseCommandLineArguments(String[] args)
Parse an array of command-line arguments as passed to the main program.

Parameters:
args - array of command-line arguments to parse.

getInputFile

@Nullable
public String getInputFile()
Gets the parsed input file name from the command line.

Returns:
the input file name argument

getPipelineName

@Nullable
public String getPipelineName()
Returns the name of the pipeline bean to execute from the command line.

Returns:
the pipeline bean name argument

doVerboseOutput

public boolean doVerboseOutput()
Indicates the presence of the --verbose option.

Returns:
true if the user requested verbose logging.

doQuietOutput

public boolean doQuietOutput()
Indicates the presence of the --quiet option.

Returns:
true if the user requested quiet logging.

getLoggingConfiguration

@Nullable
public String getLoggingConfiguration()
Gets the name of the requested logging configuration file from the command line.

Returns:
the logging configuration file name, or null.

doHelp

public boolean doHelp()
Indicates the presence of the --help option.

Returns:
true if the user requested help.

validateCommandLineArguments

private void validateCommandLineArguments()
Validate the provided command line arguments, for example issuing an error if they are inconsistent.


printHelp

public void printHelp(PrintStream out)
Print command line help instructions.

Parameters:
out - location where to print the output

errorAndExit

private void errorAndExit(String error)
Prints the error message to STDERR and then exits.

Parameters:
error - the error message


Copyright © 1999-2012. All Rights Reserved.