Package lcmc.crm.domain

Examples of lcmc.crm.domain.ClusterStatus


        final ClusterStatus cs = getBrowser().getClusterStatus();
        return cs.getFailCount(hostName, getHeartbeatId(runMode), runMode);
    }

    protected String getPingCount(final String hostName, final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        return cs.getPingCount(hostName, runMode);
    }
View Full Code Here


        }
    }

    /** Returns whether the resource is orphaned on the specified host. */
    protected final boolean isInLRMOnHost(final String hostName, final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        return cs.isInLRMOnHost(hostName, getHeartbeatId(runMode), runMode);
    }
View Full Code Here

    /**
     * Returns whetrher this service's meta attributes are referenced by
     * some other service.
     */
    private boolean isMetaAttrReferenced() {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        getBrowser().mHeartbeatIdToServiceLock();
        final Map<String, ServiceInfo> services = getBrowser().getHeartbeatIdToServiceInfo();
        for (final ServiceInfo si : services.values()) {
            final String refCRMId = cs.getMetaAttrsRef(si.getService().getCrmId());
            if (refCRMId != null
                && refCRMId.equals(getService().getCrmId())) {
                getBrowser().mHeartbeatIdToServiceUnlock();
                return true;
            }
View Full Code Here

    /**
     * Returns whether this service's operations are referenced by some
     * other service.
     */
    private boolean isOperationReferenced() {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        getBrowser().mHeartbeatIdToServiceLock();
        final Map<String, ServiceInfo> services = getBrowser().getHeartbeatIdToServiceInfo();
        for (final ServiceInfo si : services.values()) {
            final String refCRMId = cs.getOperationsRef(si.getService().getCrmId());
            if (refCRMId != null && refCRMId.equals(getService().getCrmId())) {
                getBrowser().mHeartbeatIdToServiceUnlock();
                return true;
            }
        }
View Full Code Here

        if (isMetaAttrReferenced() || Tools.versionBeforePacemaker(dcHost)) {
            return sl.toArray(new Value[sl.size()]);
        }
        getBrowser().lockNameToServiceInfo();
        final Map<String, ServiceInfo> idToInfoHash = getBrowser().getNameToServiceInfoHash().get(getName());
        final ClusterStatus cs = getBrowser().getClusterStatus();
        if (idToInfoHash != null) {
            for (final ServiceInfo si : new TreeSet<ServiceInfo>(idToInfoHash.values())) {
                if (si != this
                    && cs.getMetaAttrsId(si.getService().getCrmId()) != null
                    && cs.getMetaAttrsRef(si.getService().getCrmId()) == null) {
                    sl.add(si);
                }
            }
        }
        final boolean clone = getResourceAgent().isClone();
        for (final String name : getBrowser().getNameToServiceInfoHash().keySet()) {
            final Map<String, ServiceInfo> idToInfo = getBrowser().getNameToServiceInfoHash().get(name);
            for (final ServiceInfo si : new TreeSet<ServiceInfo>(idToInfo.values())) {
                if (si != this
                    && !si.getName().equals(getName())
                    && si.getResourceAgent() != null
                    && si.getResourceAgent().isClone() == clone
                    && cs.getMetaAttrsId(si.getService().getCrmId()) != null
                    && cs.getMetaAttrsRef(si.getService().getCrmId()) == null) {
                    sl.add(si);
                }
            }
        }
        getBrowser().unlockNameToServiceInfo();
View Full Code Here

        if (isOperationReferenced() || Tools.versionBeforePacemaker(dcHost)) {
            return sl.toArray(new Value[sl.size()]);
        }
        getBrowser().lockNameToServiceInfo();
        final Map<String, ServiceInfo> idToInfoHash = getBrowser().getNameToServiceInfoHash().get(getName());
        final ClusterStatus cs = getBrowser().getClusterStatus();
        if (idToInfoHash != null) {
            for (final ServiceInfo si : new TreeSet<ServiceInfo>(idToInfoHash.values())) {
                if (si != this
                    && cs.getOperationsId(si.getService().getCrmId()) != null
                    && cs.getOperationsRef(si.getService().getCrmId()) == null) {
                    sl.add(si);
                }
            }
        }
        final boolean clone = getResourceAgent().isClone();
        for (final String name : getBrowser().getNameToServiceInfoHash().keySet()) {
            final Map<String, ServiceInfo> idToInfo = getBrowser().getNameToServiceInfoHash().get(name);
            for (final ServiceInfo si : new TreeSet<ServiceInfo>(idToInfo.values())) {
                if (si != this
                    && si.getResourceAgent() != null
                    && si.getResourceAgent().isClone() == clone
                    && !si.getName().equals(getName())
                    && cs.getOperationsId(si.getService().getCrmId()) != null
                    && cs.getOperationsRef(si.getService().getCrmId()) == null) {
                    sl.add(si);
                }
            }
        }
        getBrowser().unlockNameToServiceInfo();
View Full Code Here

        return new StringValue(crmXML.getDefaultValue(resourceAgent, param));
    }

    @Override
    public Value getParamSaved(final String param) {
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        if (isMetaAttr(param)) {
            final String crmId = getService().getCrmId();
            final String refCRMId = clStatus.getMetaAttrsRef(crmId);
            if (refCRMId != null) {
                final String v = clStatus.getParameter(refCRMId, param, Application.RunMode.LIVE);
                if (v == null) {
                    final Value value = getParamPreferred(param);
                    if (value == null || value.isNothingSelected()) {
                        return getParamDefault(param);
                    } else {
                        return value;
                    }
                }
                return new StringValue(v);
            }
        }
        final Value value = super.getParamSaved(param);
        if (value == null || value.isNothingSelected()) {
            final String v = clStatus.getParameter(getService().getCrmId(), param, Application.RunMode.LIVE);
            if (v == null) {
                Value vp = null;
                if (getService().isNew()) {
                    vp = getParamPreferred(param);
                }
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

        return op;
    }

    /** Goes through the scores and sets preferred locations. */
    protected void setLocations(final String heartbeatId, final Host dcHost, final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        for (final Host host : getBrowser().getClusterHosts()) {
            final HostInfo hi = host.getBrowser().getHostInfo();
            final Widget wi = scoreComboBoxHash.get(hi);
            String hs = wi.getStringValue();
            if ("ALWAYS".equals(hs)) {
                hs = CrmXml.INFINITY_VALUE.getValueForConfig();
            } else if ("NEVER".equals(hs)) {
                hs = CrmXml.MINUS_INFINITY_VALUE.getValueForConfig();
            }
            final HostLocation hlSaved = savedHostLocations.get(hi);
            String opSaved = null;
            if (hlSaved != null) {
                opSaved = hlSaved.getOperation();
            }
            final String onHost = hi.getName();
            final String op = getOpFromLabel(onHost, wi.getLabel().getText());
            final HostLocation hostLoc = new HostLocation(hs, op, null, null);
            if (!hostLoc.equals(hlSaved)) {
                String locationId = cs.getLocationId(getHeartbeatId(runMode), onHost, runMode);
                if ((hs == null || hs.isEmpty() || !Tools.areEqual(op, opSaved))
                    && locationId != null) {
                    CRM.removeLocation(dcHost, locationId, getHeartbeatId(runMode), runMode);
                    locationId = null;
                }
                if (hs != null && !hs.isEmpty()) {
                    CRM.setLocation(dcHost,
                                    getHeartbeatId(runMode),
                                    onHost,
                                    hostLoc,
                                    locationId,
                                    runMode);
                }
            }
        }
        /* ping */
        final Widget pwi = pingComboBox;
        if (pwi != null) {
            final Value value = pwi.getValue();
            if (!Tools.areEqual(savedPingOperation, value)) {
                final String pingLocationId = cs.getPingLocationId(getHeartbeatId(runMode), runMode);
                if (pingLocationId != null) {
                    CRM.removeLocation(dcHost, pingLocationId, getHeartbeatId(runMode), runMode);
                }
                if (value != null && !value.isNothingSelected()) {
                    CRM.setPingLocation(dcHost,
View Full Code Here

     * This works for new heartbeats >= 2.99.0
     */
    protected Map<String, Map<String, String>> getOperations(final String heartbeatId) {
        final Map<String, Map<String, String>> operations = new LinkedHashMap<String, Map<String, String>>();

        final ClusterStatus cs = getBrowser().getClusterStatus();
        final CloneInfo ci = getCloneInfo();
        for (final String op : getResourceAgent().getOperationNames()) {
            final Map<String, String> opHash = new LinkedHashMap<String, String>();
            String opId = cs.getOpId(heartbeatId, op);
            if (opId == null) {
                /* generate one */
                opId = "op-" + heartbeatId + '-' + op;
            }
            /* operations have different kind of default, that is
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.