if(!isLocalHost(programOpts.getHost())) {
throw new CommandException(strings.get("CannotExecuteLocally"));
}
GFLauncher launcher = null;
try {
launcher = GFLauncherFactory.getInstance(RuntimeType.DAS);
GFLauncherInfo info = launcher.getInfo();
info.setDomainName(domainName);
info.setDomainParentDir(domainDir);
launcher.setup();
//If secure admin is enabled and if new password is null
//throw new exception
if(launcher.isSecureAdminEnabled()) {
String newPassword = (String) passwords.get(newpwName);
if ((newPassword == null) || (newPassword.isEmpty())) {
throw new CommandException(strings.get("NullNewPassword"));
}
}
String adminKeyFile = launcher.getAdminRealmKeyFile();
if (adminKeyFile != null) {
//This is a FileRealm, instantiate it.
FileRealmHelper helper = new FileRealmHelper(adminKeyFile);