Package org.rhq.core.clientapi.agent.configuration

Examples of org.rhq.core.clientapi.agent.configuration.ConfigurationAgentService


        // .being made into the DefaultDS.xml file
        Resource platform = discoverPlatform();
        Resource defaultDs = findService("DefaultDS", SERVER_NAME, platform);

        PluginContainer pc = PluginContainer.getInstance();
        ConfigurationAgentService configService = pc.getConfigurationAgentService();

        Configuration configuration = configService.loadResourceConfiguration(defaultDs.getId());

        // Sanity check, to make sure jndi name is as we expect it
        assert configuration != null : "Configuration for Default DS was null";
        assert configuration.getSimple("jndi-name").getStringValue().equals("DefaultDS") : "Property jndiName was incorrect";

        // Change a value and update
        //configuration = configuration.deepCopy();
        configuration.put(new PropertySimple("jndi-name", "TestDS"));
        configuration.put(new PropertySimple("max-pool-size", "100"));
        ConfigurationUpdateRequest cur = new ConfigurationUpdateRequest(0, configuration, defaultDs.getId());

        configService.updateResourceConfiguration(cur);

        // Verify changes are in place
        configuration = configService.loadResourceConfiguration(defaultDs.getId());

        assert configuration.getSimple("jndi-name").getStringValue().equals("TestDS") : "Updated property jndiName was incorrect";
        assert configuration.getSimple("max-pool-size").getStringValue().equals("100") : "Updated property max-pool-size was incorrect";
        // Rollback changes (find a better way of doing this)
        configuration.put(new PropertySimple("jndi-name", "DefaultDS"));
        configuration.put(new PropertySimple("max-pool-size", "20"));
        cur.setConfiguration(configuration);
        configService.updateResourceConfiguration(cur);
    }
View Full Code Here


        platform = discoverPlatform();

        Resource testDs = findService(dsName, SERVER_NAME, platform);

        pc = PluginContainer.getInstance();
        ConfigurationAgentService configService = pc.getConfigurationAgentService();

        Configuration configuration = configService.loadResourceConfiguration(testDs.getId());

        assert configuration.getSimple("jndi-name").getStringValue().equals(dsName) : "Property jndi-name was incorrect";
        assert configuration.getSimple("connection-url").getStringValue().equals("jdbc:hsqldb:hsql://${jboss.bind.address}:1701")
                : "Property connection-url was incorrect";
        assert configuration.getSimple("user-name").getStringValue().equals("userJoe") : "Property user-name was incorrect";
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.agent.configuration.ConfigurationAgentService

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.