Package org.rhq.core.domain.configuration.definition

Examples of org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple


        String name = PROP_BASEDIR_VALUECONTEXT;
        String description = "Identifies where the named value can be found.";
        boolean required = true;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Value Context");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(0);

        PropertyDefinitionEnumeration pcEnum = new PropertyDefinitionEnumeration(
            BaseDirValueContext.pluginConfiguration.name(), BaseDirValueContext.pluginConfiguration.name());
        pcEnum.setOrderIndex(0);

        PropertyDefinitionEnumeration rcEnum = new PropertyDefinitionEnumeration(
            BaseDirValueContext.resourceConfiguration.name(), BaseDirValueContext.resourceConfiguration.name());
        rcEnum.setOrderIndex(1);

        PropertyDefinitionEnumeration mtEnum = new PropertyDefinitionEnumeration(BaseDirValueContext.measurementTrait
            .name(), BaseDirValueContext.measurementTrait.name());
        mtEnum.setOrderIndex(2);

        PropertyDefinitionEnumeration fsEnum = new PropertyDefinitionEnumeration(BaseDirValueContext.fileSystem.name(),
            BaseDirValueContext.fileSystem.name());
        fsEnum.setOrderIndex(3);

        ArrayList<PropertyDefinitionEnumeration> pdEnums = new ArrayList<PropertyDefinitionEnumeration>(4);
        pdEnums.add(pcEnum);
        pdEnums.add(rcEnum);
        pdEnums.add(mtEnum);
        pdEnums.add(fsEnum);
        pd.setEnumeratedValues(pdEnums, false);

        return pd;
    }
View Full Code Here


        String name = PROP_BASEDIR_VALUENAME;
        String description = "The name of the value as found in the context.";
        boolean required = true;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Value Name");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(1);
        pd.setAllowCustomEnumeratedValue(false);

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_BASEDIR_PATH_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

    private static PropertyDefinitionMap createInclude(boolean readOnly) {
        String name = PROP_INCLUDES_INCLUDE;
        String description = "A pattern that specifies a file or directory to include.";
        boolean required = true;

        PropertyDefinitionSimple path = createIncludePath(readOnly);
        PropertyDefinitionSimple pattern = createIncludePattern(readOnly);

        PropertyDefinitionMap pd = new PropertyDefinitionMap(name, description, required, path, pattern);
        pd.setDisplayName("Include");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
View Full Code Here

        String name = PROP_PATH;
        String description = "A file system directory path that is relative to (a sub-directory of) the base directory of the drift definition. The default is '.', the base directory itself.  Note that '/' and './' will be normalized to '.' for consistent handling.";
        boolean required = false;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Path");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(0);
        pd.setAllowCustomEnumeratedValue(false);
        pd.setDefaultValue(".");

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_FILTER_PATH_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

        String name = PROP_PATTERN;
        String description = "Pathname pattern that must match for the items in the directory path to be included. '*' matches zero or more characters, '?' matches one character. For example, '*.txt' (no quotes) will match text files in the filter's path directory.  '**/*.txt' will match text files in any subdirectory below the filter's path directory.";
        boolean required = false;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Pattern");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(1);
        pd.setAllowCustomEnumeratedValue(false);

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_FILTER_PATTERN_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

    private static PropertyDefinitionMap createExclude(boolean readOnly) {
        String name = PROP_EXCLUDES_EXCLUDE;
        String description = "A pattern that specifies a file or directory to exclude.";
        boolean required = true;

        PropertyDefinitionSimple path = createExcludePath(readOnly);
        PropertyDefinitionSimple pattern = createExcludePattern(readOnly);

        PropertyDefinitionMap pd = new PropertyDefinitionMap(name, description, required, path, pattern);
        pd.setDisplayName("Exclude");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
View Full Code Here

        String name = PROP_PATH;
        String description = "A file system directory path that is relative to (a sub-directory of) the base directory of the drift definition. The default is '.', the base directory itself.  Note that '/' and './' will be normalized to '.' for consistent handling.";
        boolean required = true;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Path");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(0);
        pd.setAllowCustomEnumeratedValue(false);
        return pd;
    }
View Full Code Here

        String name = PROP_PATTERN;
        String description = "Pathname pattern that must match for the items in the directory path to be excluded.";
        boolean required = false;
        PropertySimpleType type = PropertySimpleType.STRING;

        PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type);
        pd.setDisplayName("Pattern");
        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(1);
        pd.setAllowCustomEnumeratedValue(false);
        return pd;
    }
View Full Code Here

                        PropertyMap listMap = new PropertyMap(listMemberDefinitionMap.getName());
                        createDefaultProperty(listMemberDefinitionMap, listMap);
                        ((PropertyList) property).add(listMap);
                    } else if (listMemberPropertyDefinition instanceof PropertyDefinitionSimple) {
                        // member property is a simple, create a single list entry as its default if appropriate
                        PropertyDefinitionSimple listMemberDefinitionSimple = (PropertyDefinitionSimple) listMemberPropertyDefinition;
                        String defaultValue = listMemberDefinitionSimple.getDefaultValue();
                        if (defaultValue != null || listMemberDefinitionSimple.isRequired()) {
                            PropertySimple listSimple = new PropertySimple(listMemberDefinitionSimple.getName(),
                                defaultValue);
                            ((PropertyList) property).add(listSimple);
                        }
                    }
                }
View Full Code Here

        PropertyDefinitionMap mapDefinition = (PropertyDefinitionMap) config.getConfigurationDefinition()
            .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

TOP

Related Classes of org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple

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.