Package org.rhq.core.clientapi.descriptor.configuration

Examples of org.rhq.core.clientapi.descriptor.configuration.ConfigurationDescriptor


        type.setDiscoveryInterval(descriptor.getDiscoveryInterval());

        type.setCreationData(descriptor.isIsCreationType());

        ConfigurationDescriptor configurationDescriptor = descriptor.getConfiguration();
        ConfigurationDefinition configurationDefinition = ConfigurationMetadataParser.parse(descriptor.getName(),
            configurationDescriptor);
        type.setDeploymentConfigurationDefinition(configurationDefinition);

        return type;
View Full Code Here


        try {
            AlertPluginDescriptorType descriptor = (AlertPluginDescriptorType) serverPluginsBean
                .getServerPluginDescriptor(key);
            //ConfigurationDefinition pluginConfigurationDefinition = ConfigurationMetadataParser.parse("pc:" + pluginName, descriptor.getPluginConfiguration());
            ConfigurationDescriptor alertConfiguration = descriptor.getAlertConfiguration();
            if (alertConfiguration==null || alertConfiguration.getConfigurationProperty()== null || alertConfiguration.getConfigurationProperty().isEmpty()) {
                // User either provided no <alert-configuration> or an empty one
                return new ConfigurationDefinition("alerts:"+pluginName,"No properties given");
            }
            else {
                ConfigurationDefinition pluginConfigurationDefinition = ConfigurationMetadataParser.parse("alerts:"
View Full Code Here

        assert pluginComponent.getClazz().equals("alertPluginComponent");

        assert descriptor.getScheduledJobs() == null;
        assert ServerPluginDescriptorMetadataParser.getScheduledJobs(descriptor).size() == 0;

        ConfigurationDescriptor configDescriptor = descriptor.getPluginConfiguration();
        assert configDescriptor != null;
        assert configDescriptor.getConfigurationProperty().get(0).getValue().getName().equals("alertprop1");

        ConfigurationDefinition config;
        config = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(descriptor);
        assert config != null;
        assert config.getPropertyDefinitionSimple("alertprop1") != null;
View Full Code Here

        // check the validity of the additional bundle schema elements
        assert descriptor.getBundle().getType().equals("bundle.type.name");

        // check the validity of the plugin config definition
        ConfigurationDescriptor pluginConfigXml = descriptor.getPluginConfiguration();
        assert pluginConfigXml != null : "should have parsed the plugin config";
        ConfigurationDefinition configDef = ConfigurationMetadataParser.parse("test", pluginConfigXml);
        assert configDef != null : "should have parsed the plugin config properties";
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("bundleprop1");
        assert propDef != null : "missing a simple property definition";
View Full Code Here

            }
        }

        private static PropertyDefinition convert(ConfigurationProperty def) {
            try {
                ConfigurationDescriptor tmp = new ConfigurationDescriptor();
                tmp.getConfigurationProperty().add(
                    new JAXBElement<ConfigurationProperty>(getTagName(def), ConfigurationProperty.class, def));
                ConfigurationDefinition configDef = ConfigurationMetadataParser.parse("null", tmp);

                return configDef.getPropertyDefinitions().values().iterator().next();
            } catch (InvalidPluginDescriptorException e) {
View Full Code Here

                    String displayName = descriptorDef.getDisplayName();
                    String description = descriptorDef.getDescription();
                    ConfigurationDefinition params = null;
                    ConfigurationDefinition results = null;

                    ConfigurationDescriptor xml = descriptorDef.getParameters();
                    if (xml != null) {
                        params = ConfigurationMetadataParser.parse(descriptorDef.getName() + "_params", xml);
                    }
                    xml = descriptorDef.getResults();
                    if (xml != null) {
View Full Code Here

     */
    public static ConfigurationDefinition getPluginConfigurationDefinition(ServerPluginDescriptorType descriptor)
        throws Exception {

        ConfigurationDefinition config = null;
        ConfigurationDescriptor configXml = descriptor.getPluginConfiguration();
        if (configXml != null) {
            config = ConfigurationMetadataParser.parse(descriptor.getName(), configXml);
        }
        return config;
    }
View Full Code Here

     */
    public static ConfigurationDefinition getScheduledJobsDefinition(ServerPluginDescriptorType descriptor)
        throws Exception {

        ConfigurationDefinition config = null;
        ConfigurationDescriptor configXml = descriptor.getScheduledJobs();
        if (configXml != null) {
            config = ConfigurationMetadataParser.parse(descriptor.getName(), configXml);
        }
        return config;
    }
View Full Code Here

     * @throws Exception if the plugin descriptor was invalid
     */
    public static List<ScheduledJobDefinition> getScheduledJobs(ServerPluginDescriptorType descriptor) throws Exception {
        List<ScheduledJobDefinition> jobs = new ArrayList<ScheduledJobDefinition>();

        ConfigurationDescriptor configXml = descriptor.getScheduledJobs();
        if (configXml != null) {
            ConfigurationDefinition config = ConfigurationMetadataParser.parse(descriptor.getName(), configXml);
            for (PropertyDefinition propDef : config.getPropertyDefinitions().values()) {
                ScheduledJobDefinition jobDef = getScheduledJob(propDef);
                if (jobDef != null) {
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.descriptor.configuration.ConfigurationDescriptor

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.