Package org.rhq.core.clientapi.agent.discovery

Examples of org.rhq.core.clientapi.agent.discovery.DiscoveryAgentService


        abortResourceManualAddIfExistingSingleton(parentResource, resourceType);

        MergeResourceResponse mergeResourceResponse;
        try {
            AgentClient agentClient = this.agentManager.getAgentClient(parentResource.getAgent());
            DiscoveryAgentService discoveryAgentService = agentClient.getDiscoveryAgentService();
            mergeResourceResponse = discoveryAgentService.manuallyAddResource(resourceType, parentResourceId,
                importResourceRequest.getPluginConfiguration(), subject.getId());
        } catch (CannotConnectException e) {
            throw new CannotConnectToAgentException("Error adding [" + resourceType + "] Resource to inventory as "
                + "a child of " + parentResource + " - cause: " + e.getMessage(), e);
        } catch (RuntimeException e) {
View Full Code Here


     */

    private Resource discoverPlatform() throws Exception {
        PluginContainer pc = PluginContainer.getInstance();

        DiscoveryAgentService discovery = pc.getDiscoveryAgentService();

        discovery.executeServerScanImmediately();
        discovery.executeServiceScanImmediately();

        Resource platform = discovery.getPlatform();

        return platform;
    }
View Full Code Here

        Resource platform = discoverPlatform();
        // @TODO change to get other Datasources, String would be different.
        Resource jonDs = null;//findService("RHQDS", SERVER_JON, platform);
        Resource defaultDs = null;//findService("DefaultDS", SERVER_JON, platform);

        DiscoveryAgentService discoveryService = PluginContainer.getInstance().getDiscoveryAgentService();

        Availability availability;

        availability = discoveryService.getAvailability(jonDs);
        assert availability != null : "Availability was returned as null";
        assert availability.getResource().getId() == jonDs.getId() : "Incorrect resource ID associated with availability";
        assert availability.getAvailabilityType() == AvailabilityType.UP : "Mock default value for availability was set incorrectly";

        availability = discoveryService.getAvailability(defaultDs);
        assert availability != null : "Availability was returned as null";
        assert availability.getResource().getId() == defaultDs.getId() : "Incorrect resource ID associated with availability";
        assert availability.getAvailabilityType() == AvailabilityType.DOWN : "Mock did not set availability to down correctly";

    }
View Full Code Here

    private Resource discoverPlatform()
            throws Exception
    {
        PluginContainer pc = PluginContainer.getInstance();

        DiscoveryAgentService discovery = pc.getDiscoveryAgentService();

        discovery.executeServerScanImmediately();
        discovery.executeServiceScanImmediately();

        return discovery.getPlatform();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.agent.discovery.DiscoveryAgentService

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.