}
public void addNotificationLog(int alertId, AlertNotificationLog notificationLog) {
Alert alert = entityManager.find(Alert.class, alertId);
if (null == alert) {
throw new ApplicationException("Alert not found with id [" + alertId + "].");
}
// make sure we don't exceed the max message length for the db vendor
DatabaseType dbType = DatabaseTypeFactory.getDefaultDatabaseType();
String message = dbType.getString(notificationLog.getMessage(), AlertNotificationLog.MESSAGE_MAX_LENGTH);