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 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; }
pd.setSummary(true); pd.setOrder(4); pd.setConfigurationDefinition(configDef);
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; }