Examples of DiscoveredResourceDetails


Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

        // Configurations are not immutable, so clone the plugin config, so the plugin will not be able to change the
        // actual PC-managed plugin config.
        Configuration pluginConfigClone = resource.getPluginConfiguration().deepCopy(false);
        // TODO (ips): Clone the ResourceType too for the same reason.

        DiscoveredResourceDetails details = new DiscoveredResourceDetails(resourceType, resource.getResourceKey(),
            resource.getName(), resource.getVersion(), resource.getDescription(), pluginConfigClone, null); // TODO: I have a feeling we'll need process info, how to get it??

        List<URL> results = proxy.getAdditionalClasspathUrls(discoveryContext, details);

        return results;
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

            // Get the discovery component responsible for discovering resources of the specified resource type.
            PluginComponentFactory pluginComponentFactory = PluginContainer.getInstance().getPluginComponentFactory();
            ResourceDiscoveryComponent discoveryComponent = pluginComponentFactory.getDiscoveryComponent(resourceType,
                parentResourceContainer);

            DiscoveredResourceDetails discoveredResourceDetails;
            if (discoveryComponent instanceof ManualAddFacet) {
                // The plugin is using the new manual add API.
                ResourceDiscoveryContext<ResourceComponent<?>> discoveryContext = new ResourceDiscoveryContext<ResourceComponent<?>>(
                    resourceType, parentResourceComponent, parentResourceContainer.getResourceContext(),
                    SystemInfoFactory.createSystemInfo(), new ArrayList<ProcessScanResult>(0),
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

                + "the platform discovery components for platform types " + platformTypes + " "
                + "should be fixed so together they report no more than 2 platforms total. " + "Reported platforms: "
                + allDiscoveredPlatforms + ".");
        }

        DiscoveredResourceDetails javaPlatform = null;
        DiscoveredResourceDetails nativePlatform = null;
        for (DiscoveredResourceDetails discoveredPlatform : allDiscoveredPlatforms) {
            // We know the Java resource type in the descriptor is named "Java".
            if (discoveredPlatform.getResourceType().getName().equalsIgnoreCase("Java")) {
                javaPlatform = discoveredPlatform;
            } else {
                nativePlatform = discoveredPlatform;
            }
        }

        // In most cases, we will have both (since we support most platforms natively),
        // so use the native platform if we have it; if not, fall back to the Java platform.
        DiscoveredResourceDetails platformToUse = (nativePlatform != null) ? nativePlatform : javaPlatform;

        // Build our actual platform resource now that we've discovered it.
        Resource platform = createNewResource(platformToUse);
        platform.setAgent(this.agent);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

        HashSet<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>(count);
        for (int i = 1; i <= count; i++) {
            String key = rt.getName() + "_" + i;
            String name = rt.getName() + "_" + i;
            String version = "1";
            DiscoveredResourceDetails resource = new DiscoveredResourceDetails(rt, key, name, version, null,
                context.getDefaultPluginConfiguration(), null);
            details.add(resource);
        }

        return details;
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

        ResourceType rt = context.getResourceType();
        String key = "SingleResourceKey";
        String name = "SingleResourceName";
        String version = "1";
        Configuration pc = context.getDefaultPluginConfiguration();
        DiscoveredResourceDetails resource = new DiscoveredResourceDetails(rt, key, name, version, null, pc, null);
        details.add(resource);

        return details;
    }
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

        config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_HTTPD_CONF, httpdConfPath));
        config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SNMP_AGENT_HOST, snmpHost));
        config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SNMP_AGENT_PORT, snmpPort));
        config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_URL, pingUrl));

        DiscoveredResourceDetails result = discoveryComponent.discoverResource(config, discoveryContext);

        serverComponent = new ApacheServerComponent();

        Resource resource = new Resource(result.getResourceKey(), null, apacheServerResourceType);
        resource.setPluginConfiguration(config);
        resourceContext = new ResourceContext<PlatformComponent>(resource, null, null, discoveryComponent, systemInfo,
            null, null, null, new EventContext() {

                @Override
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

            executionCountsByResourceType.put(resourceType, 1);
        } else {
            executionCountsByResourceType.put(resourceType, count + 1);
        }

        DiscoveredResourceDetails resourceDetails = new DiscoveredResourceDetails(resourceType,
            "SINGLETON", resourceType.getName(), "1.0", resourceType.getDescription(),
            discoveryContext.getDefaultPluginConfiguration(), null);

        return Collections.singleton(resourceDetails);
    }
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ResourceComponent<?>> discoveryContext)
        throws InvalidPluginConfigurationException, Exception {

        ResourceType resourceType = discoveryContext.getResourceType();

        DiscoveredResourceDetails resourceDetails1 = new DiscoveredResourceDetails(resourceType,
                "key-to-be-aborted", resourceType.getName(), "1.0", resourceType.getDescription(),
                discoveryContext.getDefaultPluginConfiguration(), null);

        DiscoveredResourceDetails resourceDetails2 = new DiscoveredResourceDetails(resourceType,
                "key-ok", resourceType.getName(), "1.0", resourceType.getDescription(),
                discoveryContext.getDefaultPluginConfiguration(), null);

        Set<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>(2);
        Collections.addAll(details, resourceDetails1, resourceDetails2);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

    public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,
        ResourceDiscoveryContext<ResourceComponent<?>> context) throws InvalidPluginConfigurationException {

        ResourceType resourceType = context.getResourceType();

        return new DiscoveredResourceDetails(resourceType, "SINGLETON", resourceType.getName(), "1.0",
            resourceType.getDescription(), pluginConfiguration, null);
    }
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails

        }

        TestComponent.DISCOVERY_CALLS_COUNT.incrementAndGet();
               
        ProcessInfo pinfo = context.getAutoDiscoveredProcesses().get(0).getProcessInfo();
        return Collections.singleton(new DiscoveredResourceDetails(context.getResourceType(), "KEY", "NAME", "VERSION", null, context.getDefaultPluginConfiguration(), pinfo));
    }
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.