private void setPropertyError(Object rawPropValue, PropertySimple prop) { prop.setErrorMessage("The discovered value of this property was longer than " + PropertySimple.MAX_VALUE_LENGTH + " characters (the maximum length of an RHQ property). It has been left unset. Please see the Agent log for the full value."); log.warn("The discovered value for property [" + prop.getName() + "] was too long and was left unset. It is logged here for reference: " + rawPropValue); }
/** * Return a value object for the passed property. The type is determined by looking at the operation definition * @param prop Property to evaluate * @param operationName Name of the operation to look at * @return Value or null on failure */ Object getObjectForProperty(PropertySimple prop, String operationName) { ConfigurationDefinition parameterDefinitions = getParameterDefinitionsForOperation(operationName); if (parameterDefinitions == null) return null; PropertyDefinition pd = parameterDefinitions.get(prop.getName()); if (pd instanceof PropertyDefinitionSimple) { PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd; return getObjectForProperty(prop, pds); } else { LOG.warn("Property [" + prop.getName() + "] is not understood yet"); return null; } }
public void print(PropertySimple p, int depth) { out.println(indent(depth) + p.getName() + " = " + p.getStringValue()); }
public void applyConfiguration(Configuration configuration) { for(PropertySimple prop : configuration.getSimpleProperties().values()) { SystemSetting systemProp = SystemSetting.getByInternalName(prop.getName()); if (systemProp != null) { String value = prop.getStringValue(); put(systemProp, value); } } }
PropertySimple propSimple = (PropertySimple) prop; String val1 = propSimple.getStringValue(); String val2 = config.getSimpleValue(propSimple.getName()); if (val1 == null && val2 == null) { configDefCopy.getPropertyDefinitions().remove(propSimple.getName()); configDefCopy.getPropertyDefinitions().remove(propSimple.getName()); configDefCopy.getPropertyDefinitions().remove(propSimple.getName());
private static void unmaskPropertySimple(PropertySimple propertySimple, AbstractPropertyMap unmaskedParentPropertyMap) { if (propertySimple.isMasked()) { PropertySimple unmaskedPropertySimple = unmaskedParentPropertyMap.getSimple(propertySimple.getName()); String unmaskedValue = (unmaskedPropertySimple != null) ? unmaskedPropertySimple.getStringValue() : null; propertySimple.setStringValue(unmaskedValue); } }
private void createWriteAttributePropertySimple(CompositeOperation cop, PropertySimple property, PropertyDefinitionSimple propertyDefinition, Address address) { if (property.getName().endsWith(":ignore")) // Caller takes care return; if (propertyDefinition.isReadOnly() && !createChildRequested) return; //If the property value is null and the property is optional, //then send default value or null to the server if (property.getStringValue() == null && !propertyDefinition.isRequired()) { String name = property.getName(); if (name.indexOf(':') != -1) { name = name.substring(0, name.indexOf(":")); } Operation writeAttribute = new WriteAttribute(address, name, null); cop.addStep(writeAttribute); return; } SimpleEntry<String, Object> entry = this.preparePropertySimple(property, propertyDefinition); Operation writeAttribute = new WriteAttribute(address, entry.getKey(), entry.getValue()); cop.addStep(writeAttribute); }
List<String> messages) { String prefix = "Property [" + property.getName() + "] is "; String val = property.getStringValue();
String name = stripNumberIdentifier(property.getName()); if (name.endsWith(":expr")) {
if (timeoutProperty != null) { try { paramConfig.remove(timeoutProperty.getName()); // we have to remove it since ResourceComponents are not expecting it Long timeout = timeoutProperty.getLongValue(); if (timeout != null) {
if (ps.getStringValue() != null) { Object val = getObjectForProperty(ps, op); operation.addAdditionalProperty(ps.getName(), val);
addDebug(parent, true, ".addOpenMapMemberProperty()"); String mapName = ((PropertyMap) this.propertyMap).getName(); String memberName = propertySimple.getName(); FacesComponentUtility.addOutputText(wrapper, this.config, propertySimple.getName(), CssStyleClasses.PROPERTY_DISPLAY_NAME_TEXT); FacesComponentUtility.addVerbatimText(wrapper, "</td>"); String expressionString = String.format(valueExpressionFormat, propertySimple.getName()); ValueExpression valueExpression = FacesExpressionUtility.createValueExpression(expressionString, String.class); UIInput input = null;
PropertySimple propertySimple = (PropertySimple) prop; PropertyDefinitionSimple propertyDefinition = this.configurationDefinition .getPropertyDefinitionSimple(propertySimple.getName());
try { PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property .getName()); if (!(ignoreReadOnly && def.isReadOnly())) { switch (def.getType()) {
ValueExpression propertyValueExpression = createPropertyValueExpression(propertySimple.getName(), this.valueExpressionFormat);
ValueExpression propertyValueExpression = createPropertyValueExpression(propertySimple.getName(), this.valueExpressionFormat);