Package lcmc.crm.domain

Examples of lcmc.crm.domain.ClusterStatus


                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


    public ClusterBrowser getBrowser() {
        return (ClusterBrowser) super.getBrowser();
    }

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

        if (serviceInfoRsc == null || serviceInfoWithRsc == null) {
            /* rsc set placeholder */
            final CrmXml.ColocationData colocationData = clStatus.getColocationData(colId);
            final String score = colocationData.getScore();
            resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
        } else if (serviceInfoRsc.isConstraintPlaceholder()
                   || serviceInfoWithRsc.isConstraintPlaceholder()) {
            /* rsc set edge */
            final ConstraintPHInfo cphi;
            final CrmXml.RscSet rscSet;
            if (serviceInfoRsc.isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) serviceInfoRsc;
                rscSet = cphi.getRscSetConnectionDataColocation().getRscSet1();
            } else {
                cphi = (ConstraintPHInfo) serviceInfoWithRsc;
                rscSet = cphi.getRscSetConnectionDataColocation().getRscSet2();
            }
            resourceNode.put("sequential", new StringValue(rscSet.getSequential()));
            resourceNode.put("role", new StringValue(rscSet.getColocationRole()));
        } else {
            final CrmXml.ColocationData colocationData = clStatus.getColocationData(colId);
            if (colocationData != null) {
                final String score = colocationData.getScore();
                final String rscRole = colocationData.getRscRole();
                final String withRscRole = colocationData.getWithRscRole();

View Full Code Here

    /** Returns the score of this colocation. */
    int getScore() {
        //final String rsc = serviceInfoRsc.getService().getHeartbeatId();
        //final String withRsc =
        //                  serviceInfoWithRsc.getService().getHeartbeatId();
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        final String colId = getService().getCrmId();
        final CrmXml.ColocationData data = clStatus.getColocationData(colId);
        if (data == null) {
            return 0;
        }
        final String score = data.getScore();
        if (score == null) {
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 clStatus = getBrowser().getClusterStatus();
                    clStatus.setPtestResult(null);
                    apply(dcHost, Application.RunMode.TEST);
                    final PtestData ptestData = new PtestData(CRM.getPtest(dcHost));
                    component.setToolTipText(ptestData.getToolTip());
                    clStatus.setPtestResult(ptestData);
                } finally {
                    getBrowser().ptestLockRelease();
                }
                startTestLatch.countDown();
            }
View Full Code Here

                    return;
                }

                LOG.debug1("updateHeartbeatDrbdThread: first host: " + firstHost);
                crmXml.init(firstHost, getServicesInfo());
                final ClusterStatus newClusterStatus = clusterStatusProvider.get();
                newClusterStatus.init(firstHost, crmXml);
                clusterStatus = newClusterStatus;
                initOperations();
                drbdXml = drbdXmlProvider.get();
                drbdXml.init(cluster.getHostsArray(), hostDrbdParameters);
                /* available services */
 
View Full Code Here

    public void parseClusterOutput(final String output,
                            final StringBuffer clusterStatusOutput,
                            final Host host,
                            final CountDownLatch firstTime,
                            final Application.RunMode runMode) {
        final ClusterStatus clusterStatus0 = this.clusterStatus;
        clStatusLock();
        if (crmStatusCanceledByUser || clusterStatus0 == null) {
            clStatusUnlock();
            firstTime.countDown();
            return;
        }
        if (output == null || "".equals(output)) {
            clusterStatus0.setOnlineNode(host.getName(), "no");
            setCrmStatus(host, false);
            firstTime.countDown();
        } else {
            // TODO: if we get ERROR:... show it somewhere
            clusterStatusOutput.append(output);
            /* removes the string from the output. */
            int s = clusterStatusOutput.indexOf(RESET_STRING);
            while (s >= 0) {
                clusterStatusOutput.delete(s, s + RESET_STRING_LEN);
                s = clusterStatusOutput.indexOf(RESET_STRING);
            }
            if (clusterStatusOutput.length() > 12) {
                final String e = clusterStatusOutput.substring(clusterStatusOutput.length() - 12);
                if (e.trim().equals("---done---")) {
                    final int i = clusterStatusOutput.lastIndexOf("---start---");
                    if (i >= 0) {
                        if (clusterStatusOutput.indexOf("is stopped") >= 0) {
                            /* TODO: heartbeat's not running. */
                        } else {
                            final String status = clusterStatusOutput.substring(i);
                            clusterStatusOutput.delete(0, clusterStatusOutput.length());
                            if (CLUSTER_STATUS_ERROR.equals(status)) {
                                final boolean oldStatus = host.isCrmStatusOk();
                                clusterStatus0.setOnlineNode(host.getName(), "no");
                                setCrmStatus(host, false);
                                if (oldStatus) {
                                   crmGraph.repaint();
                                }
                            } else {
                                if (clusterStatus0.parseStatus(status)) {
                                    LOG.debug1("processClusterOutput: host: " + host.getName());
                                    final ServicesInfo ssi = servicesInfo;
                                    rscDefaultsInfo.setParameters(clusterStatus0.getRscDefaultsValuePairs());
                                    ssi.setGlobalConfig(clusterStatus0);
                                    ssi.setAllResources(clusterStatus0, runMode);
                                    if (firstTime.getCount() == 1) {
                                        /* one more time so that id-refs work.*/
                                        ssi.setAllResources(clusterStatus0, runMode);
                                    }
                                    treeMenuController.repaintMenuTree();
                                    clusterHostsInfo.updateTable(ClusterHostsInfo.MAIN_TABLE);
                                }
                                final String online = clusterStatus0.isOnlineNode(host.getName());
                                if ("yes".equals(online)) {
                                    setCrmStatus(host, true);
                                    setCrmStatus();
                                } else {
                                    setCrmStatus(host, false);
View Full Code Here

        return null;
    }

    /** Returns whether the host is in stand by. */
    public boolean isStandby(final Host host, final Application.RunMode runMode) {
        final ClusterStatus cl = clusterStatus;
        if (cl == null) {
            return false;
        }
        final String standby = cl.getNodeParameter(host.getName().toLowerCase(Locale.US), "standby", runMode);
        return "on".equals(standby) || "true".equals(standby);
    }
View Full Code Here

     * Finds and returns DC host.
     * TODO: document what's going on.
     */
    public Host getDCHost() {
        String dc = null;
        final ClusterStatus cl = clusterStatus;
        if (cl != null) {
            dc = cl.getDC();
        }
        final List<Host> hosts = new ArrayList<Host>();
        int lastHostIndex = 0;
        int i = 0;
        Host dcHost = null;
View Full Code Here

                                return "cannot remove running resource<br>(advanced mode only)";
                            }
                            if (serviceInfo.getGroupInfo() == null) {
                                return null;
                            }
                            final ClusterStatus cs = serviceInfo.getBrowser().getClusterStatus();
                            final List<String> gr = cs.getGroupResources(
                                                          serviceInfo.getGroupInfo().getHeartbeatId(runMode),
                                                          runMode);


                            if (gr != null && gr.size() > 1) {
View Full Code Here

    }

    private Value getOpDefaultsDefault(final String param) {
        assert param != null;
        /* if op_defaults is set... It cannot be set in the GUI  */
        final ClusterStatus cs = getBrowser().getClusterStatus();
        if (cs != null) {
            return cs.getOpDefaultsValuePairs().get(param);
        }
        return null;
    }
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.