@Override public ConfigurationDefinition getImportConfigurationDefinition() { ConfigurationDefinition def = new ConfigurationDefinition("SystemSettingsConfiguration", null); PropertyDefinitionSimple props = new PropertyDefinitionSimple( PROPERTIES_TO_IMPORT_PROPERTY, "The names of the properties that should be imported. Note that these are the INTERNAL names as used in the RHQ database." + " If you include any property that stores a password (such as CAM_LDAP_BIND_PW)," + " you need to make sure the values are OBFUSCATED. You can obtain an obfuscated value of your" + " password by running the \"rhq-encode-password.(sh|bat)\" script located in the \"bin\" directory" + " of your RHQ server installation.", true, PropertySimpleType.STRING); props.setDefaultValue(DEFAULT_IMPORTED_PROPERTIES_LIST); def.put(props); ConfigurationUtility.initializeDefaultTemplate(def); return def; }
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 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 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; }
pdEnums.add(plannedEnum); pd.setEnumeratedValues(pdEnums, false); pd.setDefaultValue(DEFAULT_DRIFT_HANDLING_MODE.name());
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; }
"If set to true, all the metric templates will update all the existing schedules on corresponding resources.", true, PropertySimpleType.BOOLEAN); updateAllSchedules.setDefaultValue(Boolean.toString(UPDATE_SCHEDULES_DEFAULT)); def.put(updateAllSchedules);
existingPDS.setDefaultValue(newPDS.getDefaultValue());
property.setConstraints(translateContraints(simpleProperty.getConstraint())); property.setDisplayName(displayName); property.setDefaultValue(simpleProperty.getDefaultValue()); property.setUnits(MetricsMetadataParser.getMeasurementUnits(simpleProperty.getUnits(), null));