Package com.netscape.cmstools.cli
Class CLI
- java.lang.Object
-
- com.netscape.cmstools.cli.CLI
-
- Direct Known Subclasses:
ActivityCLI,ActivityFindCLI,ActivityShowCLI,AuditCLI,AuditFileFindCLI,AuditFileRetrieveCLI,AuditModifyCLI,AuditShowCLI,AuthenticatorAddCLI,AuthenticatorCLI,AuthenticatorFindCLI,AuthenticatorModifyCLI,AuthenticatorRemoveCLI,AuthenticatorShowCLI,AuthorityCLI,AuthorityCreateCLI,AuthorityDisableCLI,AuthorityEnableCLI,AuthorityFindCLI,AuthorityKeyExportCLI,AuthorityRemoveCLI,AuthorityShowCLI,CACertCLI,CACertFindCLI,CACertHoldCLI,CACertReleaseHoldCLI,CACertRequestFindCLI,CACertRequestProfileFindCLI,CACertRequestProfileShowCLI,CACertRequestReviewCLI,CACertRequestShowCLI,CACertRequestSubmitCLI,CACertRevokeCLI,CACertShowCLI,CACertStatusCLI,ClientCertFindCLI,ClientCertImportCLI,ClientCertModifyCLI,ClientCertRemoveCLI,ClientCertRequestCLI,ClientCertShowCLI,ClientCertValidateCLI,ClientCLI,ClientInitCLI,ConfigCLI,ConfigModifyCLI,ConfigShowCLI,ConnectorAddCLI,ConnectorCLI,ConnectorFindCLI,ConnectorModifyCLI,ConnectorRemoveCLI,ConnectorShowCLI,FeatureCLI,FeatureFindCLI,FeatureShowCLI,GroupAddCLI,GroupCLI,GroupFindCLI,GroupMemberAddCLI,GroupMemberCLI,GroupMemberFindCLI,GroupMemberRemoveCLI,GroupMemberShowCLI,GroupModifyCLI,GroupRemoveCLI,GroupShowCLI,HelpCLI,KRAConnectorAddCLI,KRAConnectorCLI,KRAConnectorRemoveCLI,KRAConnectorShowCLI,KRAKeyArchiveCLI,KRAKeyCLI,KRAKeyFindCLI,KRAKeyGenerateCLI,KRAKeyModifyCLI,KRAKeyRecoverCLI,KRAKeyRequestFindCLI,KRAKeyRequestReviewCLI,KRAKeyRequestShowCLI,KRAKeyRetrieveCLI,KRAKeyShowCLI,KRAKeyTemplateFindCLI,KRAKeyTemplateShowCLI,MainCLI,PKCS11CertCLI,PKCS11CertFindCLI,PKCS11CertRemoveCLI,PKCS11CertShowCLI,PKCS11CLI,PKCS11KeyCLI,PKCS11KeyFindCLI,PKCS11KeyRemoveCLI,PKCS11KeyShowCLI,PKCS12CertAddCLI,PKCS12CertCLI,PKCS12CertExportCLI,PKCS12CertFindCLI,PKCS12CertImportCLI,PKCS12CertModCLI,PKCS12CertRemoveCLI,PKCS12CLI,PKCS12ExportCLI,PKCS12ImportCLI,PKCS12KeyCLI,PKCS12KeyFindCLI,PKCS12KeyRemoveCLI,PKCS7CertCLI,PKCS7CertExportCLI,PKCS7CertFindCLI,PKCS7CLI,ProfileAddCLI,ProfileAddCLI,ProfileCLI,ProfileCLI,ProfileDisableCLI,ProfileEditCLI,ProfileEnableCLI,ProfileFindCLI,ProfileFindCLI,ProfileMappingAddCLI,ProfileMappingCLI,ProfileMappingFindCLI,ProfileMappingModifyCLI,ProfileMappingRemoveCLI,ProfileMappingShowCLI,ProfileModifyCLI,ProfileModifyCLI,ProfileRemoveCLI,ProfileRemoveCLI,ProfileShowCLI,ProfileShowCLI,ProxyCLI,SecurityDomainCLI,SecurityDomainShowCLI,SelfTestCLI,SelfTestFindCLI,SelfTestRunCLI,SelfTestShowCLI,SubsystemCLI,TokenAddCLI,TokenCLI,TokenFindCLI,TokenModifyCLI,TokenRemoveCLI,TokenShowCLI,TPSCertCLI,TPSCertFindCLI,TPSCertShowCLI,TPSConnectorAddCLI,TPSConnectorCLI,TPSConnectorFindCLI,TPSConnectorModCLI,TPSConnectorRemoveCLI,TPSConnectorShowCLI,UserAddCLI,UserCertAddCLI,UserCertCLI,UserCertFindCLI,UserCertRemoveCLI,UserCertShowCLI,UserCLI,UserFindCLI,UserMembershipAddCLI,UserMembershipCLI,UserMembershipFindCLI,UserMembershipRemoveCLI,UserModifyCLI,UserRemoveCLI,UserShowCLI
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.HelpFormatterformatterjava.util.Map<java.lang.String,CLI>modulesjava.lang.Stringnameorg.apache.commons.cli.OptionsoptionsCLIparentstatic org.apache.commons.cli.CommandLineParserparserstatic booleanverbose
-
Method Summary
All Methods Static 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.util.Collection<CLI>getDeprecatedModules()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()booleanisDeprecated()static booleanisVerbose()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)static voidsetVerbose(boolean verbose)
-
-
-
Field Detail
-
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()
-
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
-
getDeprecatedModules
public java.util.Collection<CLI> getDeprecatedModules()
-
printHelp
public void printHelp()
-
execute
public void execute(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
isVerbose
public static boolean isVerbose()
-
setVerbose
public static void setVerbose(boolean verbose)
-
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
-
-