Package org.rhq.core.domain.configuration

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


        String startScript = this.pluginConfig.getSimpleValue(START_SCRIPT_PROP);
        return (startScript != null) ? new File(startScript) : null;
    }

    public void setStartScript(File startScript) {
        PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_PROP);
        if (prop == null) {
            prop = new PropertySimple(START_SCRIPT_PROP, null);
            this.pluginConfig.put(prop);
        }
        prop.setValue(startScript);
    }
View Full Code Here


        this.pluginConfig.setSimpleValue(START_SCRIPT_PREFIX_PROP, startScriptPrefix);
    }

    @NotNull
    public Map<String, String> getStartScriptEnv() {
        PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ENV_PROP);
        Map<String, String> map = (prop != null) ? new MapPropertySimpleWrapper(prop).getValue()
            : new HashMap<String, String>();
        return map;
    }
View Full Code Here

            : new HashMap<String, String>();
        return map;
    }

    public void setStartScriptEnv(Map<String, String> startScriptEnv) {
        PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ENV_PROP);
        if (prop == null) {
            prop = new PropertySimple(START_SCRIPT_ENV_PROP, null);
            this.pluginConfig.put(prop);
        }

        try {
            new MapPropertySimpleWrapper(prop).setValue(startScriptEnv);
View Full Code Here

        }
    }

    @NotNull
    public List<String> getStartScriptArgs() {
        PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ARGS_PROP);
        List<String> list = (prop != null) ? new ArgsPropertySimpleWrapper(prop).getValue() : new ArrayList<String>();
        return list;
    }
View Full Code Here

        List<String> list = (prop != null) ? new ArgsPropertySimpleWrapper(prop).getValue() : new ArrayList<String>();
        return list;
    }

    public void setStartScriptArgs(List<String> startScriptArgs) {
        PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ARGS_PROP);
        if (prop == null) {
            prop = new PropertySimple(START_SCRIPT_ARGS_PROP, null);
            this.pluginConfig.put(prop);
        }

        try {
            new ArgsPropertySimpleWrapper(prop).setValue(startScriptArgs);
View Full Code Here

            .getPropertyDefinitionList(listName).getMemberDefinition();
        String mapName = mapDefinition.getName();
        PropertyMap newMap = new PropertyMap(mapName);
        for (PropertyDefinition mapMemberDefinition : mapDefinition.getOrderedPropertyDefinitions()) {
            PropertyDefinitionSimple simpleDefinition = (PropertyDefinitionSimple) mapMemberDefinition;
            newMap.put(new PropertySimple(simpleDefinition.getName(), (simpleDefinition.isRequired()) ? "" : null));
        }

        PropertyList list = config.getConfiguration().getList(listName);
        list.add(newMap);
        return list.getList().size() - 1;
View Full Code Here

        File subsubconfigDir = writeDirectory(subconfigDir, "subsubconfig");
        writeFile(subsubconfigDir, "subsubone.config", "subsubconfig 1 file");

        Configuration config = new Configuration();
        config.put(new PropertySimple(SnapshotReport.PROP_BASE_DIRECTORY, baseDir.getAbsolutePath()));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_CONFIG_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_LOG_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_DATA_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_ADDITIONAL_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_DIRECTORY, configDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_DIRECTORY, logDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_DIRECTORY, dataDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_REGEX, ".*\\.config"));
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_REGEX, ".*\\.log"));
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_REGEX, ".*\\.dat"));
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_RECURSIVE, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_RECURSIVE, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_RECURSIVE, "true"));

        String dir1 = additionalDir1.getName();

        PropertyList additionalList = new PropertyList(SnapshotReport.PROP_ADDITIONAL_FILES_LIST);
        PropertyMap additionalFiles1 = new PropertyMap("map");
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_DIRECTORY, dir1));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_REGEX, ".*\\.txt"));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_RECURSIVE, "true"));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_ADDITIONAL_FILES, "true"));
        config.put(additionalList);
        additionalList.add(additionalFiles1);

        SnapshotReport report = new SnapshotReport("test-snapshot", "some desc", config);
        File snapshot = report.generate();
View Full Code Here

        File subsubconfigDir = writeDirectory(subconfigDir, "subsubconfig");
        writeFile(subsubconfigDir, "subsubone.config", "subsubconfig 1 file");

        Configuration config = new Configuration();
        config.put(new PropertySimple(SnapshotReport.PROP_BASE_DIRECTORY, baseDir.getAbsolutePath()));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_CONFIG_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_LOG_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_DATA_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_ADDITIONAL_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_DIRECTORY, configDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_DIRECTORY, logDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_DIRECTORY, dataDir.getName())); // relative path
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_REGEX, ".*\\.config"));
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_REGEX, ".*\\.log"));
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_REGEX, ".*\\.dat"));
        config.put(new PropertySimple(SnapshotReport.PROP_CONFIG_RECURSIVE, "false"));
        config.put(new PropertySimple(SnapshotReport.PROP_LOG_RECURSIVE, "false"));
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_RECURSIVE, "false"));

        String dir1 = additionalDir1.getName();

        PropertyList additionalList = new PropertyList(SnapshotReport.PROP_ADDITIONAL_FILES_LIST);
        PropertyMap additionalFiles1 = new PropertyMap("map");
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_DIRECTORY, dir1));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_REGEX, ".*\\.txt"));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_ADDITIONAL_FILES_RECURSIVE, "false"));
        additionalFiles1.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_ADDITIONAL_FILES, "true"));
        config.put(additionalList);
        additionalList.add(additionalFiles1);

        SnapshotReport report = new SnapshotReport("test-snapshot", "some desc", config);
        File snapshot = report.generate();
View Full Code Here

        File tmpDir = new File(System.getProperty("java.io.tmpdir"), "SNAPSHOT_TMP");
        tmpDir.mkdirs();

        try {
            Configuration config = new Configuration();
            config.put(new PropertySimple(SnapshotReport.PROP_REPORT_OUTPUT_DIRECTORY, tmpDir.getAbsolutePath()));

            SnapshotReport report = new SnapshotReport("test-snapshot", "some desc", config);
            File snapshot = report.generate();
            try {
                assert snapshot.getParentFile().equals(tmpDir);
View Full Code Here

        writeFile(configDir, "one.config", "config 1 file");
        writeFile(logDir, "first.log", "log 1 file");
        writeFile(dataDir, "data.dat", "this is a data file");

        Configuration config = new Configuration();
        config.put(new PropertySimple(SnapshotReport.PROP_BASE_DIRECTORY, baseDir.getAbsolutePath()));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_CONFIG_FILES, "false"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_LOG_FILES, "false"));
        config.put(new PropertySimple(SnapshotReport.PROP_SNAPSHOT_DATA_FILES, "true"));
        config.put(new PropertySimple(SnapshotReport.PROP_DATA_DIRECTORY, dataDir.getName())); // relative path

        SnapshotReport report = new SnapshotReport("test-snapshot", "some desc", config);
        File snapshot = report.generate();
        try {
            FileInputStream fis = new FileInputStream(snapshot);
View Full Code Here

TOP

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

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.