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 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 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 createAttached(ConfigurationDefinition configDef, boolean readOnly) { String name = PROP_ATTACHED; String description = "A flag that indicates whether or not the definition is attached to the template from " + "which it is created. When a template is updated, the changes will be propagated to any attached " + "definitions. Furthermore, if you pin an existing template to a snapshot, then attached definitions will " + "become pinned as well. Finally, if you delete a template, attached definitions will also be deleted."; boolean required = true; PropertySimpleType type = PropertySimpleType.BOOLEAN; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Attached to Template"); pd.setDefaultValue("true"); pd.setOrder(3); pd.setReadOnly(readOnly); pd.setConfigurationDefinition(configDef); return pd; }
private static PropertyDefinitionSimple createPinned(ConfigurationDefinition configDef, boolean readOnly) { String name = PROP_PINNED; String description = "If set, pins the snapshot that the agent uses for comparing files during drift " + "detection. Normally, the agent compares those files being monitored for drift against the latest " + "snapshot. If you pin a snapshot, the agent will use that pinned version to compare against files " + "being monitored for drift"; boolean required = true; PropertySimpleType type = PropertySimpleType.BOOLEAN; PropertyDefinitionSimple pd = new PropertyDefinitionSimple(name, description, required, type); pd.setDisplayName("Pinned"); pd.setDefaultValue("false"); pd.setOrder(5); pd.setReadOnly(readOnly); pd.setConfigurationDefinition(configDef); 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 createBasedirValueContext(boolean readOnly) { 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; }
pd.setReadOnly(false); pd.setSummary(true); pd.setOrder(4);
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; }
simpleProperty.isRequired(), translatePropertyType(simpleProperty.getType())); property.setReadOnly(simpleProperty.isReadOnly()); property.setSummary(simpleProperty.isSummary()); property.setActivationPolicy(translateActivationPolicy(simpleProperty.getActivationPolicy()));