@Override
    public void updateRuleWithWebhooks(String ruleId, List<String> webhookIds) {
        List<WebhookSendInfo> oldListofWebhookInfos = webhookSendInfoDao.selectWebhookSendInfoByRuleId(ruleId);

        for (WebhookSendInfo webhookSendInfo : oldListofWebhookInfos) {
            // remove already existing webhook mapping to this alarm from webhookIds
            if (!webhookIds.remove(webhookSendInfo.getWebhookId())) {
                // webhook not linked to this alarm anymore, so delete from mysql
                webhookSendInfoDao.deleteWebhookSendInfo(webhookSendInfo);
            }
        }

        // adds newly mapped webhooks to this alarm
        for (String webhookId : webhookIds) {
            WebhookSendInfo webhookSendInfo = new WebhookSendInfo("", webhookId, ruleId);
            webhookSendInfoDao.insertWebhookSendInfo(webhookSendInfo);
        }
    }
@author minwoo.jung
@author Jongjin.Bae
webhook/src/main/java/com/navercorp/pinpoint/web/webhook/service/WebhookAlarmServiceImpl.java