Package org.rhq.core.pluginapi.configuration

Examples of org.rhq.core.pluginapi.configuration.ResourceConfigurationFacet


            }
    }

    public void executeUpdate(int resourceId, Configuration configuration) throws PluginContainerException {
        try {
            ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);
            facet.validateStructuredConfiguration(configuration);
            facet.persistStructuredConfiguration(configuration);
        }
        catch (Throwable t) {
            throw new ConfigurationUpdateException(t.getMessage());
        }
    }
View Full Code Here


        // TODO Throw an exception if the resource does not support structured and raw

        boolean daemonOnly = true;
        boolean onlyIfStarted = true;

        ResourceConfigurationFacet facet = componentService.getComponent(resourceId, ResourceConfigurationFacet.class,
            FacetLockType.READ, FACET_METHOD_TIMEOUT, daemonOnly, onlyIfStarted);

        if (fromStructured) {
            mergedStructuredIntoRaws(configuration, facet);
        } else {
View Full Code Here

        boolean success = true;

        boolean daemonOnly = true;
        boolean onlyIfStarted = true;
        ResourceConfigurationFacet facet = componentService.getComponent(resourceId, ResourceConfigurationFacet.class,
            FacetLockType.READ, FACET_METHOD_TIMEOUT, daemonOnly, onlyIfStarted);
        if (isStructured) {
            try {
                facet.validateStructuredConfiguration(configuration);
            } catch (IllegalArgumentException e) {
                success = false;
            } catch (Throwable t) {
                throw new PluginContainerException(t.getMessage(), t);
            }
        } else {
            for (RawConfiguration rawConfiguration : configuration.getRawConfigurations()) {
                try {
                    facet.validateRawConfiguration(rawConfiguration);
                } catch (IllegalArgumentException e) {
                    success = false;
                    rawConfiguration.errorMessage = e.getMessage();
                } catch (Throwable t) {
                    success = false;
View Full Code Here

public class StructuredAndRawConfigManagement extends ConfigManagementSupport {

    private final Log log = LogFactory.getLog(StructuredAndRawConfigManagement.class);

    public Configuration executeLoad(int resourceId) throws PluginContainerException {
        ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId);

        Configuration configuration = facet.loadStructuredConfiguration();
        Set<RawConfiguration> rawConfigs = facet.loadRawConfigurations();

        if (configuration == null && rawConfigs == null) {
            return null;
        }
View Full Code Here

                + resourceType.getPlugin() + " plugin - " + errorMessage);
            }
    }

    public void executeUpdate(int resourceId, Configuration configuration) throws PluginContainerException {
        ResourceConfigurationFacet facet = loadResourceConfigFacetWithWriteLock(resourceId);

        StringBuilder errors = new StringBuilder();

        try {
            facet.validateStructuredConfiguration(configuration);
            facet.persistStructuredConfiguration(configuration);
        }
        catch (Throwable t) {
            errors.append(t.getMessage());
        }

        for (RawConfiguration rawConfig : configuration.getRawConfigurations()) {
            try {
                facet.validateRawConfiguration(rawConfig);
                facet.persistRawConfiguration(rawConfig);
            }
            catch (Throwable t) {
                errors.append(t.getMessage()).append("\n\n");
            }
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.configuration.ResourceConfigurationFacet

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.