Package org.rhq.core.domain.configuration.definition

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition


            // with the bundle resource type
            ResourceType resourceType = new ResourceType(TEST_PREFIX + "-platform-" + System.currentTimeMillis(),
                "test", ResourceCategory.PLATFORM, null);

            // we need to make this test type bundle targetable
            ConfigurationDefinition pcDef = new ConfigurationDefinition(TEST_PREFIX + "-testdef", "bundle test");
            PropertyDefinitionSimple propDef = new PropertyDefinitionSimple(TEST_BUNDLE_DESTBASEDIR_PROP, "", true,
                PropertySimpleType.STRING);
            propDef.setDisplayName(TEST_BUNDLE_DESTBASEDIR_PROP);
            pcDef.put(propDef);
            em.persist(pcDef);

            ResourceTypeBundleConfiguration rtbc = new ResourceTypeBundleConfiguration(new Configuration());
            rtbc.addBundleDestinationBaseDirectory(TEST_DESTBASEDIR_NAME,
                ResourceTypeBundleConfiguration.BundleDestinationBaseDirectory.Context.pluginConfiguration.name(),
View Full Code Here


        Set<String> seen = new HashSet<String>(2); // we use to this remember names of the things that we've seen

        assert resourceType.getChildSubCategories() == null;

        seen.clear();
        ConfigurationDefinition pcDef = resourceType.getPluginConfigurationDefinition();
        assert pcDef.getGroupDefinitions().size() == 2;
        for (PropertyGroupDefinition group : pcDef.getGroupDefinitions()) {
            seen.add(group.getName());
            if (group.getName().equals(CHANGED_PC_GROUP)) {
                assert group.isDefaultHidden() == CHANGED_PC_GROUP_HIDDEN;
            } else if (group.getName().equals(NEW_PC_GROUP)) {
                assert group.isDefaultHidden() == NEW_PC_GROUP_HIDDEN;
            } else {
                assert false : "Unexpected group [" + group.getName() + "]:" + group;
            }
        }
        if (seen.size() != 2) {
            assert false : "did not see what we expected to see: " + seen;
        }

        prop = pcDef.get(CHANGED_PC_PROP);
        assert prop != null;
        assert prop.getName().equals(CHANGED_PC_PROP);
        assert prop.isRequired() == CHANGED_PC_PROP_REQUIRED;
        assert prop.getPropertyGroupDefinition().getName().equals(CHANGED_PC_GROUP);
        prop = pcDef.get(NEW_PC_PROP);
        assert prop != null;
        assert prop.getName().equals(NEW_PC_PROP);
        assert prop.isRequired() == NEW_PC_PROP_REQUIRED;
        assert prop.getPropertyGroupDefinition().getName().equals(NEW_PC_GROUP);
View Full Code Here

            Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
            title.setHeight(27);
            parametersSection.addMember(title);

            OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
            ConfigurationDefinition parametersConfigurationDefinition = operationDefinition
                .getParametersConfigurationDefinition();
            if (parametersConfigurationDefinition != null
                && !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
                ConfigurationEditor editor = new ConfigurationEditor(parametersConfigurationDefinition,
                    operationHistory.getParameters());
                editor.setReadOnly(true);
                parametersSection.addMember(editor);
            } else {
View Full Code Here

    }

    @Override
    public ConfigurationDefinition getServerPluginConfigurationDefinition(PluginKey pluginKey) throws RuntimeException {
        try {
            ConfigurationDefinition def;
            def = serverPluginManager.getServerPluginConfigurationDefinition(pluginKey);
            return def;
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

    }

    @Override
    public ConfigurationDefinition getServerPluginScheduledJobsDefinition(PluginKey pluginKey) throws RuntimeException {
        try {
            ConfigurationDefinition def;
            def = serverPluginManager.getServerPluginScheduledJobsDefinition(pluginKey);
            return def;
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

    @Override
    public void createResource(int parentResourceId, int newResourceTypeId, String newResourceName,
        Configuration newResourceConfiguration, Integer timeout) throws RuntimeException {
        try {
            ConfigurationDefinition pluginConfigDefinition = LookupUtil.getConfigurationManager()
                .getPluginConfigurationDefinitionForResourceType(getSessionSubject(), newResourceTypeId);
            Configuration pluginConfig = null;
            if (pluginConfigDefinition != null) {
                ConfigurationTemplate pluginConfigTemplate = pluginConfigDefinition.getDefaultTemplate();
                pluginConfig = (pluginConfigTemplate != null) ? pluginConfigTemplate.createConfiguration()
                    : new Configuration();

                // TODO GH: Is this still necessary now that we don't blow up on non-normalized configs
                // ConfigurationUtility.normalizeConfiguration(pluginConfig, pluginConfigDefinition);
View Full Code Here

    @Override
    public void createResource(int parentResourceId, int newResourceTypeId, String newResourceName,
        Configuration deploymentTimeConfiguration, int packageVersionId, Integer timeout) throws RuntimeException {
        try {
            ConfigurationDefinition pluginConfigDefinition = LookupUtil.getConfigurationManager()
                .getPluginConfigurationDefinitionForResourceType(getSessionSubject(), newResourceTypeId);
            Configuration pluginConfig = null;
            if (pluginConfigDefinition != null) {
                ConfigurationTemplate pluginConfigTemplate = pluginConfigDefinition.getDefaultTemplate();
                pluginConfig = (pluginConfigTemplate != null) ? pluginConfigTemplate.createConfiguration()
                    : new Configuration();

                // TODO GH: Is this still necessary now that we don't blow up on non-normalized configs
                // ConfigurationUtility.normalizeConfiguration(pluginConfig, pluginConfigDefinition);
View Full Code Here

        protected ServerPlugin getPlugin(ServerPluginEnvironment env) {

            try {
                Configuration pluginConfig = null;
                Configuration scheduledJobsConfig = null;
                ConfigurationDefinition configDef;

                ServerPluginDescriptorType pluginDescriptor = env.getPluginDescriptor();

                configDef = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(pluginDescriptor);
                if (configDef != null) {
                    pluginConfig = configDef.getDefaultTemplate().createConfiguration();
                }

                configDef = ServerPluginDescriptorMetadataParser.getScheduledJobsDefinition(pluginDescriptor);
                if (configDef != null) {
                    scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
                }

                File pluginFile = new File(env.getPluginUrl().toURI());
                ServerPlugin plugin = new ServerPlugin(0, env.getPluginKey().getPluginName(), pluginFile.getName(),
                    pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED, pluginDescriptor
View Full Code Here

        return doParseRecipe(recipe);
    }

    protected RecipeParseResults doParseRecipe(String recipe) throws UnknownRecipeException, Exception {

        ConfigurationDefinition configDef;
        Set<String> bundleFileNames;
        DeploymentProperties metadata;

        metadata = new DeploymentProperties(0, "bundletest", "1.0", "bundle test description");

        configDef = new ConfigurationDefinition("bundletest-configdef", "Test Config Def for testing BundleVersion");
        configDef.put(new PropertyDefinitionSimple("bundletest.property",
            "Test property for BundleVersion Config Def testing", true, PropertySimpleType.STRING));

        bundleFileNames = new HashSet<String>();
        for (int i = 0; i < AbstractEJB3Test.DEFAULT_CRITERIA_PAGE_SIZE + 2; i++) {
            bundleFileNames.add("bundletest-bundlefile-" + i);
View Full Code Here

            vLayout.setOverflow(Overflow.AUTO);

            // keep a reference to the startingConfig in case the user navs back and changes it
            startingConfig = wizard.getNewStartingConfiguration();
            ConfigurationDefinition def = getDriftConfigDef();
            editor = new ConfigurationEditor(def, startingConfig);
            vLayout.addMember(editor);
        }

        return vLayout;
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

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.