开源项目
知识点
相关文章
更多最近更新
更多报警-Oceanus编码调用
2019-03-10 16:01|来源: 网路
报警扫描周期是 Oceanus 内置的参数,不对外提供。两种方式实现:
1 实现 com.bj58.oceanus.core.alarm.Alarm 接口
将实现类名配置在 datanode 节点属性 alarm 中,实现其中的void excute(AlarmType type,String dataNodeId)方法,每当需要报警时就会调用excute方法
(注:这种报警调用会很频繁,根据各自需求进行选择实现)
2 继承 com.bj58.oceanus.core.alarm.PeriodicAlarm 抽象类
实现其中的三个方法:
1. long getAlarmCycle() 返回报警时间间隔
2. TimeUnit getAlarmUnit() 指定报警间隔时间单位
3. void excuteAlarm(AlarmType type,String dataNodeId)对报警内容的实现,目前报警类型包括 DB_NOTAVALIABLE:表示当前datanode不可用,DB_AVALIABLE:表示datanode恢复
第二种是周期性的报警,约定周期内不会对相同 datanode 相同报警类型做重
复的报警调用
本文来源:58同城Oceanus使用文档
相关问答
更多-
我在东莞长安万科广场遇到酒托![2023-06-10]
报警 -
轮询机制下如何实时报警[2022-11-23]
可以在网络侦测后利用帧间空闲采用突发模式来上传相关信息,仔细构思协议吧。 -
如何实现邮件报警通知以及免费短信报警通知[2022-03-20]
您的意思是实现邮件提醒或者短信提醒吧。 如果是这样的话,就下载客维通吧,它能够实现邮件提醒或者短信提醒的功能。 请先在客维通设置提醒的时间和事件,以及被提醒人的邮箱,到时会自动发送邮件; 然后在手机中安装163的邮箱大师或QQ的邮箱APP... -
哪里可以卖到NB-IoT烟雾报警器?[2021-12-12]
建议您到阿里上找一下NB-IoT烟感器! -
轮询机制下如何实时报警[2024-03-29]
可以在网络侦测后利用帧间空闲采用突发模式来上传相关信息,仔细构思协议吧。 -
每天报警不工作?(Alarm for every day not working?)[2022-02-14]
请检查此主题。 你可能会得到解决方案 Please check this thread. you may get solution. -
android报警:X重复/报警接收器可以取消报警(android alarms: Can alarm receiver cancel alarm after X repeats /)[2021-08-14]
保持简单,并使用SharedPreference存储此计数器。 增加警报,然后在再次设置警报时重置警报。 Keep it simple and use a SharedPreference to store this counter. Increment on the alarm and then reset it when the alarm is set again. -
您的服务需要在完成后调用stopSelf() ,或者您需要切换到使用IntentService ,它会在完成后自动调用stopSelf() 。 现在,你正在泄露服务,Android正在破坏并在一段时间后重新创建它。 Your service needs to call stopSelf() when it is done, or you need to switch to using an IntentService, which will automatically call stopSelf() whe ...
-
UILocalNotification * localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = targetDateTime; localNotification.timeZone = [NSTimeZone defaultTimeZone]; localNotification.userInfo = @"Its Morning Time"; NSString * soundName ...