use of com.sun.enterprise.util.cluster.windows.process.WindowsCredentials in project Payara by payara.
the class InstallNodeDcomCommand method unpackOnHosts.
private void unpackOnHosts(String host, String remotePassword, String unpackScript) throws WindowsException, CommandException {
String domain = windowsDomain;
if (!ok(domain))
domain = host;
WindowsCredentials bonafides = new WindowsCredentials(host, domain, getRemoteUser(), remotePassword);
WindowsRemoteScripter scripter = new WindowsRemoteScripter(bonafides);
String out = scripter.run(unpackScript);
if (out == null || out.length() < 50)
throw new CommandException(Strings.get("dcom.error.unpacking", unpackScript, out));
if (logger.isLoggable(Level.FINE))
logger.fine("Output from Windows Unpacker:\n" + out);
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsCredentials in project Payara by payara.
the class NodeUtils method pingDcomConnection.
/**
* Make sure GF is installed and available.
*
* @throws CommandValidationException
*/
void pingDcomConnection(String host, String domain, String username, String password, String installRoot) throws CommandValidationException {
if (!StringUtils.ok(password))
throw new CommandValidationException(Strings.get("dcom.nopassword"));
// resolve password aliases
password = DcomUtils.resolvePassword(resolver.resolve(password));
if (NetUtils.isThisHostLocal(host))
throw new CommandValidationException(Strings.get("dcom.yes.local", host));
try {
installRoot = installRoot.replace('/', '\\');
WindowsRemoteFileSystem wrfs = new WindowsRemoteFileSystem(host, username, password);
WindowsRemoteFile wrf = new WindowsRemoteFile(wrfs, installRoot);
WindowsCredentials creds = new WindowsCredentials(host, domain, username, password);
// also looking for side-effect of Exception getting thrown...
if (!wrf.exists()) {
throw new CommandValidationException(Strings.get("dcom.no.remote.install", host, installRoot));
}
if (!WindowsRemotePinger.ping(installRoot, creds))
throw new CommandValidationException(Strings.get("dcom.no.connection", host));
} catch (CommandValidationException cve) {
throw cve;
} catch (Exception ex) {
throw new CommandValidationException(ex);
}
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsCredentials in project Payara by payara.
the class ValidateDcom method init.
private boolean init(AdminCommandContext context) {
report = context.getActionReport();
report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
user = resolver.resolve(user);
password = DcomUtils.resolvePassword(resolver.resolve(password));
if (!ok(password)) {
setError(Strings.get("dcom.nopassword"));
return false;
}
// backslash does not actually matter but it's neater
testdir = resolver.resolve(testdir).replace('/', '\\');
if (testdir.endsWith("\\"))
testdir = testdir.substring(0, testdir.length() - 1);
if (!ok(windowsdomain))
windowsdomain = host;
creds = new WindowsCredentials(host, windowsdomain, user, password);
try {
wrfs = new WindowsRemoteFileSystem(creds);
} catch (WindowsException ex) {
// probably the j-interop-repackagted.jar is missing
setError(ex.getMessage());
return false;
}
scriptFullPath = testdir + "\\" + SCRIPT_NAME;
return true;
}
Aggregations