package com.ruoyi.rocketmq.service;

import com.ruoyi.rocketmq.domain.RmMonitorPolicy;

import java.util.List;
import java.util.Map;

/**
 * 资源监控策略Service接口
 * 
 * @author gyt
 * @date 2025-09-10
 */
public interface IRmMonitorPolicyService 
{
    /**
     * 查询资源监控策略
     * 
     * @param id 资源监控策略主键
     * @return 资源监控策略
     */
    public RmMonitorPolicy selectRmMonitorPolicyById(Long id);

    /**
     * 查询资源监控策略列表
     * 
     * @param rmMonitorPolicy 资源监控策略
     * @return 资源监控策略集合
     */
    public List<RmMonitorPolicy> selectRmMonitorPolicyList(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 新增资源监控策略
     * 
     * @param rmMonitorPolicy 资源监控策略
     * @return 结果
     */
    public int insertRmMonitorPolicy(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 修改资源监控策略
     * 
     * @param rmMonitorPolicy 资源监控策略
     * @return 结果
     */
    public int updateRmMonitorPolicy(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 批量删除资源监控策略
     * 
     * @param ids 需要删除的资源监控策略主键集合
     * @return 结果
     */
    public int deleteRmMonitorPolicyByIds(Long[] ids);

    /**
     * 删除资源监控策略信息
     * 
     * @param id 资源监控策略主键
     * @return 结果
     */
    public int deleteRmMonitorPolicyById(Long id);

    int addRmMonitorPolicy(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 新增交换机监控策略
     * @param rmMonitorPolicy
     * @return
     */
    int addResourcePolicy(RmMonitorPolicy rmMonitorPolicy);

    Map<String, Object> getRmMonitorPolicyMsgById(Long id);

    int issuePolicy(Long id);
    int issueSwitchPolicy(Long id);

    int updateResourcePolicy(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 修改资源监控策略内部调用
     * @param rmMonitorPolicy
     * @return
     */
    int updatePolicyMsgInner(RmMonitorPolicy rmMonitorPolicy);

    /**
     * 检测策略是否下发，如果未下发，进行下发操作
     * @param clientId
     * @return
     */
    public int issuePolicyMsgByClientId(String clientId);

    /**
     * 根据clientId下发优先级为0的监控策略信息
     * @param clientId
     * @return
     */
    public int issueDefaultPolicyByClientId(String clientId);
}
