Package org.dogtagpki.cli
Class CLI
- java.lang.Object
-
- org.dogtagpki.cli.CLI
-
- Direct Known Subclasses:
ACMECLI,ActivityCLI,AuditCLI,AuthenticatorCLI,AuthorityCLI,CACertCLI,CACertCLI,CACertRequestCLI,CACLI,CADBCLI,CAProfileCLI,ClientCLI,CommandCLI,ConfigCLI,ConnectorCLI,FeatureCLI,GroupCLI,GroupMemberCLI,KRACertCLI,KRACLI,KRAConnectorCLI,KRAKeyCLI,MainCLI,NSSCertCLI,NSSCLI,NSSKeyCLI,OCSPCLI,PKCS11CertCLI,PKCS11CLI,PKCS11KeyCLI,PKCS12CertCLI,PKCS12CLI,PKCS12KeyCLI,PKCS7CertCLI,PKCS7CLI,PKIServerCLI,ProfileCLI,ProfileCLI,ProfileMappingCLI,ProxyCLI,RangeCLI,SDCLI,SDHostCLI,SecurityDomainCLI,SecurityDomainHostCLI,SelfTestCLI,SubsystemCLI,SubsystemDBCLI,SubsystemGroupCLI,SubsystemGroupMemberCLI,SubsystemRangeCLI,SubsystemUserCertCLI,SubsystemUserCLI,TKSCLI,TKSKeyCLI,TokenCLI,TPSCertCLI,TPSCLI,TPSConnectorCLI,UserCertCLI,UserCLI,UserMembershipCLI
public class CLI extends java.lang.Object- Author:
- Endi S. Dewata
-
-
Field Summary
Fields Modifier and Type Field Description PKIClientclientjava.lang.Stringdescriptionstatic org.apache.commons.cli.HelpFormatterformatterstatic org.slf4j.Loggerloggerjava.util.Map<java.lang.String,CLI>modulesjava.lang.Stringnameorg.apache.commons.cli.OptionsoptionsCLIparentstatic org.apache.commons.cli.CommandLineParserparserstatic booleanverbose
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddModule(CLI module)voidexecute(java.lang.String[] args)CLIfindModule(java.lang.String command)Find the last module that handles the specified command.java.util.List<CLI>findModules(java.lang.String command)Find the list of modules that handle the specified command.PKIClientgetClient()java.lang.ObjectgetClient(java.lang.String name)ClientConfiggetConfig()java.lang.StringgetDescription()java.lang.StringgetFullModuleName(java.lang.String moduleName)java.lang.StringgetFullName()java.lang.StringgetManPage()CLIgetModule(java.lang.String name)java.util.Collection<CLI>getModules()java.lang.StringgetName()CLIgetParent()CLIgetRoot()booleanisDeprecated()voidprintCommands(java.util.Map<java.lang.String,CLI> modules)voidprintHelp()CLIremoveModule(java.lang.String name)voidrunExternal(java.lang.String[] command)voidrunExternal(java.util.List<java.lang.String> command)voidsetDescription(java.lang.String description)voidsetName(java.lang.String name)
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
verbose
public static boolean verbose
-
parser
public static org.apache.commons.cli.CommandLineParser parser
-
formatter
public static org.apache.commons.cli.HelpFormatter formatter
-
name
public java.lang.String name
-
description
public java.lang.String description
-
parent
public CLI parent
-
options
public org.apache.commons.cli.Options options
-
modules
public java.util.Map<java.lang.String,CLI> modules
-
client
public PKIClient client
-
-
Constructor Detail
-
CLI
public CLI(java.lang.String name, java.lang.String description)
-
CLI
public CLI(java.lang.String name, java.lang.String description, CLI parent)
-
-
Method Detail
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getFullName
public java.lang.String getFullName()
-
getFullModuleName
public java.lang.String getFullModuleName(java.lang.String moduleName)
-
getDescription
public java.lang.String getDescription()
-
setDescription
public void setDescription(java.lang.String description)
-
getParent
public CLI getParent()
-
getRoot
public CLI getRoot()
-
isDeprecated
public boolean isDeprecated()
-
getModules
public java.util.Collection<CLI> getModules()
-
getModule
public CLI getModule(java.lang.String name)
-
addModule
public void addModule(CLI module)
-
removeModule
public CLI removeModule(java.lang.String name)
-
findModules
public java.util.List<CLI> findModules(java.lang.String command) throws java.lang.Exception
Find the list of modules that handle the specified command.- Throws:
java.lang.Exception
-
findModule
public CLI findModule(java.lang.String command) throws java.lang.Exception
Find the last module that handles the specified command.- Throws:
java.lang.Exception
-
getManPage
public java.lang.String getManPage()
-
getConfig
public ClientConfig getConfig() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getClient
public PKIClient getClient() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getClient
public java.lang.Object getClient(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
printHelp
public void printHelp()
-
printCommands
public void printCommands(java.util.Map<java.lang.String,CLI> modules)
-
execute
public void execute(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
runExternal
public void runExternal(java.util.List<java.lang.String> command) throws CLIException, java.io.IOException, java.lang.InterruptedException- Throws:
CLIExceptionjava.io.IOExceptionjava.lang.InterruptedException
-
runExternal
public void runExternal(java.lang.String[] command) throws CLIException, java.io.IOException, java.lang.InterruptedException- Throws:
CLIExceptionjava.io.IOExceptionjava.lang.InterruptedException
-
-