Package lcmc.host.domain

Examples of lcmc.host.domain.Host


                final CountDownLatch startTestLatch = new CountDownLatch(1);
                crmGraph.startTestAnimation((JComponent) component, startTestLatch);
                ptestLockAcquire();
                try {
                    clusterStatus.setPtestResult(null);
                    final Host h;
                    if (menuHost == null) {
                        h = getDCHost();
                    } else {
                        h = menuHost;
                    }
View Full Code Here


                            String port = null;
                            if (p > 0) {
                                port = hostName.substring(p + 1, hostName.length());
                                hostName = hostName.substring(0, p);
                            }
                            final Host host = hostFactory.createInstance(hostName);
                            if (username == null) {
                                host.setUsername(Host.ROOT_USER);
                            } else {
                                host.setUseSudo(true);
                                host.setUsername(username);
                            }
                            if (port == null) {
                                host.setSSHPort(Host.DEFAULT_SSH_PORT);
                            } else {
                                host.setSSHPort(port);
                            }
                            host.setCluster(cluster);
                            host.setHostname(hostName);
                            cluster.addHost(host);
                            application.addHostToHosts(host);
                            guiData.allHostsUpdate();
                        }
                        application.addClusterToClusters(cluster);
View Full Code Here

                           new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                           new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                .addAction(new MenuAction() {
                        @Override
                        public void run(final String text) {
                    final Host host = hostFactory.createInstance();
                    final AddHostDialog addHostDialog = addHostDialogProvider.get();
                    addHostDialog.showDialogs(host);
                }});
        items.add(newHostWizardItem);
        guiData.registerAddHostButton(newHostWizardItem);
View Full Code Here

                        String sshPort,
                        final String color,
                        final boolean sudo,
                        final boolean savable) {
        application.setLastEnteredUser(username);
        final Host host = hostFactory.createInstance();
        host.setSavable(savable);
        host.setHostname(nodeName);
        if (sshPort == null) {
            sshPort = "22";
        }
        host.setSSHPort(sshPort);
        application.setLastEnteredSSHPort(sshPort);
        if (color != null) {
            host.setSavedColor(color);
        }
        host.setUseSudo(sudo);
        application.setLastEnteredUseSudo(sudo);
        application.addHostToHosts(host);

        host.setIpAddress(ip);
        if (username == null && sudo) {
            username = System.getProperty("user.name");
        }
        if (username == null) {
            username = Host.ROOT_USER;
        }
        host.setUsername(username);
        List<Host> hostList = hostMap.get(nodeName);
        if (hostList == null) {
            hostList = new ArrayList<Host>();
            hostMap.put(nodeName, hostList);
        }
View Full Code Here

                               final boolean proxy) {
        final List<Host> hostList = hostMap.get(nodeName);
        if (hostList == null || hostList.isEmpty()) {
            return;
        }
        final Host host = hostList.get(0);
        hostList.remove(0);
        if (host != null && !host.isInCluster()) {
            host.setCluster(cluster);
            if (proxy) {
                cluster.addProxyHost(host);
            } else {
                cluster.addHost(host);
            }
View Full Code Here

                                }
                            });
                            disableComponents();
                            getProgressBar().start(RESIZE_LV_TIMEOUT * hostCheckBoxes.size());
                            final boolean ret = lvAndDrbdResize(sizeWidget.getStringValue());
                            final Host host = blockDevInfo.getHost();
                            host.getBrowser().getClusterBrowser().updateHWInfo(host, Host.UPDATE_LVM);
                            setComboBoxes();
                            if (ret) {
                                progressBarDone();
                            } else {
                                progressBarDoneError();
                            }
                            enableComponents();
                        }
                    }
                });
                thread.start();
            }
        });

        inputPane.add(resizeButton);
        /* max size */
        final JLabel maxSizeLabel = new JLabel("Max Size");
        maxSizeLabel.setEnabled(false);
        maxSizeWidget = widgetFactory.createInstance(
                                         Widget.Type.TEXTFIELDWITHUNIT,
                                         VmsXml.convertKilobytes(maxBlockSize),
                                         Widget.NO_ITEMS,
                                         getUnits(),
                                         Widget.NO_REGEXP,
                                         250,
                                         Widget.NO_ABBRV,
                                         new AccessMode(AccessMode.OP, AccessMode.NORMAL),
                                         Widget.NO_BUTTON);
        maxSizeWidget.setEnabled(false);
        inputPane.add(maxSizeLabel);
        inputPane.add(maxSizeWidget.getComponent());
        inputPane.add(new JLabel());
        sizeWidget.addListeners(new WidgetListener() {
            @Override
            public void check(final Value value) {
                enableResizeButton(true);
            }
        });

        SpringUtilities.makeCompactGrid(inputPane, 3, 3/* rows, cols */
                                                   1, 1/* initX, initY */
                                                   1, 1); /* xPad, yPad */

        pane.add(inputPane);
        final JPanel hostsPane = new JPanel(new FlowLayout(FlowLayout.LEADING));
        final Cluster cluster = blockDevInfo.getHost().getCluster();
        hostCheckBoxes = Tools.getHostCheckBoxes(cluster);
        hostsPane.add(new JLabel("Select Hosts: "));
        final Host host = blockDevInfo.getHost();
        final String lv = blockDevInfo.getBlockDevice().getLogicalVolume();
        for (final Map.Entry<Host, JCheckBox> hostEntry : hostCheckBoxes.entrySet()) {
            final Set<String> allLVS = hostEntry.getKey().getAllLogicalVolumes();
            hostEntry.getValue().addItemListener(
                    new ItemListener() {
View Full Code Here

        final boolean useSudo = false;
        final Cluster cluster = clusterProvider.get();
        cluster.setName("test");
        for (int i = 1; i <= NUMBER_OF_HOSTS; i++) {
            final String hostName = "test" + i;
            final Host host = hostProvider.get();
            host.init();

            initHost(host, hostName, username, useSudo);
            hosts.add(host);
            host.setCluster(cluster);
            cluster.addHost(host);
            final String saveFile = application.getDefaultSaveFile();
            application.saveConfig(saveFile, false);
        }
        for (final Host host : hosts) {
            host.disconnect();
        }
        cluster.connect(null, true, 0);
        for (final Host host : hosts) {
            final boolean r = waitForCondition(
                new Condition() {
                    @Override
                    public boolean passed() {
                        return host.isConnected();
                    }
                }, 300, 20000);
            if (!r) {
                error("could not establish connection to " + host.getName());
            }
        }
        application.addClusterToClusters(cluster);
        application.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                clusterTabFactory.createClusterTab(cluster);
            }
        });
       
        //guiData.getEmptyBrowser().addClusterBox(cluster);
        final String saveFile = application.getDefaultSaveFile();
        application.saveConfig(saveFile, false);
        guiData.refreshClustersPanel();
       
        guiData.expandTerminalSplitPane(GUIData.TerminalSize.COLLAPSE);
        cluster.getClusterTab().addClusterView();
        cluster.getClusterTab().requestFocus();
        guiData.checkAddClusterButtons();
        for (final Host host : hosts) {
            host.waitForServerStatusLatch();
        }
        clusterLoaded = true;
    }
View Full Code Here

    }

    private Map<Host, Set<String>> getVGNames() {
        final Map<Host, Set<String>> vgNames = new LinkedHashMap<Host, Set<String>>();
        for (final BlockDevInfo bdi : blockDevInfos) {
            final Host h = bdi.getHost();
            Set<String> vgs = vgNames.get(h);
            if (vgs == null) {
                vgs = new LinkedHashSet<String>();
                vgNames.put(h, vgs);
            }
View Full Code Here

        final StringBuilder vgNamesString = new StringBuilder();

        final Map<Host, Set<String>> vgNames = getVGNames();

        for (final Map.Entry<Host, Set<String>> entry : vgNames.entrySet()) {
            final Host h = entry.getKey();
            vgNamesString.append(h.getName()).append(": ");
            final Set<String> vgs = entry.getValue();
            vgNamesString.append(Tools.join(", ", vgs)).append(' ');
        }

        inputPane.add(new JLabel(vgNamesString.toString()));
        removeButton.addActionListener(new RemoveActionListener());
        inputPane.add(removeButton);
        SpringUtilities.makeCompactGrid(inputPane, 1, 3/* rows, cols */
                                                   1, 1/* initX, initY */
                                                   1, 1); /* xPad, yPad */

        pane.add(inputPane);
        final JPanel bdPane = new JPanel(new FlowLayout(FlowLayout.LEADING));
        bdPane.add(new JLabel("Block Devices: "));
        final Collection<String> bds = new HashSet<String>();
        final Collection<Host> selectedHosts = new HashSet<Host>();
        for (final BlockDevInfo bdi : blockDevInfos) {
            for (final BlockDevice bd : bdi.getHost().getBlockDevices()) {
                final String thisVG = bd.getVgOnPhysicalVolume();
                if (vgNames.get(bdi.getHost()).contains(thisVG)) {
                    bds.add(bd.getName());
                }
            }
            if (bdi.getBlockDevice().isDrbd()) {
                for (final BlockDevice bd : bdi.getHost().getDrbdBlockDevices()) {
                    final String thisVG = bd.getVgOnPhysicalVolume();
                    if (vgNames.get(bdi.getHost()).contains(thisVG)) {
                        bds.add(bd.getName());
                    }
                }
            }
            selectedHosts.add(bdi.getHost());
        }
        bdPane.add(new JLabel(Tools.join(", ", bds)));
        pane.add(bdPane);
        final JPanel hostsPane = new JPanel(new FlowLayout(FlowLayout.LEADING));
        final Host host = blockDevInfos.get(0).getHost();
        final Cluster cluster = host.getCluster();
        hostCheckBoxes = Tools.getHostCheckBoxes(cluster);
        hostsPane.add(new JLabel("Select Hosts: "));
        for (final Map.Entry<Host, JCheckBox> hostEntry : hostCheckBoxes.entrySet()) {
            hostEntry.getValue().addItemListener(new ItemChangeListener(true));
            if (host == hostEntry.getKey()) {
View Full Code Here

                    boolean oneFailed = false;

                    if (multiSelection) {
                        final Map<Host, Set<String>> vgNames = getVGNames();
                        for (final Map.Entry<Host, Set<String>> entry : vgNames.entrySet()) {
                            final Host h = entry.getKey();
                            for (final String vgName : entry.getValue()) {
                                if (hostCheckBoxes.get(h).isSelected()) {
                                    final boolean ret = vgRemove(h, vgName);
                                    if (!ret) {
                                        oneFailed = true;
View Full Code Here

TOP

Related Classes of lcmc.host.domain.Host

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.