Package lcmc.host.domain

Examples of lcmc.host.domain.Host


     */
    private Value[] getSameServicesOperations() {
        final List<Value> sl = new ArrayList<Value>();
        sl.add(NOTHING_SELECTED_VALUE);
        sl.add(OPERATIONS_DEFAULT_VALUES);
        final Host dcHost = getBrowser().getDCHost();
        if (isOperationReferenced() || Tools.versionBeforePacemaker(dcHost)) {
            return sl.toArray(new Value[sl.size()]);
        }
        getBrowser().lockNameToServiceInfo();
        final Map<String, ServiceInfo> idToInfoHash = getBrowser().getNameToServiceInfoHash().get(getName());
View Full Code Here


        final boolean abExisted = getApplyButton() != null;
        final ButtonCallback buttonCallback = new ButtonCallback() {
            private volatile boolean mouseStillOver = false;
            @Override
            public boolean isEnabled() {
                final Host dcHost = getBrowser().getDCHost();
                return dcHost != null && !Tools.versionBeforePacemaker(dcHost);
            }
            @Override
            public void mouseOut(final ComponentWithTest component) {
                if (!isEnabled()) {
                    return;
                }
                mouseStillOver = false;
                getBrowser().getCrmGraph().stopTestAnimation((JComponent) component);
                component.setToolTipText("");
            }

            @Override
            public void mouseOver(final ComponentWithTest component) {
                if (!isEnabled()) {
                    return;
                }
                mouseStillOver = true;
                component.setToolTipText(ClusterBrowser.STARTING_PTEST_TOOLTIP);
                component.setToolTipBackground(Tools.getDefaultColor("ClusterBrowser.Test.Tooltip.Background"));
                Tools.sleep(250);
                if (!mouseStillOver) {
                    return;
                }
                mouseStillOver = false;
                final CountDownLatch startTestLatch = new CountDownLatch(1);
                getBrowser().getCrmGraph().startTestAnimation((JComponent) component, startTestLatch);
                final Host dcHost = getBrowser().getDCHost();
                getBrowser().ptestLockAcquire();
                try {
                    final ClusterStatus cs = getBrowser().getClusterStatus();
                    cs.setPtestResult(null);
                    apply(dcHost, Application.RunMode.TEST);
View Full Code Here

    public void setParameters() {
        final DrbdXml dxml = getBrowser().getDrbdXml();
        final Cluster cluster = getCluster();
        for (final String hostName : dxml.getProxyHostNames()) {
            final Host proxyHost = cluster.getProxyHostByName(hostName);
            if (proxyHost == null) {
                final Host hp = hostFactory.createInstance();
                hp.setHostname(hostName);
                cluster.addProxyHost(hp);
                addProxyHostNode(hp);
            } else {
                if (proxyHostInfo != null && proxyHostInfo.getNode() == null) {
                    addProxyHostNode(proxyHost);
View Full Code Here

            private volatile boolean mouseStillOver = false;

            /** Whether the whole thing should be enabled. */
            @Override
            public boolean isEnabled() {
                final Host dcHost = getBrowser().getDCHost();
                return dcHost != null && !Tools.versionBeforePacemaker(dcHost);
            }

            @Override
            public void mouseOut(final ComponentWithTest component) {
View Full Code Here

    private void createConfigError(final Map<Host, String> testOutput) {
        final StringBuilder message = new StringBuilder(100);
        message.append("createConfigError: failed to create config\n");
        for (final Map.Entry<Host, String> entry : testOutput.entrySet()) {
            final Host host = entry.getKey();
            final String output = entry.getValue();
            message.append("host: ").append(host.getName());
            message.append('\n');
            message.append("output: ").append(output);
            message.append('\n');
        }
        LOG.appError(message.toString());
View Full Code Here

                        public void run(final String text) {
                            domainInfo.hidePopup();
                            final VmsXml vxml = getBrowser().getVmsXml(host);
                            if (vxml != null) {
                                final int remotePort = vxml.getRemotePort(domainInfo.getDomainName());
                                final Host host = vxml.getDefinedOnHost();
                                if (host != null && remotePort > 0) {
                                    application.startTightVncViewer(host, remotePort);
                                }
                            }
                        }
                    });
            items.add(tightvncViewerMenu);
        }

        if (application.isUseUltravnc()) {
            final UpdatableItem ultravncViewerMenu = menuFactory.createMenuItem(
                    getVNCMenuString("ULTRA", host),
                    DomainInfo.VNC_ICON,
                    getVNCMenuString("ULTRA", host),
                    new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                    new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                    .enablePredicate(new EnablePredicate() {
                        @Override
                        public String check() {
                            if (getResource().isNew()) {
                                return DomainInfo.NOT_APPLIED;
                            }
                            final VmsXml vmsXml = getBrowser().getVmsXml(host);
                            if (vmsXml == null) {
                                return DomainInfo.NO_VM_STATUS_STRING;
                            }
                            if (!vmsXml.isRunning(domainInfo.getDomainName())) {
                                return "not running";
                            }
                            return null;
                        }
                    })
                    .addAction(new MenuAction() {
                        @Override
                        public void run(final String text) {
                            domainInfo.hidePopup();
                            final VmsXml vxml = getBrowser().getVmsXml(host);
                            if (vxml != null) {
                                final int remotePort = vxml.getRemotePort(domainInfo.getDomainName());
                                final Host host = vxml.getDefinedOnHost();
                                if (host != null && remotePort > 0) {
                                    application.startUltraVncViewer(host, remotePort);
                                }
                            }
                        }
                    });
            items.add(ultravncViewerMenu);
        }

        if (application.isUseRealvnc()) {
            final UpdatableItem realvncViewerMenu = menuFactory.createMenuItem(
                    getVNCMenuString("REAL", host),
                    DomainInfo.VNC_ICON,
                    getVNCMenuString("REAL", host),
                    new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                    new AccessMode(AccessMode.RO, AccessMode.NORMAL))
                    .enablePredicate(new EnablePredicate() {
                        @Override
                        public String check() {
                            if (getResource().isNew()) {
                                return DomainInfo.NOT_APPLIED;
                            }
                            final VmsXml vmsXml = getBrowser().getVmsXml(host);
                            if (vmsXml == null) {
                                return DomainInfo.NO_VM_STATUS_STRING;
                            }
                            if (!vmsXml.isRunning(domainInfo.getDomainName())) {
                                return "not running";
                            }
                            return null;
                        }
                    })
                    .addAction(new MenuAction() {
                        @Override
                        public void run(final String text) {
                            domainInfo.hidePopup();
                            final VmsXml vxml = getBrowser().getVmsXml(host);
                            if (vxml != null) {
                                final int remotePort = vxml.getRemotePort(domainInfo.getDomainName());
                                final Host host = vxml.getDefinedOnHost();
                                if (host != null && remotePort > 0) {
                                    application.startRealVncViewer(host, remotePort);
                                }
                            }
                        }
View Full Code Here

                            public String check() {
                                if (!getBlockDevice().isDrbd()) {
                                    return BlockDevInfo.NO_DRBD_RESOURCE_STRING;
                                }
                                final ResourceInfo dri = getDrbdResourceInfo();
                                final Host pHost = dri.getProxyHost(getHost(), !ResourceInfo.WIZARD);
                                if (pHost == null) {
                                    return "not a proxy";
                                }
                                if (!pHost.isConnected()) {
                                    return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
                                }
                                if (!pHost.isDrbdProxyRunning()) {
                                    return "proxy daemon is not running";
                                }
                                return null;
                            }
                        })
                        .predicate(new Predicate() {
                            @Override
                            public boolean check() {
                                if (!getBlockDevice().isDrbd()) {
                                    return false;
                                }
                                final ResourceInfo dri = getDrbdResourceInfo();
                                final Host pHost = dri.getProxyHost(getHost(), !ResourceInfo.WIZARD);
                                if (pHost == null) {
                                    return false;
                                }
                                if (getBlockDevice().isDrbd()) {
                                    return pHost.isDrbdProxyUp(getDrbdResourceInfo().getName());
                                } else {
                                    return true;
                                }
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                final ResourceInfo dri = getDrbdResourceInfo();
                                final Host pHost = dri.getProxyHost(getHost(), !ResourceInfo.WIZARD);
                                if (pHost.isDrbdProxyUp(getDrbdResourceInfo().getName())) {
                                    DRBD.proxyDown(pHost, getDrbdResourceInfo().getName(), getDrbdVolumeInfo().getName(), runMode);
                                } else {
                                    DRBD.proxyUp(pHost, getDrbdResourceInfo().getName(), getDrbdVolumeInfo().getName(), runMode);
                                }
                                getClusterBrowser().updateProxyHWInfo(pHost);
View Full Code Here

     * @param directory whether it needs dir or file
     */
    protected final void startFileChooser(final Widget paramWi,
                                          final String directory,
                                          final boolean dirOnly) {
        final Host host = getFirstConnectedHost();
        if (host == null) {
            LOG.error("startFileChooser: connection to host lost.");
            return;
        }
        final HardwareInfo thisClass = this;
        final JFileChooser fc = new JFileChooser(getLinuxDir(directory, host), getFileSystemView(host, directory)) {
            @Override
            public void setCurrentDirectory(final File dir) {
                super.setCurrentDirectory(new LinuxFile(thisClass, host, dir.toString(), "d", 0, 0));
            }
        };
        fc.setBackground(ClusterBrowser.STATUS_BACKGROUND);
        fc.setDialogType(JFileChooser.CUSTOM_DIALOG);
        if (dirOnly) {
            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        }
        fc.setDialogTitle(Tools.getString("DiskInfo.FileChooserTitle") + host.getName());
        fc.setApproveButtonToolTipText(Tools.getString("DiskInfo.Approve.ToolTip"));
        fc.putClientProperty("FileChooser.useShellFolder", Boolean.FALSE);
        final int ret = fc.showDialog(guiData.getMainFrame(), Tools.getString("DiskInfo.Approve"));
        linuxFileCache.clear();
        if (ret == JFileChooser.APPROVE_OPTION && fc.getSelectedFile() != null) {
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.