Package org.rhq.core.domain.measurement

Examples of org.rhq.core.domain.measurement.AvailabilityType


            List<Object[]> rwas2 = q.getResultList();
            Assert.assertEquals(rwas2.size(), (ids.size() * 2)); // multiple by 2 as each will have an initial UNKNOWN avail

            for (Object[] ob : rwas2) {
                Resource r = (Resource) ob[0];
                AvailabilityType at = (AvailabilityType) ob[1];
                ResourceWithAvailability rwa = new ResourceWithAvailability(r, at);
                rwas.add(rwa);
            }
            Assert.assertEquals(rwas.size(), (ids.size() * 2)); // multiple by 2 as each will have an initial UNKNOWN avail

View Full Code Here


        AlertConditionCacheStats stats = new AlertConditionCacheStats();
        try {
            for (Availability availability : availabilities) {
                Resource resource = availability.getResource();
                AvailabilityType availabilityType = availability.getAvailabilityType();

                List<AvailabilityCacheElement> cacheElements = lookupAvailabilityCacheElements(resource.getId());

                processCacheElements(cacheElements, availabilityType, availability.getStartTime(), stats);
View Full Code Here

                int count = 0;

                @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

    public void stop() {
        return;
    }

    public AvailabilityType getAvailability() {
        AvailabilityType aType = super.getAvailability();
        return aType;
    }
View Full Code Here

        parent = null;
    }

    @Override
    public AvailabilityType getAvailability() {
        AvailabilityType result = AvailabilityType.DOWN;

        if (LOG.isDebugEnabled()) {
            LOG.debug("Availability check for " + databaseName);
        }
        Connection jdbcConnection = null;
View Full Code Here

    private LogFileEventResourceComponentHelper logFileEventDelegate;
    private CreateChildResourceFacetDelegate createChildResourceDelegate;

    public AvailabilityType getAvailability() {
        connectToProfileService();
        AvailabilityType availability;
        if (this.connection != null) {
            try {
                ManagementView managementView = this.connection.getManagementView();
                managementView.load();
View Full Code Here

        }
    }

    @Override
    public AvailabilityType getAvailability() {
        AvailabilityType avail = super.getAvailability();

        if (avail == AvailabilityType.DOWN) {
            asVersion = null;
        }
View Full Code Here

    private String vhost;
    private String contextRoot;

    @Override
    public AvailabilityType getAvailability() {
        AvailabilityType availability;
        if (this.jbossWebMBean != null) {
            int state = (Integer) this.jbossWebMBean.getAttribute("state").refresh();
            availability = (state == JBossWebMBeanState.STARTED) ? AvailabilityType.UP : AvailabilityType.DOWN;
        } else {
            // The WAR has no jboss.web MBean associated with it - this means it
View Full Code Here

        System.out.println("===== Updating Server Resource's plugin configuration: " + pluginConfig.toString(true));
        restartServerResourceComponent();

        // If the ResourceComponent connected to the managed server successfully, the Resource should now be UP.
        Thread.sleep(1000);
        AvailabilityType avail = getAvailability(getServerResource());
        assertEquals(avail, AvailabilityType.UP);

        System.out.println("---------- Finished " + getClass().getSimpleName() + ".testConnection...");
    }
View Full Code Here

    @Test(dependsOnMethods = { "testConnection" })
    public void testShutdownAndStartOperations() throws Exception {
        System.out.println("\n****** Running " + getClass().getSimpleName() + ".testShutdownAndStartOperations...");

        // First make sure the server is up.
        AvailabilityType avail = getAvailability(getServerResource());
        assertEquals(avail, AvailabilityType.UP);

        System.out.println("===== Shutting Down Managed Server: " + getServerResource());

        // Now shut it down using the Shutdown op and make sure it has gone down.
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.measurement.AvailabilityType

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.