Package lcmc.cluster.ui

Examples of lcmc.cluster.ui.ClusterBrowser$DRBDMenuItemCallback


        if (configCheckBoxMap.get(CONFIG_LIBVIRT).isSelected()) {
            for (final Host host : cluster.getHosts()) {
                text.append("\n\n== ")
                        .append(host.getName())
                        .append(" ==\n");
                final ClusterBrowser cb = cluster.getBrowser();
                String cfg = null;
                if (cb != null) {
                    final VmsXml vmsXml = cb.getVmsXml(host);
                    if (vmsXml != null) {
                        cfg = vmsXml.getConfig();
                    }
                }
                if (cfg == null) {
View Full Code Here


    }

    public String getHostToolTip(final Host host) {
        final StringBuilder hostToolTip = new StringBuilder(80);
        hostToolTip.append("<b>").append(host.getName()).append("</b>");
        final ClusterBrowser b = getClusterBrowser();
        if (b != null && b.isRealDcHost(host)) {
            hostToolTip.append(" (designated co-ordinator)");
        }
        if (!host.isConnected()) {
            hostToolTip.append('\n');
            hostToolTip.append(Tools.getString("ClusterBrowser.Host.Disconnected"));
View Full Code Here

        hostToolTip.append(getPacemakerInfo());
        return hostToolTip.toString();
    }

    public DrbdGraph getDrbdGraph() {
        final ClusterBrowser b = getClusterBrowser();
        if (b == null) {
            return null;
        }
        return b.getDrbdGraph();
    }
View Full Code Here

                                } else {
                                    CRM.standByOn(dcHost, hostInfo.getHost(), runMode);
                                }
                            }
                        });
        final ClusterBrowser cb = hostInfo.getBrowser().getClusterBrowser();
        if (cb != null) {
            final ButtonCallback standbyItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            if (hostInfo.isStandby(Application.RunMode.LIVE)) {
                                CRM.standByOff(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            } else {
                                CRM.standByOn(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            }
                        }
                    });
            hostInfo.addMouseOverListener(standbyItem, standbyItemCallback);
        }
        items.add(standbyItem);

        /* Migrate all services from this host. */
        final MyMenuItem allMigrateFromItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.CRM.AllMigrateFrom"),
                        HostInfo.HOST_STANDBY_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL),
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                if (!hostInfo.getHost().isCrmStatusOk()) {
                                    return HostInfo.NO_PCMK_STATUS_STRING;
                                }
                                if (hostInfo.getBrowser().getClusterBrowser().getExistingServiceList(null).isEmpty()) {
                                    return "there are no services to migrate";
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                for (final ServiceInfo si : cb.getExistingServiceList(null)) {
                                    if (!si.isConstraintPlaceholder() && si.getGroupInfo() == null && si.getCloneInfo() == null) {
                                        final List<String> runningOnNodes = si.getRunningOnNodes(Application.RunMode.LIVE);
                                        if (runningOnNodes != null && runningOnNodes.contains(hostInfo.getHost().getName())) {
                                            final Host dcHost = hostInfo.getHost();
                                            si.migrateFromResource(dcHost, hostInfo.getHost().getName(), Application.RunMode.LIVE);
                                        }
                                    }
                                }
                            }
                        });
        if (cb != null) {
            final ButtonCallback allMigrateFromItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            for (final ServiceInfo si : cb.getExistingServiceList(null)) {
                                if (!si.isConstraintPlaceholder() && si.getGroupInfo() == null) {
                                    final List<String> runningOnNodes = si.getRunningOnNodes(Application.RunMode.LIVE);
                                    if (runningOnNodes != null && runningOnNodes.contains(hostInfo.getHost().getName())) {
                                        si.migrateFromResource(dcHost, hostInfo.getHost().getName(), Application.RunMode.TEST);
                                    }
                                }
                            }
                        }
                    });
            hostInfo.addMouseOverListener(allMigrateFromItem, allMigrateFromItemCallback);
        }
        items.add(allMigrateFromItem);
        /* Stop corosync/openais. */
        final MyMenuItem stopCorosyncItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StopCorosync"),
                        HostInfo.HOST_STOP_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        Tools.getString("HostInfo.StopOpenais"),
                        HostInfo.HOST_STOP_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.ADVANCED),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                return null;
                            }
                        })
                        .predicate(new Predicate() {
                            @Override
                            public boolean check() {
                    /* when both are running it's openais. */
                                return hostInfo.getHost().isCorosyncRunning() && !hostInfo.getHost().isOpenaisRunning();
                            }
                        })
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                return hostInfo.getHost().isCorosyncRunning() || hostInfo.getHost().isOpenaisRunning();
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                if (application.confirmDialog(Tools.getString("HostInfo.confirmCorosyncStop.Title"),
                                        Tools.getString("HostInfo.confirmCorosyncStop.Desc"),
                                        Tools.getString("HostInfo.confirmCorosyncStop.Yes"),
                                        Tools.getString("HostInfo.confirmCorosyncStop.No"))) {
                                    final Host thisHost = hostInfo.getHost();
                                    thisHost.setCommLayerStopping(true);
                                    if (!thisHost.isPcmkStartedByCorosync()
                                            && thisHost.hasPacemakerInitScript()
                                            && thisHost.isPacemakerRunning()) {
                                        if (hostInfo.getHost().isCorosyncRunning() && !hostInfo.getHost().isOpenaisRunning()) {
                                            Corosync.stopCorosyncWithPcmk(thisHost);
                                        } else {
                                            Openais.stopOpenaisWithPcmk(thisHost);
                                        }
                                    } else {
                                        if (hostInfo.getHost().isCorosyncRunning() && !hostInfo.getHost().isOpenaisRunning()) {
                                            Corosync.stopCorosync(thisHost);
                                        } else {
                                            Openais.stopOpenais(thisHost);
                                        }
                                    }
                                    updateClusterView(thisHost, hostInfo);
                                }
                            }
                        });
        if (cb != null) {
            final ButtonCallback stopCorosyncItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            if (!hostInfo.isStandby(Application.RunMode.LIVE)) {
                                CRM.standByOn(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            }
                        }
                    });
            hostInfo.addMouseOverListener(stopCorosyncItem, stopCorosyncItemCallback);
        }
        items.add(stopCorosyncItem);
        /* Stop heartbeat. */
        final MyMenuItem stopHeartbeatItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StopHeartbeat"),
                        HostInfo.HOST_STOP_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.ADVANCED),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                return hostInfo.getHost().isHeartbeatRunning();
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                if (application.confirmDialog(Tools.getString("HostInfo.confirmHeartbeatStop.Title"),
                                        Tools.getString("HostInfo.confirmHeartbeatStop.Desc"),
                                        Tools.getString("HostInfo.confirmHeartbeatStop.Yes"),
                                        Tools.getString("HostInfo.confirmHeartbeatStop.No"))) {
                                    hostInfo.getHost().setCommLayerStopping(true);
                                    Heartbeat.stopHeartbeat(hostInfo.getHost());
                                    updateClusterView(hostInfo.getHost(), hostInfo);
                                }
                            }
                        });
        if (cb != null) {
            final ButtonCallback stopHeartbeatItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            if (!hostInfo.isStandby(Application.RunMode.LIVE)) {
                                CRM.standByOn(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            }
                        }
                    });
            hostInfo.addMouseOverListener(stopHeartbeatItem, stopHeartbeatItemCallback);
        }
        items.add(stopHeartbeatItem);
        /* Start corosync. */
        final MyMenuItem startCorosyncItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StartCorosync"),
                        HostInfo.HOST_START_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                final Host h = hostInfo.getHost();
                                return h.isCorosyncInstalled()
                                        && h.hasCorosyncInitScript()
                                        && h.corosyncOrOpenaisConfigExists()
                                        && !h.isCorosyncRunning()
                                        && !h.isOpenaisRunning()
                                        && !h.isHeartbeatRunning()
                                        && !h.isHeartbeatInRc();
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                if (h.isOpenaisInRc() && !h.isCorosyncInRc()) {
                                    return "Openais is in rc.d";
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                hostInfo.getHost().setCommLayerStarting(true);
                                if (hostInfo.getHost().isPacemakerInRc()) {
                                    Corosync.startCorosyncWithPcmk(hostInfo.getHost());
                                } else {
                                    Corosync.startCorosync(hostInfo.getHost());
                                }
                                updateClusterView(hostInfo.getHost(), hostInfo);
                            }
                        });
        if (cb != null) {
            final ButtonCallback startCorosyncItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            //TODO
                        }
                    });
            hostInfo.addMouseOverListener(startCorosyncItem, startCorosyncItemCallback);
        }
        items.add(startCorosyncItem);
        /* Start openais. */
        final MyMenuItem startOpenaisItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StartOpenais"),
                        HostInfo.HOST_START_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                final Host h = hostInfo.getHost();
                                return h.hasOpenaisInitScript()
                                        && h.corosyncOrOpenaisConfigExists()
                                        && !h.isCorosyncRunning()
                                        && !h.isOpenaisRunning()
                                        && !h.isHeartbeatRunning()
                                        && !h.isHeartbeatInRc();
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                if (h.isCorosyncInRc() && !h.isOpenaisInRc()) {
                                    return "Corosync is in rc.d";
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                hostInfo.getHost().setCommLayerStarting(true);
                                Openais.startOpenais(hostInfo.getHost());
                                updateClusterView(hostInfo.getHost(), hostInfo);
                            }
                        });
        if (cb != null) {
            final ButtonCallback startOpenaisItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            //TODO
                        }
                    });
            hostInfo.addMouseOverListener(startOpenaisItem, startOpenaisItemCallback);
        }
        items.add(startOpenaisItem);
        /* Start heartbeat. */
        final MyMenuItem startHeartbeatItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StartHeartbeat"),
                        HostInfo.HOST_START_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                final Host h = hostInfo.getHost();
                                return h.hasHeartbeatInitScript()
                                        && h.heartbeatConfigExists()
                                        && !h.isCorosyncRunning()
                                        && !h.isOpenaisRunning()
                                        && !h.isHeartbeatRunning();
                                //&& !h.isAisRc()
                                //&& !h.isCsRc(); TODO should check /etc/defaults/
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                hostInfo.getHost().setCommLayerStarting(true);
                                Heartbeat.startHeartbeat(hostInfo.getHost());
                                updateClusterView(hostInfo.getHost(), hostInfo);
                            }
                        });
        if (cb != null) {
            final ButtonCallback startHeartbeatItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            //TODO
                        }
                    });
            hostInfo.addMouseOverListener(startHeartbeatItem, startHeartbeatItemCallback);
        }
        items.add(startHeartbeatItem);

        /* Start pacemaker. */
        final MyMenuItem startPcmkItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StartPacemaker"),
                        HostInfo.HOST_START_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .visiblePredicate(new VisiblePredicate() {
                            @Override
                            public boolean check() {
                                final Host h = hostInfo.getHost();
                                return !h.isPcmkStartedByCorosync()
                                        && !h.isPacemakerRunning()
                                        && (h.isCorosyncRunning() || h.isOpenaisRunning())
                                        && !h.isHeartbeatRunning();
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                hostInfo.getHost().setPacemakerStarting(true);
                                Corosync.startPacemaker(hostInfo.getHost());
                                updateClusterView(hostInfo.getHost(), hostInfo);
                            }
                        });
        if (cb != null) {
            final ButtonCallback startPcmkItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            //TODO
                        }
                    });
            hostInfo.addMouseOverListener(startPcmkItem, startPcmkItemCallback);
        }
        items.add(startPcmkItem);
        /* change host color */
        final UpdatableItem changeHostColorItem =
                menuFactory.createMenuItem(Tools.getString("HostBrowser.Drbd.ChangeHostColor"),
                        null,
                        "",
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                final Color newColor = JColorChooser.showDialog(
                                        guiData.getMainFrame(),
                                        "Choose " + hostInfo.getHost().getName() + " color",
                                        hostInfo.getHost().getPmColors()[0]);
                                if (newColor != null) {
                                    hostInfo.getHost().setSavedHostColorInGraphs(newColor);
                                }
                            }
                        });
        items.add(changeHostColorItem);

        /* view logs */
        final UpdatableItem viewLogsItem =
                menuFactory.createMenuItem(Tools.getString("HostBrowser.Drbd.ViewLogs"),
                        HostInfo.LOGFILE_ICON,
                        "",
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                if (!hostInfo.getHost().isConnected()) {
                                    return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                final HostLogs hostLogs = hostLogsProvider.get();
                                hostLogs.init(hostInfo.getHost());
                                hostLogs.showDialog();
                            }
                        });
        items.add(viewLogsItem);
        /* advacend options */
        final MyMenu hostAdvancedSubmenu = menuFactory.createMenu(Tools.getString("HostBrowser.AdvancedSubmenu"),
                new AccessMode(AccessMode.OP, AccessMode.NORMAL),
                new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                .enablePredicate(new EnablePredicate() {
                    @Override
                    public String check() {
                        if (!hostInfo.getHost().isConnected()) {
                            return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
                        }
                        return null;
                    }
                });
        hostAdvancedSubmenu.onUpdate(new Runnable() {
            @Override
            public void run() {
                hostAdvancedSubmenu.updateMenuComponents();
                hostInfo.getBrowser().addAdvancedMenu(hostAdvancedSubmenu);
            }
        });
        items.add(hostAdvancedSubmenu);

        /* remove host from gui */
        final UpdatableItem removeHostItem =
                menuFactory.createMenuItem(Tools.getString("HostBrowser.RemoveHost"),
                        HostBrowser.HOST_REMOVE_ICON,
                        Tools.getString("HostBrowser.RemoveHost"),
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                        new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                if (hostInfo.getHost().isInCluster()) {
                                    return "it is a member of a cluster";
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                hostInfo.getHost().disconnect();
                                final ClusterBrowser b = hostInfo.getBrowser().getClusterBrowser();
                                if (b != null) {
                                    guiData.unregisterAllHostsUpdate(b.getClusterViewPanel());
                                }
                                application.removeHostFromHosts(hostInfo.getHost());
                                guiData.allHostsUpdate();
                            }
                        });
View Full Code Here

        items.add(removeHostItem);
        return items;
    }

    private void updateClusterView(final Host host, final HostInfo hostInfo) {
        final ClusterBrowser cb = hostInfo.getBrowser().getClusterBrowser();
        if (cb == null) {
            host.setIsLoading();
            host.getHWInfo(!Host.UPDATE_LVM);
        } else {
            cb.updateHWInfo(host, !Host.UPDATE_LVM);
        }
    }
View Full Code Here

            if (con) {
               LOG.info("setConnected: " + getName() + ": connection established");
            } else {
               LOG.info("setConnected: " + getName() + ": connection lost");
            }
            final ClusterBrowser cb = getBrowser().getClusterBrowser();
            if (cb != null) {
                cb.getCrmGraph().repaint();
                cb.getDrbdGraph().repaint();
            }
        }
    }
View Full Code Here

                                     if (g != null) {
                                         g.repaint();
                                     }
                                 }
                                 if (host.getWaitForServerStatusLatch()) {
                                     final ClusterBrowser cb = getBrowser().getClusterBrowser();
                                     cb.updateServerStatus(host);
                                 }
                                 setLoadingDone();
                             }

                             @Override
                             public void doneError(final String ans, final int exitCode) {
                                 if (host.getWaitForServerStatusLatch()) {
                                     final ClusterBrowser cb = getBrowser().getClusterBrowser();
                                     cb.updateServerStatus(host);
                                 }
                                 setLoadingError();
                             }
                         })
                         .newOutputCallback(new NewOutputCallback() {
                             private final StringBuffer outputBuffer = new StringBuffer(300);
                             @Override
                             public void output(final String output) {
                                 outputBuffer.append(output);
                                 final ClusterBrowser cb = getBrowser().getClusterBrowser();
                                 String hw, vm, drbdConfig;
                                 String hwUpdate = null;
                                 String vmUpdate = null;
                                 String drbdUpdate = null;
                                 do {
                                     hw = getOutput("hw", outputBuffer);
                                     if (hw != null) {
                                         hwUpdate = hw;
                                     }
                                     vm = getOutput("vm", outputBuffer);
                                     if (vmStatusTryLock()) {
                                         if (vm != null) {
                                             vmUpdate = vm;
                                         }
                                         vmStatusUnlock();
                                     }
                                     drbdStatusLock();
                                     drbdConfig = getOutput("drbd", outputBuffer);
                                     if (drbdConfig != null) {
                                         drbdUpdate = drbdConfig;
                                     }
                                     drbdStatusUnlock();
                                 } while (hw != null || vm != null || drbdConfig != null);

                                 Tools.chomp(outputBuffer);
                                 if (hwUpdate != null) {
                                     parseHostInfo(hwUpdate);
                                     for (final ResourceGraph g : graphs) {
                                         if (g != null) {
                                             g.repaint();
                                         }
                                     }
                                 }
                                 if (vmUpdate != null) {
                                     final VmsXml newVmsXml = new VmsXml(host);
                                     if (newVmsXml.update(vmUpdate)) {
                                         cb.vmsXmlPut(host, newVmsXml);
                                         cb.updateVms();
                                     }
                                 }
                                 if (drbdUpdate != null) {
                                     final DrbdXml dxml = drbdXmlProvider.get();
                                     dxml.init(cluster.getHostsArray(), cb.getHostDrbdParameters());
                                     dxml.update(drbdUpdate);
                                     cb.setDrbdXml(dxml);
                                     application.invokeLater(new Runnable() {
                                         @Override
                                         public void run() {
                                             hostBrowser.getClusterBrowser().getGlobalInfo().setParameters();
                                             cb.updateDrbdResources();
                                         }
                                     });
                                 }
                                 if (drbdUpdate != null
                                     || vmUpdate != null) {
                                     cb.updateHWInfo(host, !Host.UPDATE_LVM);
                                 }
                                 if (drbdUpdate != null) {
                                     cb.updateServerStatus(host);
                                 }
                                 if (getWaitForServerStatusLatch()) {
                                     cb.updateServerStatus(host);
                                 }
                                 setLoadingDone();
                             }
                         })
                         .silentCommand()
View Full Code Here

                       LOG.debug2("startConnectionStatus: connection lost on " + getName());
                       getSSH().forceReconnect();
                       setConnected();
                    }
                    Tools.sleep(PING_TIMEOUT);
                    final ClusterBrowser cb = getBrowser().getClusterBrowser();
                    /* cluster could be removed */
                    if (cb == null || cb.isCancelServerStatus()) {
                        break;
                    }
                }
            }
        });
View Full Code Here

    public boolean isDrbdProxyUp(final String drbdResource) {
        return drbdResourcesWithProxy.contains(drbdResource);
    }

    public void updateDrbdParameters() {
        final ClusterBrowser cb = getBrowser().getClusterBrowser();
        final DrbdXml drbdXml = cb.getDrbdXml();
        final String output = drbdXml.updateDrbdParameters(this);
        if (output != null) {
            drbdXml.parseDrbdParameters(this, output, cb.getClusterHosts());
            cb.getHostDrbdParameters().put(this, output);
        }
    }
View Full Code Here

    /**
     * Checks the answer of the installation and enables/disables the
     * components accordingly.
     */
    void checkAnswer(final String ans) {
        final ClusterBrowser clusterBrowser = getHost().getBrowser().getClusterBrowser();
        if (clusterBrowser != null) {
            clusterBrowser.getHostDrbdParameters().clear();
            final GlobalInfo globalInfo = clusterBrowser.getGlobalInfo();
            globalInfo.clearPanelLists();
            globalInfo.updateDrbdInfo();
            globalInfo.resetInfoPanel();
            globalInfo.getInfoPanel();
        }
View Full Code Here

TOP

Related Classes of lcmc.cluster.ui.ClusterBrowser$DRBDMenuItemCallback

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.