log.info("Failed to create MeasurementNumericCacheElement with parameters: "
+ AlertConditionCacheUtils.getCacheElementErrorString(alertConditionId, alertConditionOperator,
null, numeric, icee));
}
} else if (alertConditionCategory == AlertConditionCategory.TRAIT) {
AlertConditionTraitCategoryComposite traitsComposite = (AlertConditionTraitCategoryComposite) composite;
String value = null;
switch (alertConditionOperator) {
case CHANGES:
value = traitsComposite.getValue();
break;
case REGEX:
value = traitsComposite.getCondition().getOption();
break;
default:
log.error("Invalid operator for Trait condition: " + alertConditionOperator);
}
try {
/*
* don't forget special defensive handling to allow for null trait calculation;
* this might happen if a newly committed resource has some alert template applied to
* it for some trait that it has not yet gotten from the agent
*/
MeasurementTraitCacheElement cacheElement = new MeasurementTraitCacheElement(alertConditionOperator,
value, alertConditionId);
addTo("measurementTraitCache", measurementTraitCache, traitsComposite.getScheduleId(), cacheElement,
alertConditionId, stats);
} catch (InvalidCacheElementException icee) {
log.info("Failed to create MeasurementTraitCacheElement with parameters: "
+ AlertConditionCacheUtils.getCacheElementErrorString(alertConditionId, alertConditionOperator,
null, value, icee));