Examples of AvailabilityType


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

            List<Object[]> objs = query.getResultList();
            @SuppressWarnings("rawtypes")
            List 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);
            }
            composite.setResources(results);
        }
View Full Code Here

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

            String resourceKey = (String) prefetched[i++];

            Integer parentId = (Integer) prefetched[i++];
            String parentName = (String) prefetched[i++];

            AvailabilityType availType = (AvailabilityType) prefetched[i++];

            Integer typeId = (Integer) prefetched[i++];
            String typeName = (String) prefetched[i++];
            String typePlugin = (String) prefetched[i++];
            Boolean typeSingleton = (Boolean) prefetched[i++];
View Full Code Here

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

                // although the data came from the agent this should be processed like a server-side report
                // because it was requested and initiated by the server (bz 1094540).  The availabilities will
                // still be merged but certain backfill logic will remain unscathed.
                report.setServerSideReport(true);

                AvailabilityType foundAvail = report.forResource(res.getId());
                if (foundAvail != null) {
                    availabilityManager.mergeAvailabilityReport(report);
                } else {
                    foundAvail = res.getCurrentAvailability() == null ? AvailabilityType.UNKNOWN : res
                        .getCurrentAvailability().getAvailabilityType();
View Full Code Here

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

        this.resourceClassLoader = resourceClassLoader;
    }

    @Override
    public String toString() {
        AvailabilityType avail = (this.currentAvailType != null) ? this.currentAvailType : null;
        return this.getClass().getSimpleName() + "[resource=" + this.resource + ", syncState="
            + this.synchronizationState + ", componentState=" + this.resourceComponentState + ", avail=" + avail + "]";
    }
View Full Code Here

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

     * @throws org.rhq.core.pc.inventory.TimeoutException
     *             if an async check exceeds AVAIL_ASYNC_TIMEOUT
     */
    @Override
    synchronized public AvailabilityType getAvailability() {
        AvailabilityType avail = UNKNOWN;

        try {
            // If the avail check timed out, or if we are not attempting synchronous checks (due to
            // exceeding the consecutive timeout limit) then the future will exist.
            if (availabilityFuture != null) {
View Full Code Here

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

     *
     * @param type
     * @return
     */
    private AvailabilityType processAvail(AvailabilityType type) {
        AvailabilityType result = type;
        switch (type) {
        case UP:
        case DOWN:
        case MISSING:
            break;
        default:
            if (LOG.isDebugEnabled()) {
                LOG.debug("ResourceComponent [" + this.resourceContainer + "] getAvailability() returned " + type
                    + ". This is invalid and is being replaced with DOWN.");
            }
            result = DOWN;
        }

        // whenever changing to UP we reset the timeout counter.  This is because DOWN resources often respond
        // slowly to getAvailability() calls (for example, waiting for a connection attempt to time out).  When a
        // resource comes up we should give it a chance to respond quickly and provide live avail.
        AvailabilityType lastAvail = getLastAvailabilityType();
        if (result != getLastAvailabilityType()) {
            if (result == UP) {
                if (availSyncConsecutiveTimeouts >= getSyncTimeoutLimit()) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Enabling synchronous availability collection for [" + resourceContainer
View Full Code Here

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

    }

    private AvailabilityType getLastAvailabilityType() {
        Availability av = this.resourceContainer.getAvailability();
        if (av != null) {
            AvailabilityType avt = av.getAvailabilityType();
            return (avt != null) ? avt : AvailabilityType.UNKNOWN;
        } else {
            return AvailabilityType.UNKNOWN;
        }
    }
View Full Code Here

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

        long disabledTime = 0;
        long unknownTime = 0;
        int failures = 0;
        int disabled = 0;
        long lastChange = 0;
        AvailabilityType current = AvailabilityType.UNKNOWN;

        for (Availability avail : availabilities) {
            switch (avail.getAvailabilityType()) {
            case UP: {
                upTime += getStartEndTimeDuration(avail);
View Full Code Here

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

        // waste time doing discovery on a stale UP SERVER, which can be time consuming.  Since most resources are
        // SERVICEs, and also are typically UP and stay UP, performing checks in these two situations should
        // not add much overhead. Finally, make sure to use facet proxy to do the avail check, this allows us to use
        // a timeout, and therefore not hang discovery if the avail check is slow.
        Availability currentAvailability = parentContainer.getAvailability();
        AvailabilityType currentAvailabilityType = (null == currentAvailability) ? AvailabilityType.DOWN
            : currentAvailability.getAvailabilityType();

        // If there is no current avail, or this is a SERVER, we must perform the live check.
        if (AvailabilityType.UP != currentAvailabilityType
            || ResourceCategory.SERVER == parentContainer.getResource().getResourceType().getCategory()) {
View Full Code Here

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

        if (LOG.isDebugEnabled()) {
            LOG.debug("Scan Starting: " + new Date(start));
        }

        AvailabilityType parentAvailabilityType = null;

        //determine the parent availability
        Resource parent = scanRoot.getParentResource();
        while (parent != null) {
            Availability parentAvail = inventoryManager.getAvailabilityIfKnown(parent);
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.