null, alertCondition.getThreshold(), icee));
}
}// last call-time case
} else if (alertConditionCategory == AlertConditionCategory.BASELINE) { // normal cases start here
AlertConditionBaselineCategoryComposite baselineComposite = (AlertConditionBaselineCategoryComposite) composite;
// option status for baseline gets set to "mean", but it's rather useless since the UI
// current doesn't allow alerting off of other baseline properties such as "min" and "max"
Double threshold = alertCondition.getThreshold();
String optionStatus = alertCondition.getOption();
/*
* yes, calculatedValue may be null, but that's OK because the match
* method for MeasurementBaselineCacheElement handles nulls just fine
*/
Double calculatedValue = getCalculatedBaselineValue(alertConditionId, baselineComposite, optionStatus,
threshold);
try {
MeasurementBaselineCacheElement cacheElement = new MeasurementBaselineCacheElement(
alertConditionOperator, calculatedValue, alertConditionId, optionStatus);
// auto-boxing (of alertConditionId) is always safe
addTo("measurementDataCache", measurementDataCache, baselineComposite.getScheduleId(), cacheElement,
alertConditionId, stats);
} catch (InvalidCacheElementException icee) {
log.info("Failed to create MeasurementBaselineCacheElement with parameters: "
+ AlertConditionCacheUtils.getCacheElementErrorString(alertConditionId, alertConditionOperator,
null, calculatedValue, icee));