package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TDetectionChannel; import com.ruoyi.system.domain.TDeviceAdapter; import com.ruoyi.system.domain.vo.AdapterDiscoveryResult; public interface IDeviceAdapterService { /** 按管理端筛选条件查询设备适配器实例。 */ List selectList(TDeviceAdapter query); /** 查询设备适配器详情;实例不存在时返回稳定业务错误。 */ TDeviceAdapter selectById(Long adapterId); /** 幂等注册并启用由应用装配层托管的适配器配置。 */ TDeviceAdapter ensureManagedAdapter(TDeviceAdapter adapter); /** 新增默认禁用的只读设备适配器配置。 */ int insert(TDeviceAdapter adapter); /** 更新设备适配器配置,并同步已启用的运行时实例。 */ int update(TDeviceAdapter adapter); /** 启用或停用设备适配器,并同步运行时生命周期。 */ int changeStatus(Long adapterId, boolean enabled, String updateBy); /** 执行一次发现和实时观测,并将本轮设备事实写入 Redis 候选。 */ AdapterDiscoveryResult discover(Long adapterId); /** 查询指定适配器当前未过期的发现通道。 */ List selectChannels(Long adapterId); /** 启动时恢复所有已启用适配器的运行时实例。 */ void synchronizeEnabledAdapters(); /** 对达到轮询周期的已启用适配器执行发现。 */ void pollDueAdapters(); }