Examples of DiscoveredResourceDetails


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

      /**
       *
       * A discovered resource must have a unique key, that must stay the
       * same when the resource is discovered the next time
       */
      DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
          discoveryContext.getResourceType(), // ResourceType
          translatorKey, // Resource Key
          translatorName, // Resource Name
          ApplicationInfo.getInstance().getReleaseNumber(), // Version
          description, // Description
          discoveryContext.getDefaultPluginConfiguration(), // Plugin config
          null // Process info from a process scan
      );

      // Get plugin config map for models
      Configuration configuration = detail.getPluginConfiguration();

      configuration.put(new PropertySimple("name", translatorName));//$NON-NLS-1$
      detail.setPluginConfiguration(configuration);
     
       // Add to return values
      // First get translator specific properties
      ManagedProperty translatorProps = translator.getProperty("property");//$NON-NLS-1$
      PropertyList list = new PropertyList("translatorList");//$NON-NLS-1$
      PropertyMap propMap = null;
      getTranslatorValues(translatorProps.getValue(), propMap, list);

      // Now get common properties
      configuration.put(new PropertySimple("name", translatorName));//$NON-NLS-1$
      configuration.put(new PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type", String.class)));//$NON-NLS-1$ //$NON-NLS-2$

      detail.setPluginConfiguration(configuration);
      // Add to return values
      discoveredResources.add(detail);
      log.debug("Discovered Teiid Translator: " + translatorName);
    }

View Full Code Here

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

    /**
     *
     * A discovered resource must have a unique key, that must stay the same
     * when the resource is discovered the next time
     */
    DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
        discoveryContext.getResourceType(), // ResourceType
        mc.getName(), // Resource Key
        PluginConstants.ComponentType.Platform.TEIID_ENGINE_RESOURCE_NAME, // Resource name
        version,
        PluginConstants.ComponentType.Platform.TEIID_ENGINE_RESOURCE_DESCRIPTION, // Description
        discoveryContext.getDefaultPluginConfiguration(), // Plugin
        // Config
        null // Process info from a process scan
    );

    Configuration configuration = detail.getPluginConfiguration();
    configuration.put(new PropertySimple("displayPreviewVDBS", Boolean.FALSE));
    detail.setPluginConfiguration(configuration);

    // Add to return values
    discoveredResources.add(detail);
    log.debug("Discovered Teiid instance: " + mc.getName()); //$NON-NLS-1$
    return discoveredResources;
View Full Code Here

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

      /**
       *
       * A discovered resource must have a unique key, that must stay the
       * same when the resource is discovered the next time
       */
      DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
          discoveryContext.getResourceType(), // ResourceType
          vdbKey, // Resource Key
          vdbName, // Resource Name
          vdbVersion.toString(), // Version
          PluginConstants.ComponentType.VDB.DESCRIPTION, // Description
          discoveryContext.getDefaultPluginConfiguration(), // Plugin
          // Config
          null // Process info from a process scan
      );

      // Get plugin config map for properties
      Configuration configuration = detail.getPluginConfiguration();

      configuration.put(new PropertySimple("name", vdbName));
      configuration.put(new PropertySimple("fullName", fullName));
      configuration.put(new PropertySimple("version", vdbVersion));
      configuration
          .put(new PropertySimple("description", vdbDescription));
      configuration.put(new PropertySimple("status", vdbStatus));
      configuration.put(new PropertySimple("url", vdbURL));

      detail.setPluginConfiguration(configuration);

      // Add to return values
      discoveredResources.add(detail);
      log.debug("Discovered Teiid VDB: " + vdbName);
    }
View Full Code Here

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

        /**
         *
         * A discovered resource must have a unique key, that must stay
         * the same when the resource is discovered the next time
         */
        DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
            discoveryContext.getResourceType(), // ResourceType
            dataRoleName, // Resource Key
            dataRoleName, // Resource Name
            null, // Version
            PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
            discoveryContext.getDefaultPluginConfiguration(), // Plugin
            // Config
            null // Process info from a process scan
        );

        Configuration configuration = detail.getPluginConfiguration();

        configuration.put(new PropertySimple("name", dataRoleName));
        configuration.put(new PropertySimple("anyAuthenticated",
            anyAuthenticated));
        configuration
View Full Code Here

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

          versionNumber = "";
        }

    for (Iterator i = jmxResources.iterator(); i.hasNext();) {
          String description = null;
          DiscoveredResourceDetails drd = (DiscoveredResourceDetails) i.next();
          resourceKey = drd.getResourceKey();
          try {
                EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
                Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
                for (Iterator ai = attributeSet.iterator(); ai.hasNext();) {
                    EmsAttribute attr = (EmsAttribute) ai.next();

                    if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
                        description = (String) attr.getValue();
                        if (description != null)
                        {
                            description = description.trim();
                        }
                    }
                }
            } catch (Exception e) {
            }
            if ((description == null) || (description.length() == 0)) {
                description = "Service Entity";
            }
            drd.setResourceVersion(versionNumber);
            drd.setResourceDescription(description);
        }

        return jmxResources;
    }
View Full Code Here

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

        Set<EmsAttribute> attributeSet = actionBean.getAttributes();
        for (Iterator i = attributeSet.iterator(); i.hasNext();) {
          EmsAttribute attr = (EmsAttribute) i.next();
          if (attr.getName().endsWith(MESSAGES_SUCCESSFULLY_PROCESSED)) {
            String actionName = attr.getName().replaceAll(MESSAGES_SUCCESSFULLY_PROCESSED, "");
                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), actionName,
                        actionName, null, "Action Entity", null, null);
               
                Configuration pc = detail.getPluginConfiguration();
                ArrayList<Property> props = new ArrayList<Property>();
                detail.setResourceVersion(versionNumber);
                entities.add(detail);
          }
        }
       
        return entities;
View Full Code Here

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

    @Override
    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ResourceComponent<?>> context)
        throws InvalidPluginConfigurationException, Exception {
       
        DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), "KEY", "NAME", "VERSION", null, context.getDefaultPluginConfiguration(), null);
       
        return Collections.singleton(resource);
    }
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

        ResourceDiscoveryCallback.DiscoveryCallbackResults callbackResults;
        PluginComponentFactory pluginComponentFactory = PluginContainer.getInstance().getPluginComponentFactory();
        ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();

        for (Iterator<DiscoveredResourceDetails> detailsIterator = results.iterator(); detailsIterator.hasNext();) {
            DiscoveredResourceDetails details = detailsIterator.next();
            int callbackCount = 0;
            boolean stopProcessing = false; // if true, a callback told us he found a details that he modified and we should stop
            boolean abortDiscovery = false; // if true, multiple callbacks claimed ownership which isn't allowed - its discovery will be aborted
            boolean vetoDiscovery = false; // if true, a callback veto'ed the resource - it should not be discovered at all
            for (Map.Entry<String, List<String>> entry : callbacks.entrySet()) {
View Full Code Here

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

        long timeout = getDiscoveryComponentTimeout();

        try {
            ManualAddFacet proxy = this.discoveryComponentProxyFactory.getDiscoveryComponentProxy(
                context.getResourceType(), component, timeout, ManualAddFacet.class, parentResourceContainer);
            DiscoveredResourceDetails result = proxy.discoverResource(pluginConfig, context);
            return result;
        } catch (TimeoutException te) {
            log.warn("Manual add of Resource of type [" + context.getResourceType() + "] with plugin configuration ["
                + pluginConfig.toString(true) + "] has been running for more than " + timeout
                + " milliseconds. This may be a plugin bug.", te);
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.