Class ChangeMasterPasswordCommand
- java.lang.Object
-
- com.sun.enterprise.admin.cli.CLICommand
-
- com.sun.enterprise.admin.servermgmt.cli.ChangeMasterPasswordCommand
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
@Service(name="change-master-password") @PerLookup public class ChangeMasterPasswordCommand extends CLICommand
The change-master-password command. This is a command which can operate on both the DAS and the node The master password is the password that is used to encrypt the DAS (and instances) keystore. Therefore the DAS and associated server instances need the password to open the keystore at startup. The master password is the same for the DAS and all instances in the domain The default master password is "changeit"and can be saved in a master-password file: 1. DAS: domains/domainname/master-password 2. Instance: nodes/node-name/master-password The master-password may be changed on the DAS by running change-master-password. The DAS must be down to run this command. change-master-password supports the --savemasterpassword option. To change the master-password file on a node you run change-master-password with --nodedir and the node name. The instances must be down to run this command on a node If --nodedir is not specified it will look in the default location of nodes folder and find the node If the domain and node have the same name it will execute the command for the domain. Incase you want the command to be executed for a node when the domain and node name is same you will need to specify the --nodedir option- Author:
- Bhakti Mehta
-
-
Field Summary
Fields Modifier and Type Field Description protected String
domainDirParam
protected String
nodeDir
-
Fields inherited from class com.sun.enterprise.admin.cli.CLICommand
argv, ASADMIN, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, lineReader, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, terminal, WARNING
-
-
Constructor Summary
Constructors Constructor Description ChangeMasterPasswordCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
execute(String... args)
Execute this command with the given arguemnts.protected int
executeCommand()
Execute the command using the options in options and the operands in operands.-
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
buildLineReader, buildTerminal, checkHelp, closeTerminal, execute, expandManPage, getBooleanOption, getBriefCommandUsage, getCommand, getCommand, getCommandScope, getCommandUsage, getManPage, getName, getOperandModel, getOption, getOptions, getPassword, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, newLineReaderBuilder, ok, parse, postConstruct, prepare, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, setCommandScope, toString, usageOptions, validate
-
-
-
-
Method Detail
-
executeCommand
protected int executeCommand() throws CommandException
Description copied from class:CLICommand
Execute the command using the options in options and the operands in operands.- Specified by:
executeCommand
in classCLICommand
- Returns:
- the exit code
- Throws:
CommandException
- if execution of the command failsCommandValidationException
- if there's something wrong with the options or arguments
-
execute
public int execute(String... args) throws CommandException
Description copied from class:CLICommand
Execute this command with the given arguemnts. The implementation in this class saves the passed arguments in the argv field and calls the initializePasswords method. Then it calls the prepare, parse, and validate methods, finally returning the result of calling the executeCommand method. Note that argv[0] is the command name.- Overrides:
execute
in classCLICommand
- Parameters:
args
- Arguments to execute command with- Returns:
- exit code of the command
- Throws:
CommandException
- if execution of the command failsCommandValidationException
- if there's something wrong with the options or arguments
-
-