Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.Configuration


    public List<PluginConfigurationUpdate> getConfigurationUpdates() {
        return this.configurationUpdates;
    }

    public PluginConfigurationUpdate getPluginConfigurationUpdate(Resource updateTarget) {
        Configuration oldResourcePluginConfiguration = updateTarget.getPluginConfiguration();
        Configuration newResourcePluginConfiguration = getMergedConfiguration(oldResourcePluginConfiguration,
            this.configuration);
        PluginConfigurationUpdate update = new PluginConfigurationUpdate(updateTarget, newResourcePluginConfiguration,
            getSubjectName());
        return update;
    }
View Full Code Here


            getSubjectName());
        return update;
    }

    private Configuration getMergedConfiguration(Configuration base, Configuration changes) {
        Configuration results = base.deepCopy(false);

        merge(results, changes);

        return results;
    }
View Full Code Here

         *
         * (ips, 02/13/09): This is a temporary workaround - we don't really need to store a Configuration at all,
         *      since it can be recalculated from the member configs when needed, but the AbstractConfigurationUpdate
         *      base class requires the configuration field to be non-null.
         */
        this.configuration = new Configuration();
    }
View Full Code Here

    public void setDriftPlugins(Map<String, String> driftPlugins) {
        this.driftPlugins = driftPlugins;
    }

    public Configuration toConfiguration() {
        Configuration ret = new Configuration();
        for(Map.Entry<SystemSetting, String> e : entrySet()) {
            ret.put(new PropertySimple(e.getKey().getInternalName(), e.getValue()));
        }
       
        return ret;
    }
View Full Code Here

                return template.getConfiguration().deepCopy();
            }
        }

        // There is no default plugin config template defined - return an empty one.
        return new Configuration();
    }
View Full Code Here

        return allFiles;
    }

    protected Map<String, URL> getConfigFilesToSnapshot() throws Exception {
        Configuration config = getConfiguration();
        if (!"true".equals(config.getSimpleValue(PROP_SNAPSHOT_CONFIG_FILES, "false"))) {
            return null; // config files are not to be snapshotted into the report, abort
        }

        String baseDir = config.getSimpleValue(PROP_BASE_DIRECTORY, null);
        String confDir = config.getSimpleValue(PROP_CONFIG_DIRECTORY, "conf");
        String confRegex = config.getSimpleValue(PROP_CONFIG_REGEX, null);
        String recursive = config.getSimpleValue(PROP_CONFIG_RECURSIVE, "false");

        Map<String, URL> filesMap = null;

        File confDirFile = new File(confDir);
        if (!confDirFile.isAbsolute()) {
View Full Code Here

        return filesMap;
    }

    protected Map<String, URL> getLogFilesToSnapshot() throws Exception {
        Configuration config = getConfiguration();
        if (!"true".equals(config.getSimpleValue(PROP_SNAPSHOT_LOG_FILES, "false"))) {
            return null; // log files are not to be snapshotted into the report, abort
        }

        String baseDir = config.getSimpleValue(PROP_BASE_DIRECTORY, null);
        String logDir = config.getSimpleValue(PROP_LOG_DIRECTORY, "logs");
        String logRegex = config.getSimpleValue(PROP_LOG_REGEX, null);
        String recursive = config.getSimpleValue(PROP_LOG_RECURSIVE, "false");

        Map<String, URL> filesMap = null;

        File logDirFile = new File(logDir);
        if (!logDirFile.isAbsolute()) {
View Full Code Here

        for (File file : files) {
            String manifestVersion = null;
            JarFile jf = null;
            try {
                Configuration config = new Configuration();
                jf = new JarFile(file);

                Manifest manifest = jf.getManifest();

                if (manifest != null) {
                    Attributes attributes = manifest.getMainAttributes();

                    manifestVersion = attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);

                    config.put(new PropertySimple("version", manifestVersion));
                    config.put(new PropertySimple("title", attributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE)));
                    config.put(new PropertySimple("url", attributes.getValue(Attributes.Name.IMPLEMENTATION_URL)));
                    config
                        .put(new PropertySimple("vendor", attributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR)));

                    config.put(new PropertySimple("classpath", attributes.getValue(Attributes.Name.CLASS_PATH)));
                    config.put(new PropertySimple("sealed", attributes.getValue(Attributes.Name.SEALED)));
                }

                String sha256 = null;
                try {
                    sha256 = new MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(file);
View Full Code Here

        return filesMap;
    }

    protected Map<String, URL> getDataFilesToSnapshot() throws Exception {
        Configuration config = getConfiguration();
        if (!"true".equals(config.getSimpleValue(PROP_SNAPSHOT_DATA_FILES, "false"))) {
            return null; // data files are not to be snapshotted into the report, abort
        }

        String baseDir = config.getSimpleValue(PROP_BASE_DIRECTORY, null);
        String dataDir = config.getSimpleValue(PROP_DATA_DIRECTORY, "data");
        String dataRegex = config.getSimpleValue(PROP_DATA_REGEX, null);
        String recursive = config.getSimpleValue(PROP_DATA_RECURSIVE, "false");

        Map<String, URL> filesMap = null;

        File dataDirFile = new File(dataDir);
        if (!dataDirFile.isAbsolute()) {
View Full Code Here

        return filesMap;
    }

    protected Map<String, URL> getAdditionalFilesToSnapshot() throws Exception {
        Configuration config = getConfiguration();
        if (!"true".equals(config.getSimpleValue(PROP_SNAPSHOT_ADDITIONAL_FILES, "false"))) {
            return null; // any additional files are not to be snapshotted into the report, abort
        }

        String baseDir = config.getSimpleValue(PROP_BASE_DIRECTORY, null);
        PropertyList additionalList = config.getList(PROP_ADDITIONAL_FILES_LIST);
        if (additionalList == null || additionalList.getList() == null) {
            return null; // there are no additional files defined, just skip it
        }

        Map<String, URL> filesMap = new HashMap<String, URL>();
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.Configuration

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.