Merge "ASM #16736 - OHD's RunReportAlarm Service does not notify EDEX's AlarmAlertNotification Observer." into asm_14.4.1

Former-commit-id: fa16cbd1cf7c92545d22b39c1bca597a0959c98c
This commit is contained in:
Juliya Dynina 2015-02-10 15:45:27 -05:00 committed by Gerrit Code Review
commit a2da3621ee

View file

@ -150,19 +150,16 @@ public final class RunReportAlarmSrv {
private static void saveProductToTextDb(final String productText,
final String productId) throws Exception {
TextDB textdb = new TextDB();
long statusCode = textdb.writeProduct(productId, productText, true,
long insertTime = textdb.writeProduct(productId, productText, true,
null);
// Set the current time and send product alarm alert.
Date d = new Date(System.currentTimeMillis());
d.setTime(statusCode);
AlarmAlertUtil.sendProductAlarmAlert(productId,
String.valueOf(d.getTime()),
true);
if (statusCode != Long.MIN_VALUE) {
statusHandler.info("Product successfully sent");
if (insertTime != Long.MIN_VALUE) {
// Set the write time and send product alarm alert.
Date d = new Date();
d.setTime(insertTime);
AlarmAlertUtil.sendProductAlarmAlert(productId, d, true);
statusHandler.info("Saved product to textdb successfully.");
} else {
statusHandler.error("Product send error detected.");
statusHandler.error("Error detected saving product to textdb.");
}
}
}