Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.Configuration.deepCopy()


            schedule.getOperationName(), false);

        // first we need to create an INPROGRESS history item
        Configuration parameters = schedule.getParameters();
        if (parameters != null) {
            parameters = parameters.deepCopy(false); // we need a copy to avoid constraint violations upon delete
        }

        ResourceOperationHistory history;
        history = new ResourceOperationHistory(jobName, jobGroup, schedule.getSubject().getName(), op, parameters,
            schedule.getResource(), groupHistory);
View Full Code Here


                configuration = notifConfig.deepCopy(true);
            } else {
                configuration = new Configuration(); // must not be null
            }
            if (notifExtraConfig != null) {
                extraConfiguration = notifExtraConfig.deepCopy(true);
            } else {
                extraConfiguration = null; // allowed to be null
            }
        } else {
            configuration = new Configuration();
View Full Code Here

                                parametersDefinition).isEmpty()) {
                                Message message = new Message(
                                    MSG.view_operationScheduleDetails_example_parameters_invalid(), Severity.Warning);
                                CoreGUI.getMessageCenter().notify(message);
                            } else {
                                operationParameters = exampleParameters.deepCopy(false);
                                break;
                            }
                        }
                    default:
                        operationParameters = (defaultTemplate != null) ? defaultTemplate.createConfiguration()
View Full Code Here

        Configuration config = subjectPreferences.get(subjectId);
        if (config == null) {
            return new Configuration();
        } else {
            return config.deepCopy();
        }
    }

    @Override
    @Lock(LockType.WRITE)
View Full Code Here

    @Test(dependsOnMethods = { "testDatasourceLoadConfiguration" })
    public void changingMaxPoolSizeShouldNotRequireDisablingTheDatasourceNorReloadingServer() throws Exception {
        Configuration configuration = pluginContainer.getConfigurationManager().loadResourceConfiguration(
            datasourceTestResource.getId());
        // Make a working copy
        configuration = configuration.deepCopy(false);
        // Change value
        PropertySimple propertySimple = configuration.getSimple("max-pool-size");
        Long currentMaxPoolSize = propertySimple.getLongValue();
        long newMaxPoolSize = currentMaxPoolSize == null ? 40 : currentMaxPoolSize + 1;
        propertySimple.setStringValue(String.valueOf(newMaxPoolSize));
View Full Code Here

        Configuration pluginConfig = upgradeContext.getPluginConfiguration();

        String quotingEnabledNeedsUpgrade = pluginConfig.getSimpleValue(QUOTING_ENABLED_NEEDS_UPGRADE);
        if (!FALSE.toString().equals(quotingEnabledNeedsUpgrade)) {

            pluginConfig = pluginConfig.deepCopy(false);

            Boolean quotingEnabled = Boolean.valueOf(pluginConfig.getSimpleValue(PLUGINCONFIG_QUOTING_ENABLED));
            pluginConfig.setSimpleValue(PLUGINCONFIG_QUOTING_ENABLED, quotingEnabled.toString());
            pluginConfig.setSimpleValue(QUOTING_ENABLED_NEEDS_UPGRADE, FALSE.toString());
View Full Code Here

        // Then update properties which can only be changed when datasource is in disabled state
        Configuration configuration = pluginContainer.getConfigurationManager().loadResourceConfiguration(
            datasourceTestResource.getId());
        assertFalse(Boolean.parseBoolean(configuration.getSimpleValue("enabled")), "");
        // Make a working copy
        configuration = configuration.deepCopy(false);
        // Change values
        PropertySimple propertySimple = configuration.getSimple("prepared-statements-cache-size");
        Long currentCacheSize = propertySimple.getLongValue();
        long newCacheSize = currentCacheSize == null ? 40 : currentCacheSize + 1;
        propertySimple.setStringValue(String.valueOf(newCacheSize));
View Full Code Here

        File xmlFile = getDSXmlFile(dsXmlFile);

        Configuration config = DatasourceConfigurationEditor.loadDatasource(xmlFile, datasourceName);
        assertLoadingOfConfiguration(config, datasourceName, testName);

        config = this.createConfiguration(config.deepCopy(), datasourceName);
        PropertySimple property = config.getSimple("max-pool-size");
        property.setIntegerValue(100);

        ConfigurationUpdateReport report = new ConfigurationUpdateReport(config);
View Full Code Here

        }
    }

    private Configuration createDatabaseSpecificConfig() {
        Configuration config = postgresServerComponent.getResourceContext().getPluginConfiguration();
        config = config.deepCopy();
        config.put(new PropertySimple("db", databaseName));
        if (LOG.isDebugEnabled()) {
            LOG.debug("Getting db specific connection to postgres for [" + databaseName + "] database");
        }
        return config;
View Full Code Here

        // Rename the JNDI name for that resource

        Configuration configuration = manager.getResourceConfiguration(datasource);
        assert configuration.getSimple("jndiName").getStringValue().equals("RHQDS") : "Incorrect configuration retrieved";

        configuration = configuration.deepCopy();
        configuration.getSimple("jndiName").setStringValue("NewDS");

        // Tell the manager to update the configuration

        manager.updateResource(datasource, configuration);
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.