class DbAlertStoreHandlerImpl implements AlertStoreHandler {

    private final MonitorService monitorService;

    private final AlertService alertService;

    @Override
    public void store(Alert alert) {<FILL_FUNCTION_BODY>}
}

        Map<String, String> tags = alert.getTags();
        String monitorIdStr = tags != null ? tags.get(CommonConstants.TAG_MONITOR_ID) : null;
        if (monitorIdStr != null) {
            long monitorId = Long.parseLong(monitorIdStr);
            Monitor monitor = monitorService.getMonitor(monitorId);
            if (monitor == null) {
                log.warn("Dispatch alarm the monitorId: {} not existed, ignored. target: {}.", monitorId, alert.getTarget());
                return;
            }
            if (!tags.containsKey(CommonConstants.TAG_MONITOR_NAME)) {
                tags.put(CommonConstants.TAG_MONITOR_NAME, monitor.getName());
            }
            if (!tags.containsKey(CommonConstants.TAG_MONITOR_HOST)) {
                tags.put(CommonConstants.TAG_MONITOR_HOST, monitor.getHost());
            }
            if (monitor.getStatus() == CommonConstants.UN_MANAGE_CODE) {
                // When monitoring is not monitored, ignore and silence its alarm messages
                return;
            }
            if (CommonConstants.AVAILABILITY.equals(alert.getTarget())) {
                if (alert.getStatus() == CommonConstants.ALERT_STATUS_CODE_PENDING && monitor.getStatus() == CommonConstants.AVAILABLE_CODE) {
                    // Availability Alarm Need to change the monitoring status to unavailable
                    // 可用性告警 需变更任务状态为不可用
                    monitorService.updateMonitorStatus(monitor.getId(), CommonConstants.UN_AVAILABLE_CODE);
                } else if (alert.getStatus() == CommonConstants.ALERT_STATUS_CODE_RESTORED && monitor.getStatus() == CommonConstants.UN_AVAILABLE_CODE) {
                    // If the alarm is restored, the monitoring state needs to be restored
                    // 若是恢复告警 需对任务状态进行恢复
                    monitorService.updateMonitorStatus(monitorId, CommonConstants.AVAILABLE_CODE);
                }
            }
        } else {
            log.debug("store extern alert content: {}.", alert);
        }
        if (tags != null && tags.containsKey(CommonConstants.IGNORE)) {
            throw new IgnoreException("Ignore this alarm.");
        }
        // Alarm store db
        alertService.addAlert(alert);
    
<no_super_class>