Examples of AvailabilityReport


Examples of org.rhq.core.domain.discovery.AvailabilityReport

        createAlertDefinitionWithAvailDurationCondition(resource.getId(), "testAvailDurationAlertDef_2",
            AlertConditionOperator.AVAIL_DURATION_DOWN, 10);

        // resource has initial UNKNOWN ResourceAvailability and no Availability records. simulate an avail report
        // coming from the agent and setting the initial avail to UP.
        AvailabilityReport availReport = new AvailabilityReport(AGENT_NAME);
        availReport.addAvailability(new Datum(resource.getId(), AvailabilityType.UP, System.currentTimeMillis()));
        AvailabilityManagerLocal availManager = LookupUtil.getAvailabilityManager();
        availManager.mergeAvailabilityReport(availReport);

        // wait for our JMS messages to process and see if we get any alerts
        Thread.sleep(4000);

        PageList<Alert> alerts = getAlerts(resource.getId());
        assert alerts.size() == 0 : "No alert should have fired on the initial avail reporting: " + alerts;

        // Now simulate the down avail
        availReport = new AvailabilityReport(AGENT_NAME);
        availReport
            .addAvailability(new Datum(resource.getId(), AvailabilityType.DOWN, System.currentTimeMillis() + 10));
        availManager.mergeAvailabilityReport(availReport);

        // wait for our JMS messages to process and see if we get any alerts
        Thread.sleep(4000);
View Full Code Here

Examples of org.rhq.core.domain.discovery.AvailabilityReport

                @Override
                public AvailabilityReport answer(InvocationOnMock invocation) throws Throwable {
                    Resource res = (Resource) invocation.getArguments()[0];
                    AvailabilityType avail = count++ == 0 ? AvailabilityType.DOWN : AvailabilityType.UP;

                    AvailabilityReport ret = new AvailabilityReport(AGENT_NAME);
                    ret.addAvailability(new AvailabilityReport.Datum(res.getId(), avail, System.currentTimeMillis()));

                    return ret;
                }
            });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.