Package org.rhq.core.pc.configuration

Examples of org.rhq.core.pc.configuration.ConfigurationManager.loadResourceConfiguration()


            Resource resourceUnderTest = unparsedResources.poll();

            addCommitedChildrenToCollection(unparsedResources, resourceUnderTest, ignoredResources);

            if (resourceUnderTest.getResourceType().getResourceConfigurationDefinition() != null) {
                Configuration configUnderTest = configManager.loadResourceConfiguration(resourceUnderTest.getId());

                ConfigurationUpdateRequest updateRequest = new ConfigurationUpdateRequest(1, configUnderTest,
                    resourceUnderTest.getId());
                ConfigurationUpdateResponse updateResponse = configManager
                    .executeUpdateResourceConfigurationImmediately(updateRequest);
View Full Code Here


            Resource moduleOptionsTypeResource = getModuleOptionTypeResource(attribute);
            //assert non-zero id returned
            assert moduleOptionsTypeResource.getId() != 0 : "The resource was not properly initialized. Expected id != 0";

            //Now request the resource complete with resource config
            Configuration loadedConfiguration = testConfigurationManager
                .loadResourceConfiguration(moduleOptionsTypeResource.getId());
            String code = null;
            String type = null;
            String flag = null;
            //populate the associated attributes if it's supported.
View Full Code Here

            Resource moduleOptionsResource = getModuleOptionsResource(moduleOptionsTypeResource, attribute);
            //assert non-zero id returned
            assert moduleOptionsResource.getId() != 0 : "The resource was not properly initialized. Expected id != 0";
            //fetch configuration for module options
            //Now request the resource complete with resource config
            Configuration loadedOptionsConfiguration = testConfigurationManager
                .loadResourceConfiguration(moduleOptionsResource.getId());
            for (String key : loadedOptionsConfiguration.getAllProperties().keySet()) {
                //retrieve the open map of Module Options
                PropertyMap map = ((PropertyMap) loadedOptionsConfiguration.getAllProperties().get(key));
                LinkedHashMap<String, Object> options = moduleOptionType.getOptions();
View Full Code Here

        Map<String, Configuration> configs = new HashMap<String, Configuration>();
       
        ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
       
        for(Resource sbs : getResources(sbsResourceType)) {
            Configuration config = configurationManager.loadResourceConfiguration(sbs.getId());
            String name = config.getSimpleValue("name", null);
            configs.put(name, config);
        }
        return configs;
    }
View Full Code Here

        ResourceFactoryManager resourceFactory = PluginContainer.getInstance().getResourceFactoryManager();
        ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
       
        for(Resource sbs : getResources(sbsResourceType)) {
            Configuration config = configurationManager.loadResourceConfiguration(sbs.getId());
            String name = config.getSimpleValue("name", null);
           
            Configuration originalConfiguration = originalBindingSets.get(name);
            if(originalConfiguration != null) {
                updateResourceConfiguration(sbs, originalConfiguration);
View Full Code Here

        if (supportsFacet(ConfigurationFacet.class) && getResourceType().getResourceConfigurationDefinition() != null) {
            ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
            Set<Resource> resources = getResources();
            for (Resource resource : resources) {
                try {
                    Configuration resourceConfig = configurationManager.loadResourceConfiguration(resource.getId());
                    // TODO: Validate the properties?
                } catch (Exception e) {
                    throw new Exception("Failed to load Resource config for " + resource + ".", e);
                }
            }
View Full Code Here

        configurationManager.updateResourceConfiguration(configurationUpdateRequest);

        //give the component and the managed resource some time to properly persist the update
        Thread.sleep(500);

        return configurationManager.loadResourceConfiguration(resource.getId());
    }

    protected static Configuration loadResourceConfiguration(Resource resource) throws Exception {
        ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
        return configurationManager.loadResourceConfiguration(resource.getId());
View Full Code Here

        return configurationManager.loadResourceConfiguration(resource.getId());
    }

    protected static Configuration loadResourceConfiguration(Resource resource) throws Exception {
        ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
        return configurationManager.loadResourceConfiguration(resource.getId());
    }

    private OperationDefinition getOperationDefinition(String name) {
        Set<OperationDefinition> operationDefinitions = getResourceType().getOperationDefinitions();
        OperationDefinition matchingOperationDefinition = null;
View Full Code Here

    public void testResourceConfigLoad() throws Exception {
        ConfigurationManager configurationManager = PluginContainer.getInstance().getConfigurationManager();
        Configuration resourceConfig;
        try {
            for (Resource resource : getResources()) {
                resourceConfig = configurationManager.loadResourceConfiguration(resource.getId());
                Configuration expectedResourceConfig = getExpectedResourceConfig();
                assert resourceConfig.equals(expectedResourceConfig) : "Unexpected Resource configuration - \nExpected:\n\t"
                    + expectedResourceConfig.toString(true) + "\nActual:\n\t" + resourceConfig.toString(true);
            }
        } catch (PluginContainerException e) {
View Full Code Here

            ConfigurationUpdateRequest updateRequest = new ConfigurationUpdateRequest(0, updatedResourceConfig,
                resource.getId());
            configurationManager.executeUpdateResourceConfigurationImmediately(updateRequest);

            if (isResourceConfigSupported()) {
                Configuration resourceConfig = configurationManager.loadResourceConfiguration(resource.getId());
                assert resourceConfig.equals(updatedResourceConfig) :
                        "Unexpected Resource configuration - \nExpected:\n\t"
                    + updatedResourceConfig.toString(true) + "\nActual:\n\t" + resourceConfig.toString(true);
            }
        }
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.