Search in sources :

Example 1 with WindowsRemoteScripter

use of com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter 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;
}
Also used : WindowsRemoteScripter(com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter) WindowsException(com.sun.enterprise.util.cluster.windows.process.WindowsException)

Example 2 with WindowsRemoteScripter

use of com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter 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;
    }
}
Also used : WindowsRemoteFile(com.sun.enterprise.util.cluster.windows.io.WindowsRemoteFile) WindowsRemoteScripter(com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter) WindowsException(com.sun.enterprise.util.cluster.windows.process.WindowsException)

Example 3 with WindowsRemoteScripter

use of com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter 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);
}
Also used : WindowsRemoteScripter(com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter) CommandException(org.glassfish.api.admin.CommandException) WindowsCredentials(com.sun.enterprise.util.cluster.windows.process.WindowsCredentials)

Aggregations

WindowsRemoteScripter (com.sun.enterprise.util.cluster.windows.process.WindowsRemoteScripter)3 WindowsException (com.sun.enterprise.util.cluster.windows.process.WindowsException)2 WindowsRemoteFile (com.sun.enterprise.util.cluster.windows.io.WindowsRemoteFile)1 WindowsCredentials (com.sun.enterprise.util.cluster.windows.process.WindowsCredentials)1 CommandException (org.glassfish.api.admin.CommandException)1