Examples of PluginMetadataManager


Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    public void stop() {
        if (isStarted) {
            this.deploymentInfos.clear();
            this.pluginVersions.clear();
            this.namesOfPluginsToBeRegistered.clear();
            this.metadataManager = new PluginMetadataManager();
            isStarted = false;
            isReady = false;
        }
    }
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    }

    private void discovery(String pcName, PrintWriter out, String pluginName, String resourceTypeName, boolean verbose)
        throws Exception {
        PluginContainer pc = PluginContainer.getInstance();
        PluginMetadataManager metadataManager = pc.getPluginManager().getMetadataManager();
        Set<ResourceType> typesToDiscover = new TreeSet<ResourceType>(new PluginPrimaryResourceTypeComparator());

        // make sure the plugin exists first (if one was specified)
        Set<String> allPlugins = metadataManager.getPluginNames();
        if (pluginName != null) {
            if (!allPlugins.contains(pluginName)) {
                out.println(MSG.getMsg(AgentI18NResourceKeys.DISCOVERY_BAD_PLUGIN_NAME, pluginName));
                return;
            }
        }

        // determine which resource types are to be discovered
        Set<ResourceType> allTypes = metadataManager.getAllTypes();
        if (resourceTypeName != null) {
            for (ResourceType type : allTypes) {
                if (type.getName().equals(resourceTypeName)) {
                    if ((pluginName == null) || (pluginName.equals(type.getPlugin()))) {
                        typesToDiscover.add(type);
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

            // There may be other types in other plugins that extended from this plugin (the "embedded" extension mechanism).
            // In this case, we have to re-deploy those plugins so those types get recreated with the new metadata.
            // We do the same thing with the extended plugins that we will do with our passed-in "parent" plugin, that is,
            // we register the extended plugins' types (we'll force it to update types since we know something changed in the parent)
            // and then we'll remove any obsoleted types from the extended plugins.
            PluginMetadataManager metadataManager = getPluginMetadataManager();
            Map<String, PluginDescriptor> extensions = metadataManager.getEmbeddedExtensions(plugin.getName());
            if (extensions != null && extensions.size() > 0) {
                for (Map.Entry<String, PluginDescriptor> entry : extensions.entrySet()) {
                    String extPluginName = entry.getKey();
                    PluginDescriptor extPluginDescriptor = entry.getValue();
                    log.debug("Plugin [" + extPluginName
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

    // a type can be intensive at scale.
    private boolean registerPluginTypes(String newPluginName, PluginDescriptor pluginDescriptor, boolean newOrUpdated,
        boolean forceUpdate) throws Exception {
        boolean typesUpdated = false;

        PluginMetadataManager metadataManager = getPluginMetadataManager();

        if (newOrUpdated || forceUpdate || !metadataManager.getPluginNames().contains(newPluginName)) {
            Set<ResourceType> rootResourceTypes = metadataManager.loadPlugin(pluginDescriptor);
            if (rootResourceTypes == null) {
                throw new Exception("Failed to load plugin [" + newPluginName + "].");
            }
            if (newOrUpdated || forceUpdate) {
                // Only merge the plugin's ResourceTypes into the DB if the plugin is new or updated or we were forced to
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

            }
            return false;
        }

        // tell our metadata manager what resource types are to be ignored
        PluginMetadataManager metadataMgr = this.pluginManager.getMetadataManager();
        if (ignoredTypes != null && !ignoredTypes.isEmpty()) {
            Collection<ResourceType> ignoredSet = new HashSet<ResourceType>(ignoredTypes.size());
            for (ResourceTypeFlyweight ignoredType : ignoredTypes) {
                ignoredSet.add(new ResourceType(ignoredType.getName(), ignoredType.getPlugin(), null, null));
            }
            metadataMgr.setIgnoredResourceTypes(ignoredSet);
        } else {
            metadataMgr.setIgnoredResourceTypes(null);
        }

        //sync info can be null if the server hasn't received a full inventory report
        //from us yet. This can happen if this method is being invoked from inside the
        //resource upgrade executor to sync up with the server side inventory *JUST AFTER*
 
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

     * TODO GH: Move this to another class (this one is getting too big)
     * @return The discovered platform (which might be a dummy in case of testing)
     */
    private Resource discoverPlatform() {
        SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
        PluginMetadataManager metadataManager = pluginManager.getMetadataManager();
        Set<ResourceType> platformTypes = metadataManager.getTypesForCategory(ResourceCategory.PLATFORM);

        // This should only ever have 1 or, at most, 2 Resources
        // (always the Java fallback platform, and the native platform if supported).
        Set<DiscoveredResourceDetails> allDiscoveredPlatforms = new HashSet<DiscoveredResourceDetails>(2);

View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

        DriftSyncManager driftSyncMgr = createDriftSyncManager();
        driftSyncMgr.syncWithServer(resourceIds);
    }

    private boolean supportsDriftManagement(Resource r) {
        PluginMetadataManager metaDataMgr = this.pluginManager.getMetadataManager();
        ResourceType type = metaDataMgr.getType(r.getResourceType());
        return type != null && type.getDriftDefinitionTemplates() != null
            && !type.getDriftDefinitionTemplates().isEmpty();
    }
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

        if (log.isDebugEnabled()) {
            log.debug("Retrieving unknown Resources for [" + unknownResourceSyncInfos.size()
                + "] unknownResourceSyncInfos...");
        }

        PluginMetadataManager pmm = this.pluginManager.getMetadataManager();
        Set<Resource> unknownResources = getResourcesFromSyncInfos(unknownResourceSyncInfos);

        if (log.isDebugEnabled()) {
            log.debug("Merging [" + unknownResources.size() + "] unknown Resources (and descendents) into inventory...");
        }

        for (Resource unknownResource : unknownResources) {
            ResourceType resourceType = pmm.getType(unknownResource.getResourceType());
            if (resourceType != null) {
                log.info("Got unknown resource: " + unknownResource.getId());
                compactResource(unknownResource);
                mergeResource(unknownResource);
                syncSchedulesRecursively(unknownResource);
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

        this.pluginContainerConfiguration = pluginContainerConfiguration;
        this.pluginLifecycleListenerMgr = pluginLifecycleListenerManager;
        loadedPluginEnvironments = new HashMap<String, PluginEnvironment>();
        loadedPlugins = new ArrayList<Plugin>();
        metadataManager = new PluginMetadataManager();

        metadataManager.setDisabledResourceTypes(pluginContainerConfiguration.getDisabledResourceTypes());
        updateLoadedPlugins = new UpdateLoadedPlugins() {
            PluginTransformer transformer = new PluginTransformer();
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.PluginMetadataManager

        return;
    }

    private void connectTypes(Resource resource, Set<String> uuidsToIgnore) {
        PluginMetadataManager metadataManager = PluginContainer.getInstance().getPluginManager().getMetadataManager();
        ResourceType resourceType = resource.getResourceType();

        if (resourceType != null) {
            ResourceType fullResourceType = metadataManager.getType(resourceType);
            if (fullResourceType != null) {
                resource.setResourceType(fullResourceType);

                // now reconnect all its children's types
                Set<Resource> children = inventoryManager.getContainerChildren(resource);
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.