Package lcmc.crm.domain

Examples of lcmc.crm.domain.ClusterStatus


        text.append("= ").append(CONFIG_CIB).append(" =\n");
        if (configCheckBoxMap.get(CONFIG_CIB).isSelected()) {
            String cib = null;
            final ClusterBrowser cb = cluster.getBrowser();
            if (cb != null) {
                final ClusterStatus cs = cb.getClusterStatus();
                if (cs != null) {
                    cib = cs.getCibXml();
                }
            }
            if (cib == null) {
                text.append("not available\n");
            } else {
View Full Code Here


    protected AccessMode.Type getAccessType(final String param) {
        return AccessMode.ADMIN;
    }

    int getScore() {
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        final String ordId = getService().getCrmId();
        final CrmXml.OrderData data = clStatus.getOrderData(ordId);
        if (data == null) {
            return 0;
        }
        final String score = data.getScore();
        if (score == null) {
View Full Code Here

        return (ClusterBrowser) super.getBrowser();
    }


    void setParameters() {
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        final String ordId = getService().getCrmId();
        final Map<String, Value> resourceNode = new HashMap<String, Value>();

        if (serviceInfoParent == null || serviceInfoChild == null) {
            /* rsc set placeholder */
            final CrmXml.OrderData orderData = clStatus.getOrderData(ordId);
            final String score = orderData.getScore();
            resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
        } else if (serviceInfoParent.isConstraintPlaceholder() || serviceInfoChild.isConstraintPlaceholder()) {
            /* rsc set edge */
            final ConstraintPHInfo cphi;
            final CrmXml.RscSet rscSet;
            if (serviceInfoParent.isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) serviceInfoParent;
                rscSet = cphi.getRscSetConnectionDataOrder().getRscSet2();
            } else {
                cphi = (ConstraintPHInfo) serviceInfoChild;
                rscSet = cphi.getRscSetConnectionDataOrder().getRscSet1();
            }
            resourceNode.put("sequential", new StringValue(rscSet.getSequential()));
            resourceNode.put(CrmXml.REQUIRE_ALL_ATTR, new StringValue(rscSet.getRequireAll()));
            resourceNode.put("action", new StringValue(rscSet.getOrderAction()));
        } else {
            final CrmXml.OrderData orderData = clStatus.getOrderData(ordId);
            if (orderData != null) {
                final String score = orderData.getScore();
                final String symmetrical = orderData.getSymmetrical();
                final String firstAction = orderData.getFirstAction();
                final String thenAction = orderData.getThenAction();
View Full Code Here

        String targetRoleString = "target-role";
        if (Tools.versionBeforePacemaker(dcHost)) {
            targetRoleString = "target_role";
        }
        String crmId = getHeartbeatId(runMode);
        final ClusterStatus cs = getBrowser().getClusterStatus();
        final String refCRMId = cs.getMetaAttrsRef(crmId);
        if (refCRMId != null) {
            crmId = refCRMId;
        }
        String targetRole = cs.getParameter(crmId, targetRoleString, runMode);
        if (targetRole == null) {
            targetRole = getParamDefault(targetRoleString).getValueForConfig();
        }
        return !CrmXml.TARGET_ROLE_STOPPED.equals(targetRole);
    }
View Full Code Here

        String targetRoleString = "target-role";
        if (Tools.versionBeforePacemaker(dcHost)) {
            targetRoleString = "target_role";
        }
        String crmId = getHeartbeatId(runMode);
        final ClusterStatus cs = getBrowser().getClusterStatus();
        final String refCRMId = cs.getMetaAttrsRef(crmId);
        if (refCRMId != null) {
            crmId = refCRMId;
        }
        String targetRole = cs.getParameter(crmId, targetRoleString, runMode);
        if (targetRole == null) {
            targetRole = getParamDefault(targetRoleString).getValueForConfig();
        }
        return CrmXml.TARGET_ROLE_SLAVE.equals(targetRole);
    }
View Full Code Here

        String targetRoleString = "target-role";
        if (Tools.versionBeforePacemaker(dcHost)) {
            targetRoleString = "target_role";
        }
        String crmId = getHeartbeatId(runMode);
        final ClusterStatus cs = getBrowser().getClusterStatus();
        final String refCRMId = cs.getMetaAttrsRef(crmId);
        if (refCRMId != null) {
            crmId = refCRMId;
        }
        String targetRole = cs.getParameter(crmId, targetRoleString, runMode);
        if (targetRole == null) {
            targetRole = getParamDefault(targetRoleString).getValueForConfig();
        }
        return CrmXml.TARGET_ROLE_STOPPED.equals(targetRole);
    }
View Full Code Here

        return getBrowser().getClusterStatus().isManaged(getHeartbeatId(runMode), runMode);
    }

    /** Returns whether the service where was migrated or null. */
    public List<Host> getMigratedTo(final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        for (final Host host : getBrowser().getClusterHosts()) {
            final String locationId = cs.getLocationId(getHeartbeatId(runMode), host.getName(), runMode);
            if (locationId == null
                || (!locationId.startsWith("cli-prefer-")
                    && !locationId.startsWith("cli-standby-")
                    && !locationId.startsWith("cli-ban-"))) {
                continue;
            }
            final HostInfo hi = host.getBrowser().getHostInfo();
            final HostLocation hostLocation = cs.getScore(getHeartbeatId(runMode), hi.getName(), runMode);
            String score = null;
            String op = null;
            if (hostLocation != null) {
                score = hostLocation.getScore();
                op = hostLocation.getOperation();
View Full Code Here

        }
        return null;
    }

    public List<Host> isFenced(final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        for (final Host host : getBrowser().getClusterHosts()) {
            final String locationId = cs.getLocationId(getHeartbeatId(runMode), host.getName(), runMode);
            if (locationId == null || !locationId.contains("fence")) {
                continue;
            }
            final HostInfo hi = host.getBrowser().getHostInfo();
            final HostLocation hostLocation = cs.getScore(getHeartbeatId(runMode), hi.getName(), runMode);
            String score = null;
            if (hostLocation != null) {
                score = hostLocation.getScore();
            }
            if (CrmXml.MINUS_INFINITY_VALUE.getValueForConfig().equals(score)) {
View Full Code Here

        return null;
    }

    /** Returns whether the service where was migrated or null. */
    public List<Host> getMigratedFrom(final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        for (final Host host : getBrowser().getClusterHosts()) {
            final String locationId = cs.getLocationId(getHeartbeatId(runMode), host.getName(), runMode);
            if (locationId == null
                || (!locationId.startsWith("cli-prefer-")
                    && !locationId.startsWith("cli-standby-")
                    && !locationId.startsWith("cli-ban-"))) {
                continue;
            }
            final HostInfo hi = host.getBrowser().getHostInfo();
            final HostLocation hostLocation = cs.getScore(getHeartbeatId(runMode), hi.getName(), runMode);
            String score = null;
            String op = null;
            if (hostLocation != null) {
                score = hostLocation.getScore();
                op = hostLocation.getOperation();
View Full Code Here

        return fcString;
    }


    protected String getFailCount(final String hostName, final Application.RunMode runMode) {
        final ClusterStatus cs = getBrowser().getClusterStatus();
        return cs.getFailCount(hostName, getHeartbeatId(runMode), runMode);
    }
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.