Cumulus4j API
(1.1.0)

org.cumulus4j.keymanager.cli
Class SubCommand

java.lang.Object
  extended by org.cumulus4j.keymanager.cli.SubCommand
Direct Known Subclasses:
HelpSubCommand, LicenceSubCommand, SubCommandWithKeyManagerAPI, SubCommandWithKeyStore, VersionSubCommand

public abstract class SubCommand
extends Object

Sub-command for a certain CLI operation.

The key-store-command-line-interface uses a syntax similar to the svn command and the logic of the command 'java -jar org.cumulus4j.keymanager.cli-VERSION.jar SUBCOMMAND -arg1 val1 -arg2 val2 ...' is thus actually implemented by a class extending this class and registering for a certain 'SUBCOMMAND'.

Every subclass of this class can declare its arguments using annotations like Option.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
SubCommand()
           
 
Method Summary
abstract  String getSubCommandDescription()
          Get the description for this sub-command.
abstract  String getSubCommandName()
          Get the name of the sub-command, i.e.
 void prepare()
           
protected  String promptPassword(String fmt, Object... args)
           
abstract  void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubCommand

public SubCommand()
Method Detail

getSubCommandName

public abstract String getSubCommandName()
Get the name of the sub-command, i.e. what the user has to write in the command line.

Returns:
the name of the sub-command.

getSubCommandDescription

public abstract String getSubCommandDescription()
Get the description for this sub-command.

Returns:
the description.

prepare

public void prepare()
             throws Exception
Throws:
Exception

run

public abstract void run()
                  throws Exception
Throws:
Exception

promptPassword

protected String promptPassword(String fmt,
                                Object... args)

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.