def construct_notification_object(db_repo, notification_json):
    try:
        notification = Notification(notification_json['id'], notification_json['type'], notification_json['name'], notification_json['address'], notification_json['period'], notification_json['retry_count'], notification_json['raw_alarm'])
        stored_notification = grab_stored_notification_method(db_repo, notification.id)
        if (stored_notification is None):
            LOG.debug('Notification method {0} was deleted from database. Will stop sending.'.format(notification.id))
            return None
        else:
            notification.name = stored_notification[0]
            notification.type = stored_notification[1]
            notification.address = stored_notification[2]
            notification.period = stored_notification[3]
            return notification
    except exceptions.DatabaseException:
        LOG.warn('Error querying mysql for notification method. Using currently cached method.')
        return notification
    except Exception as e:
        LOG.warn('Error when attempting to construct notification {0}'.format(e))
        return None
def construct_notification_object(db_repo, notification_json):
    try:
        notification = Notification(notification_json['id'], notification_json['type'], notification_json['name'], notification_json['address'], notification_json['period'], notification_json['retry_count'], notification_json['raw_alarm'])
        stored_notification = grab_stored_notification_method(db_repo, notification.id)
        if (stored_notification is None):
            LOG.debug('Notification method {0} was deleted from database. Will stop sending.'.format(notification.id))
            return None
        else:
            notification.name = stored_notification[0]
            notification.type = stored_notification[1]
            notification.address = stored_notification[2]
            notification.period = stored_notification[3]
            return notification
    except exceptions.DatabaseException:
        LOG.warn('Error querying mysql for notification method. Using currently cached method.')
        return notification
    except Exception as e:
        LOG.warn('Error when attempting to construct notification {0}'.format(e))
        return None