Package lcmc.crm.domain

Examples of lcmc.crm.domain.ClusterStatus


        String metaAttrsRefId = null;
        if (sameAsMetaAttrsWi != null) {
            final Value i = sameAsMetaAttrsWiValue();
            if (i != null && !i.isNothingSelected() && !META_ATTRS_DEFAULT_VALUES.equals(i)) {
                final ServiceInfo si  = (ServiceInfo) i;
                final ClusterStatus cs = getBrowser().getClusterStatus();
                metaAttrsRefId = cs.getMetaAttrsId(si.getService().getCrmId());
            }
        }
        return metaAttrsRefId;
    }
View Full Code Here


        String operationsRefId = null;
        if (sameAsOperationsWi != null) {
            final Value i = sameAsOperationsWiValue();
            if (i != null && !i.isNothingSelected() && !META_ATTRS_DEFAULT_VALUES.equals(i)) {
                final ServiceInfo si  = (ServiceInfo) i;
                final ClusterStatus cs = getBrowser().getClusterStatus();
                operationsRefId = cs.getOperationsId(si.getService().getCrmId());
            }
        }
        return operationsRefId;
    }
View Full Code Here

            }

            groupId = null; /* we don't want to replace the whole group */
            //TODO: should not be called if only host locations have
            //changed.
            final ClusterStatus cs = getBrowser().getClusterStatus();
            CRM.setParameters(dcHost,
                              "-R",
                              heartbeatId,
                              cloneId,
                              master,
                              cloneMetaArgs,
                              groupMetaArgs,
                              groupId,
                              pacemakerResAttrs,
                              pacemakerResArgs,
                              pacemakerMetaArgs,
                              cs.getResourceInstanceAttrId(heartbeatId),
                              cs.getParametersNvpairsIds(heartbeatId),
                              getOperations(heartbeatId),
                              cs.getOperationsId(heartbeatId),
                              getMetaAttrsRefId(),
                              cloneMetaAttrsRefIds,
                              groupMetaAttrsRefIds,
                              refCRMId,
                              resourceAgent.isStonith(),
View Full Code Here

        }
        if (Application.isLive(runMode) && !getService().isNew() && !parent.getService().isNew()) {
            parent.setUpdated(true);
            setUpdated(true);
        }
        final ClusterStatus clStatus = getBrowser().getClusterStatus();

        if (isConstraintPlaceholder() || parent.isConstraintPlaceholder()) {
            final ConstraintPHInfo cphi;
            if (isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) this;
            } else {
                cphi = (ConstraintPHInfo) parent;
            }
            final Map<CrmXml.RscSet, Map<String, String>> rscSetsOrdAttrs =
                                                            new LinkedHashMap<CrmXml.RscSet, Map<String, String>>();
            final CrmXml.RscSetConnectionData rdata = cphi.getRscSetConnectionDataOrder();
            /** resource set */
            final String ordId = rdata.getConstraintId();
            String idToRemove;
            if (isConstraintPlaceholder()) {
                idToRemove = parent.getService().getCrmId();
            } else {
                idToRemove = getService().getCrmId();
            }
            CrmXml.RscSet modifiedRscSet = null;
            final List<CrmXml.RscSet> ordRscSets = clStatus.getRscSetsOrd(ordId);
            if (ordRscSets != null) {
                for (final CrmXml.RscSet rscSet : ordRscSets) {
                    if (rscSet.equals(rdata.getRscSet1()) || rscSet.equals(rdata.getRscSet2())) {
                        final List<String> newRscIds = new ArrayList<String>();
                        newRscIds.addAll(rscSet.getRscIds());
                        if (newRscIds.remove(idToRemove)
                            && Application.isLive(runMode)) {
                            modifiedRscSet = rscSet;
                        }
                        if (!newRscIds.isEmpty()) {
                            final CrmXml.RscSet newRscSet = new CrmXml.RscSet(rscSet.getId(),
                                                                              newRscIds,
                                                                              rscSet.getSequential(),
                                                                              rscSet.getRequireAll(),
                                                                              rscSet.getOrderAction(),
                                                                              rscSet.getColocationRole());
                            rscSetsOrdAttrs.put(newRscSet, null);
                        }
                    } else {
                        rscSetsOrdAttrs.put(rscSet, null);
                    }
                }
            }
            if (Application.isLive(runMode) && rscSetsOrdAttrs.isEmpty()) {
                cphi.getRscSetConnectionDataOrder().setConstraintId(null);
            }
            final Map<String, String> attrs =
                                        new LinkedHashMap<String, String>();
            final CrmXml.OrderData od = clStatus.getOrderData(ordId);
            if (od != null) {
                final String score = od.getScore();
                attrs.put(CrmXml.SCORE_CONSTRAINT_PARAM, score);
            }
            if (Application.isLive(runMode)) {
                ///* so that it will not be removed */
                cphi.setUpdated(false);
            }
            CRM.setRscSet(dcHost,
                          null,
                          false,
                          ordId,
                          false,
                          null,
                          rscSetsOrdAttrs,
                          attrs,
                          runMode);
        } else {
            final String rscFirstId = parent.getHeartbeatId(runMode);
            final List<CrmXml.OrderData> allData = clStatus.getOrderDatas(rscFirstId);
            if (allData != null) {
                for (final CrmXml.OrderData orderData : allData) {
                    final String orderId = orderData.getId();
                    final String rscThenId = orderData.getRscThen();
                    if (rscThenId.equals(getHeartbeatId(runMode))) {
View Full Code Here

        }
        if (Application.isLive(runMode) && !getService().isNew() && !parent.getService().isNew()) {
            parent.setUpdated(true);
            setUpdated(true);
        }
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        final String rscId;
        if (isConstraintPlaceholder()) {
            rscId = getId();
        } else {
            rscId = getHeartbeatId(runMode);
        }
        if (isConstraintPlaceholder() || parent.isConstraintPlaceholder()) {
            final Map<CrmXml.RscSet, Map<String, String>> rscSetsColAttrs =
                                                            new LinkedHashMap<CrmXml.RscSet, Map<String, String>>();
            final ConstraintPHInfo cphi;
            if (isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) this;
            } else {
                cphi = (ConstraintPHInfo) parent;
            }
            final CrmXml.RscSetConnectionData rdata = cphi.getRscSetConnectionDataColocation();
            /** resource set */
            final String colId = rdata.getConstraintId();
            final String idToRemove;
            if (isConstraintPlaceholder()) {
                idToRemove = parent.getService().getCrmId();
            } else {
                idToRemove = getService().getCrmId();
            }
            final List<CrmXml.RscSet> colRscSets = clStatus.getRscSetsCol(colId);
            if (colRscSets != null) {
                CrmXml.RscSet modifiedRscSet = null;
                for (final CrmXml.RscSet rscSet : colRscSets) {
                    if (rscSet.equals(rdata.getRscSet1()) || rscSet.equals(rdata.getRscSet2())) {
                        final List<String> newRscIds = new ArrayList<String>();
                        newRscIds.addAll(rscSet.getRscIds());
                        if (newRscIds.remove(idToRemove) && Application.isLive(runMode)) {
                            modifiedRscSet = rscSet;
                        }
                        if (!newRscIds.isEmpty()) {
                            final CrmXml.RscSet newRscSet = new CrmXml.RscSet(rscSet.getId(),
                                                                              newRscIds,
                                                                              rscSet.getSequential(),
                                                                              rscSet.getRequireAll(),
                                                                              rscSet.getOrderAction(),
                                                                              rscSet.getColocationRole());
                            rscSetsColAttrs.put(newRscSet, null);
                        }
                    } else {
                        rscSetsColAttrs.put(rscSet, null);
                    }
                }
            }
            if (Application.isLive(runMode) && rscSetsColAttrs.isEmpty()) {
                cphi.getRscSetConnectionDataColocation().setConstraintId(null);
            }
            final Map<String, String> attrs = new LinkedHashMap<String, String>();
            final CrmXml.ColocationData cd = clStatus.getColocationData(colId);
            if (cd != null) {
                final String score = cd.getScore();
                attrs.put(CrmXml.SCORE_CONSTRAINT_PARAM, score);
            }
            if (Application.isLive(runMode)) {
                cphi.setUpdated(false);
            }
            CRM.setRscSet(dcHost,
                          colId,
                          false,
                          null,
                          false,
                          rscSetsColAttrs,
                          null,
                          attrs,
                          runMode);
        } else {
            final List<CrmXml.ColocationData> allData = clStatus.getColocationDatas(rscId);
            if (allData != null) {
                for (final CrmXml.ColocationData colocationData : allData) {
                    final String colId = colocationData.getId();
                    final String withRscId = colocationData.getWithRsc();
                    if (withRscId.equals(parent.getHeartbeatId(runMode))) {
View Full Code Here

    void cleanupResource(final Host dcHost, final Application.RunMode runMode) {
        if (Application.isLive(runMode)) {
            setUpdated(true);
        }
        final ClusterStatus cs = getBrowser().getClusterStatus();
        final String rscId = getHeartbeatId(runMode);
        boolean failedClone = false;
        for (final Host host : getBrowser().getClusterHosts()) {
            final Set<String> failedClones = cs.getFailedClones(host.getName(), rscId, runMode);
            if (failedClones == null) {
                continue;
            }
            failedClone = true;
            for (final String fc : failedClones) {
View Full Code Here

            if (Application.isLive(runMode)) {
                getService().setNew(false);
                getBrowser().getCrmGraph().killRemovedVertices();
            }
        } else {
            final ClusterStatus cs = getBrowser().getClusterStatus();
            if (gi == null) {
                removeConstraints(dcHost, runMode);
            }
            if (!getResourceAgent().isGroup()
                && !getResourceAgent().isClone()) {
                String groupId = null; /* for pacemaker */
                if (gi != null) {
                    /* get group id only if there is only one resource in a
                     * group.
                     */
                    if (getService().isNew()) {
                        if (Application.isLive(runMode)) {
                            super.removeMyself(Application.RunMode.LIVE);
                        }
                    } else {
                        final String group = gi.getHeartbeatId(runMode);
                        final DefaultMutableTreeNode giNode = gi.getNode();
                        if (giNode != null) {
                            for (final Info info : treeMenuController.nodesToInfos(giNode.children())) {
                                final ServiceInfo child = (ServiceInfo) info;
                                child.getService().setModified(true);
                                child.getService().doneModifying();
                            }
                        }
                        if (cs.getGroupResources(group, runMode).size() == 1) {
                            if (Application.isLive(runMode)) {
                                gi.getService().setRemoved(true);
                            }
                            gi.removeMyselfNoConfirmFromChild(dcHost, runMode);
                            groupId = group;
View Full Code Here

    public boolean isConstraintPlaceholder() {
        return false;
    }

    void removeConstraints(final Host dcHost, final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        final HbConnectionInfo[] hbcis = getBrowser().getCrmGraph().getHbConnections(this);
        for (final HbConnectionInfo hbci : hbcis) {
            if (hbci != null) {
                getBrowser().getCrmGraph().removeOrder(hbci, dcHost, runMode);
                getBrowser().getCrmGraph().removeColocation(hbci, dcHost, runMode);
            }
        }

        for (final String locId : cs.getLocationIds(getHeartbeatId(runMode), runMode)) {
            CRM.removeLocation(dcHost, locId, getHeartbeatId(runMode), runMode);
        }
    }
View Full Code Here

                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);
                    final PtestData ptestData = new PtestData(CRM.getPtest(dcHost));
                    component.setToolTipText(ptestData.getToolTip());
                    cs.setPtestResult(ptestData);
                } finally {
                    getBrowser().ptestLockRelease();
                }
                startTestLatch.countDown();
            }
View Full Code Here

                    @Override
                    public String check() {
                        if (getBrowser().crmStatusFailed()) {
                            return ClusterBrowser.UNKNOWN_CLUSTER_STATUS_STRING;
                        }
                        final ClusterStatus cs = getBrowser().getClusterStatus();
                        for (final ServiceInfo si : selectedServiceInfos) {
                            if (si.getService().isNew()) {
                                continue;
                            } else if (si.getService().isRemoved()) {
                                return ServiceInfo.IS_BEING_REMOVED_STRING;
                            } else if (si.isRunning(Application.RunMode.LIVE) && !application.isAdvancedMode()) {
                                return "cannot remove running resource<br>(advanced mode only)";
                            }
                            final GroupInfo gi = si.getGroupInfo();
                            if (gi == null) {
                                continue;
                            }
                            final List<String> gr = cs.getGroupResources(
                                    gi.getHeartbeatId(Application.RunMode.LIVE),
                                    Application.RunMode.LIVE);


                            if (gr == null || gr.size() <= 1) {
View Full Code Here

TOP

Related Classes of lcmc.crm.domain.ClusterStatus

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.