use of com.sun.enterprise.util.cluster.windows.process.WindowsException in project Payara by payara.
the class ValidateDcom method testDcomFileWrite.
private boolean testDcomFileWrite() {
try {
script = new WindowsRemoteFile(wrf, SCRIPT_NAME);
script.copyFrom("dir " + testdir + "\\\n");
out.append(Strings.get("dcom.write.ok", SCRIPT_NAME, testdir, host)).append('\n');
} catch (WindowsException ex) {
setError(ex, Strings.get("dcom.no.write", SCRIPT_NAME, testdir, host));
return false;
}
return true;
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsException in project Payara by payara.
the class ValidateDcom method testWMI.
private boolean testWMI() {
int count = -1;
try {
WindowsWmi ww = new WindowsWmi(creds);
count = ww.getCount();
if (debug) {
String[] info = ww.getInfo();
out.append(Strings.get("dcom.wmi.procinfolegend"));
for (String s : info) {
// e.g. '\tCommandLine = "xxxxx"'
String[] lines = s.split("[\t\n\r]");
for (String line : lines) {
if (line.startsWith("CommandLine")) {
out.append(" ").append(line).append('\n');
break;
}
}
}
}
} catch (WindowsException ex) {
setError(ex, Strings.get("dcom.no.wmi", host));
return false;
}
out.append(Strings.get("dcom.wmi.ok", host, count)).append('\n');
return true;
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsException in project Payara by payara.
the class ValidateDcom method testRemoteScript.
private boolean testRemoteScript() {
String scriptOut = null;
try {
WindowsRemoteScripter scripter = new WindowsRemoteScripter(creds);
scriptOut = scripter.run(scriptFullPath);
script.delete();
} catch (WindowsException ex) {
setError(ex, Strings.get("dcom.no.run", host));
return false;
}
out.append(Strings.get("dcom.run.ok", host, crunch(12, scriptOut))).append('\n');
return true;
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsException in project Payara by payara.
the class ValidateDcom method testJdkAvailable.
private boolean testJdkAvailable() {
try {
script = new WindowsRemoteFile(wrf, SCRIPT_NAME);
script.copyFrom("javac -version \r\n");
WindowsRemoteScripter scripter = new WindowsRemoteScripter(creds);
// javac and jar write to stderr NOT stdout
scripter.wantStdErr();
String scriptOut = scripter.run(scriptFullPath);
script.delete();
out.append(Strings.get("dcom.yes.jdk", host, scriptOut));
out.append('\n');
return true;
} catch (WindowsException ex) {
setError(ex, Strings.get("dcom.no.jdk", host));
return false;
}
}
use of com.sun.enterprise.util.cluster.windows.process.WindowsException in project Payara by payara.
the class NodeRunnerDcom method runAdminCommandOnRemoteNode.
/*
* return 0 is success, otherwise failure
*/
public final int runAdminCommandOnRemoteNode(Node thisNode, StringBuilder output, List<String> args, List<String> stdinLines) throws SSHCommandExecutionException, IllegalArgumentException, UnsupportedOperationException {
String humanreadable = null;
try {
this.node = thisNode;
dcomInfo = new DcomInfo(node);
List<String> fullcommand = new ArrayList<String>();
WindowsRemoteAsadmin asadmin = dcomInfo.getAsadmin();
if (stdinLines != null && !stdinLines.isEmpty())
setupAuthTokenFile(fullcommand, stdinLines);
fullcommand.addAll(args);
humanreadable = dcomInfo.getNadminPath() + " " + commandListToString(fullcommand);
// This is where the rubber meets the road...
String out = asadmin.run(fullcommand);
output.append(out);
logger.info(Strings.get("remote.command.summary", humanreadable, out));
return determineStatus(args);
} catch (WindowsException ex) {
throw new SSHCommandExecutionException(Strings.get("remote.command.error", ex.getMessage(), humanreadable), ex);
} finally {
teardownAuthTokenFile();
}
}
Aggregations