Package lcmc.drbd.domain

Examples of lcmc.drbd.domain.DrbdXml$HostProxy


        }
        final VolumeInfo dvi = volumeInfo;
        if (dvi == null) {
            return;
        }
        final DrbdXml dxml = clusterBrowser.getDrbdXml();
        final String hostName = getHost().getName();
        final DrbdGraph drbdGraph = getBrowser().getDrbdGraph();
        Value value = null;
        final String volumeNr = dvi.getName();
        for (final String param : getParametersFromXML()) {
            if (DRBD_MD_PARAM.equals(param)) {
                final String metaDisk = dxml.getMetaDisk(hostName, resName, volumeNr);
                if (value == null || !"internal".equals(value.getValueForConfig())) {
                    final BlockDevInfo mdI = drbdGraph.findBlockDevInfo(hostName, metaDisk);
                    if (mdI != null) {
                        getBlockDevice().setMetaDisk(mdI.getBlockDevice());
                    }
                }
                value = new StringValue(metaDisk);
            } else if (DRBD_MD_INDEX_PARAM.equals(param)) {
                value = new StringValue(dxml.getMetaDiskIndex(hostName, resName, volumeNr));
            }
            final Value defaultValue = getParamDefault(param);
            if (value == null) {
                value = defaultValue;
            }
View Full Code Here


                              final boolean fromDrbdVolumeInfo) {
        final VolumeInfo dvi = getDrbdVolumeInfo();
        if (dvi != null && !fromDrbdVolumeInfo && !fromDrbdResourceInfo && !fromDrbdInfo) {
            dvi.setApplyButtons(null, dvi.getParametersFromXML());
        }
        final DrbdXml dxml = getBrowser().getClusterBrowser().getDrbdXml();
        final List<String> incorrect = new ArrayList<String>();
        if (dxml != null && dxml.isDrbdDisabled()) {
            incorrect.add("drbd is disabled");
        }
        final Check check = new Check(incorrect, new ArrayList<String>());
        check.addCheck(super.checkResourceFields(param, params));
        return check;
View Full Code Here

        text.append("\n\n= ").append(CONFIG_DRBD).append(" =\n");
        if (configCheckBoxMap.get(CONFIG_DRBD).isSelected()) {
            final ClusterBrowser cb = cluster.getBrowser();
            String cib = null;
            if (cb != null) {
                final DrbdXml drbdXml = cb.getDrbdXml();
                if (drbdXml != null) {
                    cib = drbdXml.getOldConfig();
                }
            }
            if (cib == null) {
                text.append("not available\n");
            } else {
View Full Code Here

                                         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();
View Full Code Here

        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

                    }
                })
                .enablePredicate(new EnablePredicate() {
                    @Override
                    public String check() {
                        final DrbdXml dxml = getBrowser().getDrbdXml();
                        if (!application.isAdvancedMode() && getResourceInfo().isUsedByCRM()) {
                            return VolumeInfo.IS_USED_BY_CRM_STRING;
                        } else if (dxml.isDrbdDisabled()) {
                            return "disabled because of config";
                        }
                        return null;
                    }
                });
View Full Code Here

                           boolean eventUpdate = false;
                           do {
                               host.drbdStatusLock();
                               drbdConfig = host.getOutput("drbd", outputBuffer);
                               if (drbdConfig != null) {
                                   final DrbdXml newDrbdXml = drbdXmlProvider.get();
                                   newDrbdXml.init(cluster.getHostsArray(), hostDrbdParameters);
                                   newDrbdXml.update(drbdConfig);
                                   drbdXml = newDrbdXml;
                                   drbdUpdate = true;
                                   firstTime.countDown();
                               }
                               host.drbdStatusUnlock();
View Full Code Here

    }

    public void updateDrbdResources() {
        application.isSwingThread();
        drbdStatusLock();
        final DrbdXml dxml = drbdXml;
        if (dxml == null) {
            drbdStatusUnlock();
            return;
        }
        final Application.RunMode runMode = Application.RunMode.LIVE;
        boolean atLeastOneAdded = false;
        for (final Object k : dxml.getResourceDeviceMap().keySet()) {
            final String resName = (String) ((MultiKey) k).getKey(0);
            final String volumeNr = (String) ((MultiKey) k).getKey(1);
            final String drbdDev = dxml.getDrbdDevice(resName, volumeNr);
            final Map<String, String> hostDiskMap = dxml.getHostDiskMap(resName, volumeNr);
            if (hostDiskMap == null) {
                continue;
            }
            BlockDevInfo bd1 = null;
            BlockDevInfo bd2 = null;
View Full Code Here

    }

    public void setParameters() {
        application.isSwingThread();
        getDrbdResource().setCommited(true);
        final DrbdXml dxml = getBrowser().getDrbdXml();
        final String resName = getResource().getName();
        for (final String sectionString : dxml.getSections()) {
            /* remove -options */
            final String section = sectionString.replaceAll("-options$", "");
            for (final String param : dxml.getSectionParams(sectionString)) {
                Value value = dxml.getConfigValue(resName, section, param);
                final Value defaultValue = getParamDefault(param);
                final Value oldValue = getParamSaved(param);
                if (value == null || value.isNothingSelected()) {
                    value = defaultValue;
                }
View Full Code Here

     * one value is changed and we don't want to check everything.
     */
    Check checkResourceFields(final String param, final String[] params, final boolean fromDrbdInfo) {
        final List<String> incorrect = new ArrayList<String>();
        final List<String> changed = new ArrayList<String>();
        final DrbdXml dxml = getBrowser().getDrbdXml();
        final Check check = new Check(incorrect, changed);
        if (dxml != null && dxml.isDrbdDisabled()) {
            incorrect.add("DRBD is disabled");
        }
        for (final VolumeInfo dvi : drbdVolumes) {
            check.addCheck(dvi.checkResourceFields(param, dvi.getParametersFromXML(), fromDrbdInfo, true));
        }
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.