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

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


            throw new PermissionException("User [" + subject.getName()
                + "] does not have permission to view resource configuration for [" + resource + "]");
        }
        Agent agent = resource.getAgent();
        AgentClient agentClient = this.agentManager.getAgentClient(agent);
        ConfigurationAgentService configService = agentClient.getConfigurationAgentService();
        return configService.validate(configuration, resourceId, isStructured);
    }
View Full Code Here


        }

        try {
            Agent agent = resource.getAgent();
            AgentClient agentClient = this.agentManager.getAgentClient(agent);
            ConfigurationAgentService configService = agentClient.getConfigurationAgentService();

            return configService.merge(configuration, resourceId, fromStructured);
        } catch (PluginContainerException e) {
            LOG.error("An error occurred while trying to translate the configuration.", e);
            return null;
        }
    }
View Full Code Here

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());

        final Query query = context.mock(Query.class);
View Full Code Here

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());

        final Query query = context.mock(Query.class);
View Full Code Here

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());
        expectedUpdate.setId(-1);

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());

        final Sequence configUdpate = context.sequence("structured-config-update");
View Full Code Here

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            translatedConfig, fixture.subject.getName());
        expectedUpdate.setId(-1);

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());

        final Sequence configUdpate = context.sequence("raw-config-update");
View Full Code Here

    @Test
    public void translatingFromStructuredToRawShouldReturnModifiedConfig() throws Exception {
        final ConfigTranslationFixture fixture = newStructuredAndRawTranslationFixture();

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final Configuration expectedConfig = new Configuration();

        context.checking(new Expectations() {
            {
View Full Code Here

    @Test
    public void translatingFromRawToStructuredShouldReturnModifiedConfig() throws Exception {
        final ConfigTranslationFixture fixture = newStructuredAndRawTranslationFixture();

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final Configuration expectedConfig = new Configuration();

        context.checking(new Expectations() {
            {
View Full Code Here

    public void testDump()
            throws Exception
    {
        LOG.info("########################  Running testDump()");
        PluginContainer pc = PluginContainer.getInstance();
        ConfigurationAgentService configService = pc.getConfigurationAgentService();

        Resource platform = discoverPlatform();

        LOG.info("Loaded Servers");
        for (Resource server : platform.getChildResources())
        {
            String serverName = server.getName();
            LOG.info("Server: " + serverName);

            for (Resource service : server.getChildResources())
            {
                LOG.info("   Service: " + service.getName());

                Configuration serviceConfig = configService.loadResourceConfiguration(service.getId());
                logConfiguration(serviceConfig, "     ");
            }
        }
    }
View Full Code Here

        // This only tests a datasource, will need to test other service types
        Resource defaultDs = findService("DefaultDS", SERVER_NAME, platform);


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

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

        assert configuration != null : "Configuration for DefaultDS was null";

        assert configuration.getSimple("jndi-name").getStringValue().equals("DefaultDS") : "Property jndi-name was incorrect";
        assert configuration.getSimple("connection-url").getStringValue().equals("jdbc:hsqldb:hsql://${jboss.bind.address}:1701")
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.