|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.PlatformRegister; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (logger.isDebugEnabled()) { | 
|---|
|  |  |  | logger.debug("平台心跳到期事件事件触发,平台国标ID:" + event.getPlatformGbID()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ParentPlatform parentPlatform = storager.queryParentPlatById(event.getPlatformGbID()); | 
|---|
|  |  |  | ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(event.getPlatformGbID()); | 
|---|
|  |  |  | ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(event.getPlatformGbID()); | 
|---|
|  |  |  | parentPlatformCatch.setParentPlatform(parentPlatform); | 
|---|
|  |  |  | if (parentPlatformCatch == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (parentPlatform == null) { | 
|---|
|  |  |  | logger.debug("平台心跳到期事件事件触发,但平台已经删除!!! 平台国标ID:" + event.getPlatformGbID()); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (parentPlatformCatch == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | parentPlatformCatch.setParentPlatform(parentPlatform); | 
|---|
|  |  |  | // 发送心跳 | 
|---|
|  |  |  | if (parentPlatformCatch.getKeepAliveReply() >= 3) { | 
|---|
|  |  |  | // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册 | 
|---|
|  |  |  | logger.warn("有3次未收到心跳回复,标记设置平台状态为离线, 并重新注册 平台国标ID:" + event.getPlatformGbID()); | 
|---|
|  |  |  | publisher.platformNotRegisterEventPublish(event.getPlatformGbID()); | 
|---|
|  |  |  | parentPlatformCatch.setKeepAliveReply(0); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | // 再次发送心跳 | 
|---|
|  |  |  | String callId = sipCommanderForPlatform.keepalive(parentPlatform); | 
|---|