Examples of DiscoveryServerServiceImpl


Examples of org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl

        // Set the resources disabled via the standard mergeInventoryReport mechanism, from the server service
        // level. We do this for a few reasons:
        // - The server service uses locking to ensure we don't conflict with an actual report from the agent
        // - It ensure all necessary db modifications take place, like avail history and current avail
        // - It ensures that all ancillary avail change logic, like alerting, still happens.
        DiscoveryServerServiceImpl service = new DiscoveryServerServiceImpl();
        for (AvailabilityReport report : reports.values()) {
            service.mergeAvailabilityReport(report);
        }

        return disableResourceIds;
    }
View Full Code Here

Examples of org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl

        // Set the resources disabled via the standard mergeInventoryReport mechanism, from the server service
        // level. We do this for a few reasons:
        // - The server service uses locking to ensure we don't conflict with an actual report from the agent
        // - It ensure all necessary db modifications take place, like avail history and current avail
        // - It ensures that all ancillary avail change logic, like alerting, still happens.
        DiscoveryServerServiceImpl service = new DiscoveryServerServiceImpl();
        for (AvailabilityReport report : reports.values()) {
            service.mergeAvailabilityReport(report);
        }

        // Ask the relevant agents to send a full availability check so that the newly enabled resources get
        // current availability as soon as possible.  Do this async (via Quartz) so we don't hang waiting for
        // Agent connections.
View Full Code Here

Examples of org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl

    }

    public void testResourceErrors() {
        ResourceError error;
        List<ResourceError> errors;
        DiscoveryServerServiceImpl serverService = new DiscoveryServerServiceImpl();

        errors = resourceManager.findResourceErrors(getOverlord(), newResource.getId(),
            ResourceErrorType.INVALID_PLUGIN_CONFIGURATION);
        assert errors.size() == 0;

        error = new ResourceError(newResource, ResourceErrorType.INVALID_PLUGIN_CONFIGURATION, "test summary",
            "test detail", 12345);

        // simulate the agent notifying the server about an error
        // this will exercise the addResourceError in the SLSB
        serverService.setResourceError(error);
        errors = resourceManager.findResourceErrors(getOverlord(), newResource.getId(),
            ResourceErrorType.INVALID_PLUGIN_CONFIGURATION);
        assert errors.size() == 1;
        error = errors.get(0);
        assert error.getId() > 0;
        assert error.getSummary().equals("test summary");
        assert error.getDetail().equals("test detail");
        assert error.getErrorType() == ResourceErrorType.INVALID_PLUGIN_CONFIGURATION;
        assert error.getTimeOccurred() == 12345;

        // simulate the agent notifying the server about another error.
        // there will only be a single invalid plugin config allowed; the prior one will be deleted
        // this will exercise the addResourceError and deleteResourceError in the SLSB
        error.setId(0);
        error.setTimeOccurred(567890);
        error.setSummary("another summary");
        error.setDetail("another detail");
        serverService.setResourceError(error);
        errors = resourceManager.findResourceErrors(getOverlord(), newResource.getId(),
            ResourceErrorType.INVALID_PLUGIN_CONFIGURATION);
        assert errors.size() == 1;
        error = errors.get(0);
        assert error.getId() > 0;
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.