Package org.wildfly.security.tool
Class Command
java.lang.Object
org.wildfly.security.tool.Command
- Direct Known Subclasses:
FileSystemRealmIntegrityCommand,VaultCommand
Base command class
- Author:
- Peter Skopek
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intGeneral configuration error exit code.static final intstatic final intstatic final intDefault help line width. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliases()protected voidSet an 7 and raise the exceptionabstract voidgetProvidersSupplier(String providersList) intGet tool commandvoidhelp()Display help to the command.booleanbooleanGet the command debug optionstatic booleanvoidprintDuplicatesWarning(org.apache.commons.cli.CommandLine cmdLine) Alerts if any of the command line options used are duplicatedvoidprintDuplicatesWarning(org.apache.commons.cli.CommandLine cmdLine, List<String> duplicatesAllowed) Alerts if any of the command line options used are duplicated, excluding commands that are allowed to have duplicatesprotected StringPrompt for interactive user input with possible confirmation of input data.voidsetEnableDebug(boolean enableDebug) Set the command debug optionprotected voidsetStatus(int status) voidsetToolCommand(String toolCommand) Set tool commandprotected voidwarningHandler(String warning) Print a warning message.
-
Field Details
-
GENERAL_CONFIGURATION_ERROR
public static final int GENERAL_CONFIGURATION_ERRORGeneral configuration error exit code.- See Also:
-
GENERAL_CONFIGURATION_WARNING
public static final int GENERAL_CONFIGURATION_WARNING- See Also:
-
INPUT_DATA_NOT_CONFIRMED
public static final int INPUT_DATA_NOT_CONFIRMED- See Also:
-
ELYTRON_KS_PASS_PROVIDERS
-
WIDTH
public static final int WIDTHDefault help line width.- See Also:
-
-
Constructor Details
-
Command
public Command()
-
-
Method Details
-
execute
- Throws:
Exception
-
help
public void help()Display help to the command. -
isAlias
-
aliases
-
getStatus
public int getStatus() -
setStatus
protected void setStatus(int status) -
isWindows
public static boolean isWindows() -
prompt
protected String prompt(boolean echo, String prompt, boolean confirm, String confirmPrompt) throws Exception Prompt for interactive user input with possible confirmation of input data. When data are not confirmed tool exits withINPUT_DATA_NOT_CONFIRMEDexit code- Parameters:
echo- echo the characters typedprompt- text to display before the inputconfirm- confirm data after the first inputconfirmPrompt- confirmation text- Returns:
- data as user inputs it
- Throws:
Exception- if aBufferedReadercannot be created
-
printDuplicatesWarning
public void printDuplicatesWarning(org.apache.commons.cli.CommandLine cmdLine) Alerts if any of the command line options used are duplicated- Parameters:
cmdLine- the command line options used when invoking the command, after parsing
-
printDuplicatesWarning
public void printDuplicatesWarning(org.apache.commons.cli.CommandLine cmdLine, List<String> duplicatesAllowed) Alerts if any of the command line options used are duplicated, excluding commands that are allowed to have duplicates- Parameters:
cmdLine- the command line options used when invoking the command, after parsingduplicatesAllowed- list of the commands line options that can be duplicated. For example:ListallowedDuplicates = new ArrayList () {{ add(PASSWORD_CREDENTIAL_VALUE_PARAM); }};
-
warningHandler
Print a warning message.- Parameters:
warning- The warning to be shown
-
errorHandler
Set an 7 and raise the exception- Parameters:
e- The exception thrown during execution- Throws:
Exception- The exception to be handled by Elytron Tool
-
isEnableDebug
public boolean isEnableDebug()Get the command debug option -
setEnableDebug
public void setEnableDebug(boolean enableDebug) Set the command debug option -
getToolCommand
Get tool command -
setToolCommand
Set tool command -
getProvidersSupplier
-