| | |
| | | if (parentPlatform == null) { |
| | | return; |
| | | } |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat()); |
| | | } |
| | | logger.info("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat()); |
| | | |
| | | String characterSet = parentPlatform.getCharacterSet(); |
| | | StringBuffer deviceStatusXml = new StringBuffer(600); |
| | |
| | | Integer finalIndex = index; |
| | | String catalogXmlContent = getCatalogXmlContentForCatalogAddOrUpdate(parentPlatform, channels, |
| | | deviceChannels.size(), type, subscribeInfo); |
| | | System.out.println(catalogXmlContent); |
| | | logger.info("[发送NOTIFY通知]类型: {},发送数量: {}", type, channels.size()); |
| | | sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { |
| | | logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg); |
| | |
| | | |
| | | private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List<DeviceChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) { |
| | | StringBuffer catalogXml = new StringBuffer(600); |
| | | |
| | | String characterSet = parentPlatform.getCharacterSet(); |
| | | catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n") |
| | | .append("<Notify>\r\n") |
| | |
| | | .append("<Owner> " + channel.getOwner()+ "</Owner>\r\n") |
| | | .append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n") |
| | | .append("<Address>" + channel.getAddress() + "</Address>\r\n"); |
| | | catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n"); |
| | | catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n"); |
| | | } |
| | | if (!"presence".equals(subscribeInfo.getEventType())) { |
| | | catalogXml.append("<Event>" + type + "</Event>\r\n"); |