Package lcmc.drbd.ui.resource

Examples of lcmc.drbd.ui.resource.ResourceInfo


            startDialog.init(null, blockDevInfo1, blockDevInfo2);
            dialog = startDialog;
        } else {
            final List<BlockDevInfo> blockDevices = new ArrayList<BlockDevInfo>(Arrays.asList(blockDevInfo1,
                                                                                              blockDevInfo2));
            final ResourceInfo resourceInfo = globalInfo.getNewDrbdResource(
                                                            VolumeInfo.getHostsFromBlockDevices(blockDevices));
            final VolumeInfo dvi = globalInfo.getNewDrbdVolume(resourceInfo, blockDevices);
            resourceInfo.addDrbdVolume(dvi);
            globalInfo.addDrbdResource(resourceInfo);
            application.invokeAndWait(new Runnable() {
                @Override
                public void run() {
                    globalInfo.addDrbdVolume(dvi);
View Full Code Here


                    bd2 = bdi;
                }
            }
            if (bd1 != null && bd2 != null) {
                /* add DRBD resource */
                ResourceInfo dri = getDrbdResourceNameHash().get(resName);
                putDrbdResHash();
                final List<BlockDevInfo> bdis = new ArrayList<BlockDevInfo>(Arrays.asList(bd1, bd2)); if (dri == null) {
                    dri = globalInfo.addDrbdResource(resName, VolumeInfo.getHostsFromBlockDevices(bdis), runMode);
                    atLeastOneAdded = true;
                }
                VolumeInfo dvi = dri.getDrbdVolumeInfo(volumeNr);
                if (dvi == null) {
                    dvi = globalInfo.addDrbdVolume(dri, volumeNr, drbdDev, bdis, runMode);
                    atLeastOneAdded = true;
                }
                dri.setParameters();
                dvi.setParameters();
                final ResourceInfo dri0 = dri;
                dri0.getInfoPanel();
            }
        }
        //TODO: it would remove it during drbd wizards
        //killRemovedVolumes(dxml.getResourceDeviceMap());
        drbdStatusUnlock();
View Full Code Here

            if (m.groupCount() > 2) {
                vol = m.group(2);
            } else {
                vol = "0";
            }
            final ResourceInfo dri = getDrbdResourceNameHash().get(res);
            putDrbdResHash();
            if (dri != null) {
                return dri.getDrbdVolumeInfo(vol);
            }
        }
        return null;
    }
View Full Code Here

    /** Removes the linbit::drbd service. */
    @Override
    public void removeMyselfNoConfirm(final Host dcHost,
                                      final Application.RunMode runMode) {
        final ResourceInfo dri =
                        getBrowser().getDrbdResourceNameHash().get(getResourceName());
        getBrowser().putDrbdResHash();
        super.removeMyselfNoConfirm(dcHost, runMode);
        if (dri != null) {
            dri.setUsedByCRM(null);
        }
    }
View Full Code Here

    /** Sets service parameters with values from resourceNode hash. */
    @Override
    protected void setParameters(final Map<String, String> resourceNode) {
        super.setParameters(resourceNode);
        final ResourceInfo dri =
                        getBrowser().getDrbdResourceNameHash().get(getResourceName());
        getBrowser().putDrbdResHash();
        if (dri != null) {
            if (isManaged(Application.RunMode.LIVE) && !getService().isOrphaned()) {
                dri.setUsedByCRM(this);
            } else {
                dri.setUsedByCRM(null);
            }
            //final Thread t = new Thread(new Runnable() {
            //    @Override
            //    public void run() {
            //        dri.updateMenus(null);
View Full Code Here

    }

    @Override
    public void removeMyselfNoConfirm(final Host dcHost, final Application.RunMode runMode) {
        super.removeMyselfNoConfirm(dcHost, runMode);
        final ResourceInfo dri = getBrowser().getDrbdResourceNameHash().get(getResourceName());
        getBrowser().putDrbdResHash();
        if (dri != null) {
            dri.setUsedByCRM(null);
        }
    }
View Full Code Here

    }

    @Override
    protected void setParameters(final Map<String, String> resourceNode) {
        super.setParameters(resourceNode);
        final ResourceInfo dri = getBrowser().getDrbdResourceNameHash().get(getResourceName());
        getBrowser().putDrbdResHash();
        if (dri != null) {
            if (isManaged(Application.RunMode.LIVE) && !getService().isOrphaned()) {
                dri.setUsedByCRM(this);
            } else {
                dri.setUsedByCRM(null);
            }
            final Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    dri.updateMenus(null);
                }
            });
            thread.start();
        }
    }
View Full Code Here

    }

    /** Applies the changes and returns next dialog (BlockDev). */
    @Override
    public WizardDialog nextDialog() {
        final ResourceInfo dri = getDrbdVolumeInfo().getDrbdResourceInfo();
        if (proxyHostNextDialog) {
            proxyHostNextDialog = false;
            final Host proxyHost = hostFactory.createInstance();
            proxyHost.setCluster(dri.getCluster());
            final NewProxyHostDialog newProxyHostDialog = newProxyHostDialogProvider.get();
            newProxyHostDialog.init(this, proxyHost, getDrbdVolumeInfo(), this, new DrbdInstallation());
            return newProxyHostDialog;
        }
        final GlobalInfo globalInfo = dri.getBrowser().getGlobalInfo();
        final boolean protocolInNetSection = globalInfo.atLeastVersion("8.4");
        if (globalInfo.getDrbdResources().size() <= 1) {
            for (final String commonP : COMMON_PARAMS) {
                if (!protocolInNetSection && DrbdXml.PROTOCOL_PARAM.equals(commonP)) {
                    continue;
                }
                final Widget wi = globalInfo.getWidget(commonP, null);
                if (wi == null) {
                    LOG.appError("widget for param: " + commonP + " was not created");
                    return null;
                }
                final Value value = dri.getComboBoxValue(commonP);
                globalInfo.getResource().setValue(commonP, value);
                wi.setValue(value);
            }
        }
        volumeDialog.init(this, getDrbdVolumeInfo());
View Full Code Here

        return Tools.getString("Dialog.DrbdConfig.Resource.Description");
    }

    @Override
    protected void initDialogBeforeCreated() {
        final ResourceInfo dri = getDrbdVolumeInfo().getDrbdResourceInfo();
        dri.waitForInfoPanel();
    }
View Full Code Here

        enableComponentsLater(new JComponent[]{buttonClass(nextButton())});
    }

    @Override
    protected void initDialogAfterVisible() {
        final ResourceInfo dri = getDrbdVolumeInfo().getDrbdResourceInfo();
        final boolean cor = dri.checkResourceFields(null, PARAMS).isCorrect();
        if (cor) {
            enableComponents();
        } else {
            /* don't enable */
            enableComponents(new JComponent[]{buttonClass(nextButton())});
View Full Code Here

TOP

Related Classes of lcmc.drbd.ui.resource.ResourceInfo

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.