Package lcmc.drbd.domain

Examples of lcmc.drbd.domain.DrbdXml$HostProxy


                new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                .enablePredicate(new EnablePredicate() {
                    @Override
                    public String check() {
                        final DrbdXml dxml = getClusterBrowser().getDrbdXml();
                        if (getDrbdVolumeInfo() != null) {
                            return "it is already a drbd resouce";
                        } else if (!getHost().isConnected()) {
                            return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
                        } else if (!getHost().isDrbdLoaded()) {
                            return "drbd is not loaded";
                        } else if (getBlockDevice().isMounted()) {
                            return "is mounted";
                        } else if (getBlockDevice().isVolumeGroupOnPhysicalVolume()) {
                            return "is volume group";
                        } else if (!getBlockDevice().isAvailable()) {
                            return "not available";
                        } else if (dxml.isDrbdDisabled()) {
                            return "disabled because of config";
                        } else {
                            final String noavail = getClusterBrowser().isDrbdAvailable(getHost());
                            if (noavail != null) {
                                return "DRBD installation problem: " + noavail;
                            }
                        }
                        return null;
                    }
                });
        repMenuItem.onUpdate(new Runnable() {
            @Override
            public void run() {
                repMenuItem.updateMenuComponents();
                final Cluster cluster = getHost().getCluster();
                final Host[] otherHosts = cluster.getHostsArray();
                final Collection<MyMenu> hostMenus = new ArrayList<MyMenu>();
                for (final Host oHost : otherHosts) {
                    if (oHost == getHost()) {
                        continue;
                    }
                    final MyMenu hostMenu = menuFactory.createMenu(oHost.getName(),
                            new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                            new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                            .enablePredicate(new EnablePredicate() {
                                @Override
                                public String check() {
                                    final DrbdXml dxml = getClusterBrowser().getDrbdXml();
                                    if (!oHost.isConnected()) {
                                        return Host.NOT_CONNECTED_MENU_TOOLTIP_TEXT;
                                    } else if (!oHost.isDrbdLoaded()) {
                                        return "drbd is not loaded";
                                    } else {
View Full Code Here


            getBrowser().getGlobalInfo().createDrbdConfig(runMode);
            getBrowser().getGlobalInfo().setSelectedNode(null);
            getBrowser().getGlobalInfo().selectMyself();
            clusterBrowser.resetFilesystems();

            final DrbdXml dxml = drbdXmlProvider.get();
            dxml.init(hosts0.toArray(new Host[hosts0.size()]), clusterBrowser.getHostDrbdParameters());
            for (final Host host : hosts0) {
                final String conf = dxml.getConfig(host);
                if (conf != null) {
                    dxml.update(conf);
                }
            }
            clusterBrowser.setDrbdXml(dxml);
            application.invokeInEdt(new Runnable() {
                @Override
View Full Code Here

     */
    Check checkResourceFields(final String param,
                              final String[] params,
                              final boolean fromDrbdInfo,
                              final boolean fromDrbdResourceInfo) {
        final DrbdXml dxml = getBrowser().getDrbdXml();
        final GlobalInfo di = getBrowser().getGlobalInfo();
        if (di != null && !fromDrbdInfo && !fromDrbdResourceInfo) {
            di.setApplyButtons(null, di.getParametersFromXML());
        }
        final List<String> incorrect = new ArrayList<String>();
        final List<String> changed = new ArrayList<String>();
        if (dxml != null && dxml.isDrbdDisabled()) {
            incorrect.add("DRBD is disabled");
        }
        final Check check = new Check(incorrect, changed);
        for (final BlockDevInfo bdi : getBlockDevInfos()) {
            if (bdi != null) {
View Full Code Here

TOP

Related Classes of lcmc.drbd.domain.DrbdXml$HostProxy

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.