Examples of AvailabilityType


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

            for (int i = 0; i < MULTI; i++) {

                AvailabilityReport report = new AvailabilityReport(agent.getName());
                for (Resource r : resources) {
                    int rand = (int) (Math.random() * 2);
                    AvailabilityType at = (rand == 1) ? AvailabilityType.UP : AvailabilityType.DOWN;
                    Availability a = new Availability(r, (t1 + i * MILLIS_APART), at);
                    report.addAvailability(a);
                }
                startTiming(round);
                availabilityManager.mergeAvailabilityReport(report);
View Full Code Here

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

            long t1 = System.currentTimeMillis() - (MULTI * MILLIS_APART);
            for (int i = 0; i < MULTI; i++) {

                AvailabilityReport report = new AvailabilityReport(agent.getName());
                for (Resource r : resources) {
                    AvailabilityType at = AvailabilityType.UP;
                    Availability a = new Availability(r, (t1 + i * MILLIS_APART), at);
                    report.addAvailability(a);
                }
                startTiming(round);
                availabilityManager.mergeAvailabilityReport(report);
View Full Code Here

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

        return "subsystems/availability/availability_" + color + "_" + (isLarge ? "24" : "16") + ".png";
    }

    // TODO: Fix this overloading of avail icons, status should have their own icons
    public static String getAvailabilityIcon(Boolean status) {
        AvailabilityType availType = (null == status) ? AvailabilityType.UNKNOWN
            : (Boolean.TRUE == status) ? AvailabilityType.UP : AvailabilityType.DOWN;

        return getAvailabilityIconFromAvailTypeAndSize(availType, false);
    }
View Full Code Here

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

        return getAvailabilityIconFromAvailTypeAndSize(availType, false);
    }

    // TODO: Fix this overloading of avail icons, status should have their own icons
    public static String getAvailabilityLargeIcon(Boolean status) {
        AvailabilityType availType = (null == status) ? AvailabilityType.UNKNOWN
            : (Boolean.TRUE == status) ? AvailabilityType.UP : AvailabilityType.DOWN;

        return getAvailabilityIconFromAvailTypeAndSize(availType, true);
    }
View Full Code Here

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

                } else {
                    throw new InvalidExpressionException("Invalid 'type' subexpression: "
                        + PrintUtils.getDelimitedString(tokens, parseIndex, "."));
                }
            } else if (context == ParseContext.Availability) {
                AvailabilityType type = null;
                if (isGroupBy == false) {
                    if (value == null) {
                        // pass through, NULL elements now supported
                    } else if ("up".equalsIgnoreCase(value)) {
                        type = AvailabilityType.UP;
View Full Code Here

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

         * RHQ-1631, make the latest availability dot match the current availability IF desired by the user
         * note: this must occur AFTER reversing the collection so the last dot refers to the most recent time slice
         */
        if (withCurrentAvailability) {
            AvailabilityPoint oldFirstAvailabilityPoint = availabilityPoints.remove(availabilityPoints.size() - 1);
            AvailabilityType newFirstAvailabilityType = oldFirstAvailabilityPoint.getAvailabilityType();
            if (context.type == EntityContext.Type.Resource) {
                newFirstAvailabilityType = getCurrentAvailabilityTypeForResource(subject, context.resourceId);

            } else if (context.type == EntityContext.Type.ResourceGroup) {
                ResourceGroupComposite composite = resourceGroupManager.getResourceGroupComposite(subject,
View Full Code Here

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

                }
            } else {
                latest = (Availability) latestObject;
            }

            AvailabilityType latestType = latest.getAvailabilityType();
            AvailabilityType reportedType = reported.getAvailabilityType();

            // If the reported type is MISSING and this type is enabled for automatic uninventory, then
            // uninventory the resource and continue with the next reported avail. Otherwise, convert to
            // DOWN and process as usual.
            if (AvailabilityType.MISSING == reportedType) {
View Full Code Here

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

        // At this point we should be able to just checkConditions because if there is only one avail record for the
        // duration period it means nothing has changed.  But, we'll perform a sanity check just to ensure the avail
        // type is what we think it should be...

        Availability avail = avails.get(0);
        AvailabilityType availType = avail.getAvailabilityType();

        boolean checkConditions = false;
        switch (operator) {
        case AVAIL_DURATION_DOWN:
            checkConditions = (AvailabilityType.DOWN == availType);
View Full Code Here

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

        // resource and row. So we need to construct the ResourceWithAvailability objects ourselves.
        List<Object[]> objs = query.getResultList();
        List<ResourceWithAvailability> results = new ArrayList<ResourceWithAvailability>(objs.size());
        for (Object[] ob : objs) {
            Resource r = (Resource) ob[0];
            AvailabilityType at = (AvailabilityType) ob[1];
            ResourceWithAvailability rwa = new ResourceWithAvailability(r, at);
            results.add(rwa);
        }

        return results;
View Full Code Here

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

        // We are not doing a query with constructor here, as this would fire a select per
        // resource and row. So we need to construct the ResourceWithAvailability objects ourselves.
        List<Object[]> objs = query.getResultList();
        for (Object[] ob : objs) {
            Resource r = (Resource) ob[0];
            AvailabilityType at = (AvailabilityType) ob[1];
            ResourceWithAvailability rwa = new ResourceWithAvailability(r, at);

            AutoGroupComposite comp = new AutoGroupComposite(oneComp);
            List res = new ArrayList(1); // hack to get around type safety
            res.add(rwa);
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.