AlertDefineService.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package com.usthe.alert.service;
  2. import com.usthe.alert.pojo.entity.AlertDefine;
  3. import org.springframework.data.domain.Page;
  4. import org.springframework.data.domain.PageRequest;
  5. import org.springframework.data.jpa.domain.Specification;
  6. import java.util.Map;
  7. import java.util.Set;
  8. /**
  9. * 告警定义管理接口
  10. * @author tom
  11. * @date 2021/12/9 10:06
  12. */
  13. public interface AlertDefineService {
  14. /**
  15. * 校验请求数据参数正确性
  16. * @param alertDefine alertDefine
  17. * @param isModify 是否是修改配置
  18. * @throws IllegalArgumentException 校验参数错误抛出
  19. */
  20. void validate(AlertDefine alertDefine, boolean isModify) throws IllegalArgumentException;
  21. /**
  22. * 新增告警定义
  23. * @param alertDefine 告警定义实体
  24. * @throws RuntimeException 新增过程异常抛出
  25. */
  26. void addAlertDefine(AlertDefine alertDefine) throws RuntimeException;
  27. /**
  28. * 修改告警定义
  29. * @param alertDefine 告警定义实体
  30. * @throws RuntimeException 修改过程中异常抛出
  31. */
  32. void modifyAlertDefine(AlertDefine alertDefine) throws RuntimeException;
  33. /**
  34. * 删除告警定义
  35. * @param alertId 告警定义ID
  36. * @throws RuntimeException 删除过程中异常抛出
  37. */
  38. void deleteAlertDefine(long alertId) throws RuntimeException;
  39. /**
  40. * 获取告警定义信息
  41. * @param alertId 监控ID
  42. * @return AlertDefine
  43. * @throws RuntimeException 查询过程中异常抛出
  44. */
  45. AlertDefine getAlertDefine(long alertId) throws RuntimeException;
  46. /**
  47. * 批量删除告警定义
  48. * @param alertIds 告警定义IDs
  49. * @throws RuntimeException 删除过程中异常抛出
  50. */
  51. void deleteAlertDefines(Set<Long> alertIds) throws RuntimeException;
  52. /**
  53. * 动态条件查询
  54. * @param specification 查询条件
  55. * @param pageRequest 分页参数
  56. * @return 查询结果
  57. */
  58. Page<AlertDefine> getAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest);
  59. /**
  60. * 应用告警定于与监控关联关系
  61. * @param alertId 告警定义ID
  62. * @param monitorMap 监控ID-名称 MAP
  63. */
  64. void applyBindAlertDefineMonitors(Long alertId, Map<Long, String> monitorMap);
  65. }