Package lcmc.cluster.service.ssh

Examples of lcmc.cluster.service.ssh.SshOutput


     * Start the drbd. Probably /etc/init.d/drbd start and calls the callback
     * function after it is done.
     */
    public static boolean start(final Host host, final ExecCallback execCallback, final Application.RunMode runMode) {
        final String command = host.getDistCommand("DRBD.start", (ConvertCmdCallback) null);
        final SshOutput ret = execCommand(host, command, execCallback, true, runMode);
        return ret.getExitCode() == 0;

    }
View Full Code Here


     * Executes load drbd command on the specified host and calls the callback
     * function after it is done.
     */
    public static boolean load(final Host host, final ExecCallback execCallback, final Application.RunMode runMode) {
        final String command = host.getDistCommand("DRBD.load", (ConvertCmdCallback) null);
        final SshOutput ret = execCommand(host, command, execCallback, true, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

     */
    public static boolean startProxy(final Host host,
                                     final ExecCallback execCallback,
                                     final Application.RunMode runMode) {
        final String command = host.getDistCommand("DRBD.startProxy", (ConvertCmdCallback) null);
        final SshOutput ret = execCommand(host, command, execCallback, true, runMode);
        host.updateDrbdParameters(); /* deamon could be started even if ret != 0
        */
        return ret.getExitCode() == 0;
    }
View Full Code Here

     */
    public static boolean stopProxy(final Host host,
                                    final ExecCallback execCallback,
                                    final Application.RunMode runMode) {
        final String command = host.getDistCommand("DRBD.stopProxy", (ConvertCmdCallback) null);
        final SshOutput ret = execCommand(host, command, execCallback, true, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

    /** Delete minor, from DRBD 8.4. */
    public static boolean delMinor(final Host host, final String blockDevice, final Application.RunMode runMode) {
        final Map<String, String> replaceHash = new HashMap<String, String>();
        replaceHash.put(DRBDDEV_PLACE_HOLDER, blockDevice);
        final String command = host.getDistCommand("DRBD.delMinor", replaceHash);
        final SshOutput ret = execCommand(host, command, null, true, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

    }

    /** Delete connection, from DRBD 8.4. */
    public static boolean delConnection(final Host host, final String resource, final Application.RunMode runMode) {
        final String command = host.getDistCommand("DRBD.resDelConnection", getResVolReplaceHash(host, resource, null));
        final SshOutput ret = execCommand(host, command, null, true, runMode);
        return ret.getExitCode() == 0;
    }
View Full Code Here

        }
    }

    public final String updateDrbdParameters(final Host host) {
        final String command = host.getDistCommand("Drbd.getParameters", (ConvertCmdCallback) null);
        final SshOutput ret = host.captureCommand(new ExecCommandConfig().command(command)
                                                                         .silentCommand()
                                                                         .silentOutput());
        if (ret.getExitCode() != 0) {
            return null;
        }
        return ret.getOutput();
    }
View Full Code Here

    public void init(final Host host, final CrmXml crmXML) {
        this.host = host;
        this.crmXML = crmXML;
        final String command = host.getDistCommand("Heartbeat.getClusterMetadata",
                                                   (ConvertCmdCallback) null);
        final SshOutput ret = host.captureCommandProgressIndicator(Tools.getString("Heartbeat.getClusterMetadata"),
                                                                   new ExecCommandConfig().command(command)
                                                                                          .silentCommand()
                                                                                          .silentOutput());
        final String output = ret.getOutput();
        if (ret.getExitCode() != 0) {
            return;
        }
        if (output != null) {
            crmXML.parseClusterMetaData(output);
        }
View Full Code Here

    public String getConfig(final Host host) {
        if (!host.isConnected()) {
            return null;
        }
        final String command2 = host.getDistCommand("Drbd.getConfig", (ConvertCmdCallback) null);
        final SshOutput ret = host.captureCommand(new ExecCommandConfig().command(command2)
                                                                         .silentCommand()
                                                                         .silentOutput());
        if (ret.getExitCode() == 0) {
            final StringBuffer confSB = new StringBuffer(ret.getOutput());
            return host.getOutput("drbd", confSB);
        }
        return null;
    }
View Full Code Here

    @Override
    public boolean exists() {
        if (existCache != null) {
            return existCache;
        }
        final SshOutput out = host.captureCommandProgressIndicator(
                                            "executing...",
                                            new ExecCommandConfig().command(DistResource.SUDO
                                                                            + "stat "
                                                                            + Tools.getUnixPath(toString())
                                                                            + " 2>/dev/null")
                                                                    .silentOutput());
        return out.getExitCode() == 0;
    }
View Full Code Here

TOP

Related Classes of lcmc.cluster.service.ssh.SshOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.