private static PropertyDefinitionSimple createExcludePath(boolean readOnly) { 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; }
private static PropertyDefinitionSimple createDescription(ConfigurationDefinition configDef) { String name = PROP_DESCRIPTION; String description = "A description of the drift detection definition or template"; boolean required = false; PropertySimpleType type = PropertySimpleType.STRING; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Drift Definition Description"); pd.setSummary(true); pd.setOrder(1); pd.setAllowCustomEnumeratedValue(false); pd.setConfigurationDefinition(configDef); return pd; }
private static PropertyDefinitionSimple createExcludePattern(boolean readOnly) { 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; }
private static List<PropertyDefinitionEnumeration> parsePropertyOptions(PropertyDefinitionSimple parentProperty, PropertyOptions options) { List<PropertyDefinitionEnumeration> results = new ArrayList<PropertyDefinitionEnumeration>(); for (Option option : options.getOption()) { String name = option.getName(); if (name == null) { name = option.getValue(); } PropertyDefinitionEnumeration enumeration = new PropertyDefinitionEnumeration(name, option.getValue()); parentProperty.addEnumeratedValues(enumeration); } parentProperty.setAllowCustomEnumeratedValue(options.isAllowCustomValue()); return results; }
private static PropertyDefinitionSimple createEnabled(ConfigurationDefinition configDef) { String name = PROP_ENABLED; String description = "Enables or disables the drift definition"; boolean required = true; PropertySimpleType type = PropertySimpleType.BOOLEAN; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Enabled"); pd.setReadOnly(false); pd.setSummary(true); pd.setOrder(2); pd.setAllowCustomEnumeratedValue(false); pd.setConfigurationDefinition(configDef); pd.setDefaultValue(String.valueOf(DEFAULT_ENABLED)); return pd; }
private static PropertyDefinitionSimple createInterval(ConfigurationDefinition configDef) { String name = PROP_INTERVAL; String description = "The frequency in seconds in which drift detection should run. Defaults to 1800 seconds (i.e. 30 minutes). This value must be" + "higher than (or equal to) agent's interval."; boolean required = false; PropertySimpleType type = PropertySimpleType.LONG; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Interval"); pd.setReadOnly(false); pd.setSummary(true); pd.setOrder(6); pd.setAllowCustomEnumeratedValue(false); pd.setConfigurationDefinition(configDef); pd.setDefaultValue(String.valueOf(DEFAULT_INTERVAL)); return pd; }
private static PropertyDefinitionSimple createBasedirValueName(boolean readOnly) { 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; }
private static PropertyDefinitionSimple createIncludePattern(boolean readOnly) { 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; }
private static PropertyDefinitionSimple createName(ConfigurationDefinition configDef, boolean readOnly) { String name = PROP_NAME; String description = "The drift detection definition name"; boolean required = true; PropertySimpleType type = PropertySimpleType.STRING; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Drift Definition Name"); pd.setReadOnly(readOnly); pd.setSummary(true); pd.setOrder(0); pd.setAllowCustomEnumeratedValue(false); pd.setConfigurationDefinition(configDef); RegexConstraint constraint = new RegexConstraint(); constraint.setDetails(PROP_NAME_REGEX_PATTERN); pd.addConstraints(constraint); return pd; }
private static PropertyDefinitionSimple createIncludePath(boolean readOnly) { 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; }