Commit a8603075d4bfb6ebc3248e6662eb700261c0fa56

Authored by lawrencehj
1 parent 6868577e

去除冗余代码,修正编译报警项

Showing 42 changed files with 114 additions and 217 deletions
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
@@ -3,7 +3,6 @@ package com.genersoft.iot.vmp; @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp;
3 import java.util.logging.LogManager; 3 import java.util.logging.LogManager;
4 4
5 import org.springframework.boot.SpringApplication; 5 import org.springframework.boot.SpringApplication;
6 -import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
7 import org.springframework.boot.autoconfigure.SpringBootApplication; 6 import org.springframework.boot.autoconfigure.SpringBootApplication;
8 7
9 @SpringBootApplication 8 @SpringBootApplication
src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
1 package com.genersoft.iot.vmp.common; 1 package com.genersoft.iot.vmp.common;
2 2
3 /** 3 /**
4 - * @Description:TODO(这里用一句话描述这个类的作用) 4 + * @Description: 定义常量
5 * @author: swwheihei 5 * @author: swwheihei
6 * @date: 2019年5月30日 下午3:04:04 6 * @date: 2019年5月30日 下午3:04:04
7 * 7 *
src/main/java/com/genersoft/iot/vmp/conf/VManagerConfig.java
@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Value; @@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Value;
4 import org.springframework.context.annotation.Configuration; 4 import org.springframework.context.annotation.Configuration;
5 5
6 /** 6 /**
7 - * @Description:TODO(这里用一句话描述这个类的作用) 7 + * @Description: 获取数据库配置
8 * @author: swwheihei 8 * @author: swwheihei
9 * @date: 2020年5月6日 下午2:46:00 9 * @date: 2020年5月6日 下午2:46:00
10 */ 10 */
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
@@ -149,8 +149,6 @@ public class SipLayer implements SipListener { @@ -149,8 +149,6 @@ public class SipLayer implements SipListener {
149 } 149 }
150 } 150 }
151 } 151 }
152 - // } else if (status == Response.TRYING) {  
153 - // trying不会回复  
154 } else if ((status >= 100) && (status < 200)) { 152 } else if ((status >= 100) && (status < 200)) {
155 // 增加其它无需回复的响应,如101、180等 153 // 增加其它无需回复的响应,如101、180等
156 } else { 154 } else {
src/main/java/com/genersoft/iot/vmp/gb28181/auth/DigestServerAuthenticationHelper.java
@@ -91,8 +91,10 @@ public class DigestServerAuthenticationHelper { @@ -91,8 +91,10 @@ public class DigestServerAuthenticationHelper {
91 long time = date.getTime(); 91 long time = date.getTime();
92 Random rand = new Random(); 92 Random rand = new Random();
93 long pad = rand.nextLong(); 93 long pad = rand.nextLong();
94 - String nonceString = (new Long(time)).toString()  
95 - + (new Long(pad)).toString(); 94 + // String nonceString = (new Long(time)).toString()
  95 + // + (new Long(pad)).toString();
  96 + String nonceString = Long.valueOf(time).toString()
  97 + + Long.valueOf(pad).toString();
96 byte mdbytes[] = messageDigest.digest(nonceString.getBytes()); 98 byte mdbytes[] = messageDigest.digest(nonceString.getBytes());
97 // Convert the mdbytes array into a hex string. 99 // Convert the mdbytes array into a hex string.
98 return toHexString(mdbytes); 100 return toHexString(mdbytes);
@@ -191,7 +193,7 @@ public class DigestServerAuthenticationHelper { @@ -191,7 +193,7 @@ public class DigestServerAuthenticationHelper {
191 193
192 // 客户端随机数,这是一个不透明的字符串值,由客户端提供,并且客户端和服务器都会使用,以避免用明文文本。 194 // 客户端随机数,这是一个不透明的字符串值,由客户端提供,并且客户端和服务器都会使用,以避免用明文文本。
193 // 这使得双方都可以查验对方的身份,并对消息的完整性提供一些保护 195 // 这使得双方都可以查验对方的身份,并对消息的完整性提供一些保护
194 - String cNonce = authHeader.getCNonce(); 196 + //String cNonce = authHeader.getCNonce();
195 197
196 // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量 198 // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量
197 int nc = authHeader.getNonceCount(); 199 int nc = authHeader.getNonceCount();
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordInfo.java
1 package com.genersoft.iot.vmp.gb28181.bean; 1 package com.genersoft.iot.vmp.gb28181.bean;
2 2
3 3
4 -import gov.nist.javax.sip.header.SIPDate; 4 +//import gov.nist.javax.sip.header.SIPDate;
5 5
6 import java.util.List; 6 import java.util.List;
7 7
src/main/java/com/genersoft/iot/vmp/gb28181/bean/WvpSipDate.java
@@ -10,6 +10,11 @@ import java.util.*; @@ -10,6 +10,11 @@ import java.util.*;
10 */ 10 */
11 public class WvpSipDate extends SIPDate { 11 public class WvpSipDate extends SIPDate {
12 12
  13 + /**
  14 + *
  15 + */
  16 + private static final long serialVersionUID = 1L;
  17 +
13 private Calendar javaCal; 18 private Calendar javaCal;
14 19
15 public WvpSipDate(long timeMillis) { 20 public WvpSipDate(long timeMillis) {
src/main/java/com/genersoft/iot/vmp/gb28181/event/SipSubscribe.java
1 package com.genersoft.iot.vmp.gb28181.event; 1 package com.genersoft.iot.vmp.gb28181.event;
2 2
3 -import com.alibaba.fastjson.JSONObject;  
4 -import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;  
5 -import org.slf4j.Logger;  
6 -import org.slf4j.LoggerFactory;  
7 import org.springframework.stereotype.Component; 3 import org.springframework.stereotype.Component;
8 4
9 import javax.sip.ResponseEvent; 5 import javax.sip.ResponseEvent;
10 -import javax.sip.message.Request;  
11 -import java.util.EventObject;  
12 import java.util.Map; 6 import java.util.Map;
13 import java.util.concurrent.ConcurrentHashMap; 7 import java.util.concurrent.ConcurrentHashMap;
14 8
15 @Component 9 @Component
16 public class SipSubscribe { 10 public class SipSubscribe {
17 11
18 - private final static Logger logger = LoggerFactory.getLogger(SipSubscribe.class);  
19 -  
20 private Map<String, SipSubscribe.Event> errorSubscribes = new ConcurrentHashMap<>(); 12 private Map<String, SipSubscribe.Event> errorSubscribes = new ConcurrentHashMap<>();
21 13
22 private Map<String, SipSubscribe.Event> okSubscribes = new ConcurrentHashMap<>(); 14 private Map<String, SipSubscribe.Event> okSubscribes = new ConcurrentHashMap<>();
src/main/java/com/genersoft/iot/vmp/gb28181/event/alarm/AlarmEvent.java
@@ -10,6 +10,11 @@ import org.springframework.context.ApplicationEvent; @@ -10,6 +10,11 @@ import org.springframework.context.ApplicationEvent;
10 */ 10 */
11 11
12 public class AlarmEvent extends ApplicationEvent { 12 public class AlarmEvent extends ApplicationEvent {
  13 + /**
  14 + *
  15 + */
  16 + private static final long serialVersionUID = 1L;
  17 +
13 public AlarmEvent(Object source) { 18 public AlarmEvent(Object source) {
14 super(source); 19 super(source);
15 } 20 }
src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/OfflineEvent.java
@@ -3,18 +3,17 @@ package com.genersoft.iot.vmp.gb28181.event.offline; @@ -3,18 +3,17 @@ package com.genersoft.iot.vmp.gb28181.event.offline;
3 import org.springframework.context.ApplicationEvent; 3 import org.springframework.context.ApplicationEvent;
4 4
5 /** 5 /**
6 - * @Description:TODO(这里用一句话描述这个类的作用) 6 + * @Description: 离线事件类
7 * @author: swwheihei 7 * @author: swwheihei
8 * @date: 2020年5月6日 上午11:33:13 8 * @date: 2020年5月6日 上午11:33:13
9 */ 9 */
10 public class OfflineEvent extends ApplicationEvent { 10 public class OfflineEvent extends ApplicationEvent {
11 11
12 - /**  
13 - * @Title: OutlineEvent  
14 - * @Description: TODO(这里用一句话描述这个方法的作用)  
15 - * @param: @param source  
16 - * @throws  
17 - */ 12 + /**
  13 + *
  14 + */
  15 + private static final long serialVersionUID = 1L;
  16 +
18 public OfflineEvent(Object source) { 17 public OfflineEvent(Object source) {
19 super(source); 18 super(source);
20 } 19 }
src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEvent.java
@@ -3,18 +3,17 @@ package com.genersoft.iot.vmp.gb28181.event.online; @@ -3,18 +3,17 @@ package com.genersoft.iot.vmp.gb28181.event.online;
3 import org.springframework.context.ApplicationEvent; 3 import org.springframework.context.ApplicationEvent;
4 4
5 /** 5 /**
6 - * @Description:TODO(这里用一句话描述这个类的作用) 6 + * @Description: 在线事件类
7 * @author: swwheihei 7 * @author: swwheihei
8 * @date: 2020年5月6日 上午11:32:56 8 * @date: 2020年5月6日 上午11:32:56
9 */ 9 */
10 public class OnlineEvent extends ApplicationEvent { 10 public class OnlineEvent extends ApplicationEvent {
11 11
12 - /**  
13 - * @Title: OnlineEvent  
14 - * @Description: TODO(这里用一句话描述这个方法的作用)  
15 - * @param: @param source  
16 - * @throws  
17 - */ 12 + /**
  13 + *
  14 + */
  15 + private static final long serialVersionUID = 1L;
  16 +
18 public OnlineEvent(Object source) { 17 public OnlineEvent(Object source) {
19 super(source); 18 super(source);
20 } 19 }
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
@@ -8,10 +8,9 @@ import javax.sip.message.Request; @@ -8,10 +8,9 @@ import javax.sip.message.Request;
8 import javax.sip.message.Response; 8 import javax.sip.message.Response;
9 9
10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
11 -import org.slf4j.Logger;  
12 -import org.slf4j.LoggerFactory; 11 +// import org.slf4j.Logger;
  12 +// import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
14 -import org.springframework.beans.factory.annotation.Qualifier;  
15 import org.springframework.stereotype.Component; 14 import org.springframework.stereotype.Component;
16 15
17 import com.genersoft.iot.vmp.conf.SipConfig; 16 import com.genersoft.iot.vmp.conf.SipConfig;
@@ -40,14 +39,14 @@ import com.genersoft.iot.vmp.utils.SpringBeanFactory; @@ -40,14 +39,14 @@ import com.genersoft.iot.vmp.utils.SpringBeanFactory;
40 import com.genersoft.iot.vmp.utils.redis.RedisUtil; 39 import com.genersoft.iot.vmp.utils.redis.RedisUtil;
41 40
42 /** 41 /**
43 - * @Description:TODO(这里用一句话描述这个类的作用) 42 + * @Description: SIP信令处理分配
44 * @author: swwheihei 43 * @author: swwheihei
45 * @date: 2020年5月3日 下午4:24:37 44 * @date: 2020年5月3日 下午4:24:37
46 */ 45 */
47 @Component 46 @Component
48 public class SIPProcessorFactory { 47 public class SIPProcessorFactory {
49 48
50 - private final static Logger logger = LoggerFactory.getLogger(SIPProcessorFactory.class); 49 + // private final static Logger logger = LoggerFactory.getLogger(SIPProcessorFactory.class);
51 50
52 @Autowired 51 @Autowired
53 private SipConfig sipConfig; 52 private SipConfig sipConfig;
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/DeferredResultHolder.java
1 package com.genersoft.iot.vmp.gb28181.transmit.callback; 1 package com.genersoft.iot.vmp.gb28181.transmit.callback;
2 2
3 -import java.util.HashMap;  
4 import java.util.Map; 3 import java.util.Map;
5 import java.util.concurrent.ConcurrentHashMap; 4 import java.util.concurrent.ConcurrentHashMap;
6 5
@@ -10,10 +9,11 @@ import org.springframework.stereotype.Component; @@ -10,10 +9,11 @@ import org.springframework.stereotype.Component;
10 import org.springframework.web.context.request.async.DeferredResult; 9 import org.springframework.web.context.request.async.DeferredResult;
11 10
12 /** 11 /**
13 - * @Description:TODO(这里用一句话描述这个类的作用) 12 + * @Description: 异步请求处理
14 * @author: swwheihei 13 * @author: swwheihei
15 * @date: 2020年5月8日 下午7:59:05 14 * @date: 2020年5月8日 下午7:59:05
16 */ 15 */
  16 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
17 @Component 17 @Component
18 public class DeferredResultHolder { 18 public class DeferredResultHolder {
19 19
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/RequestMessage.java
1 package com.genersoft.iot.vmp.gb28181.transmit.callback; 1 package com.genersoft.iot.vmp.gb28181.transmit.callback;
2 2
3 /** 3 /**
4 - * @Description:TODO(这里用一句话描述这个类的作用) 4 + * @Description: 请求信息定义
5 * @author: swwheihei 5 * @author: swwheihei
6 * @date: 2020年5月8日 下午1:09:18 6 * @date: 2020年5月8日 下午1:09:18
7 */ 7 */
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
1 package com.genersoft.iot.vmp.gb28181.transmit.cmd; 1 package com.genersoft.iot.vmp.gb28181.transmit.cmd;
2 2
3 -import com.genersoft.iot.vmp.common.StreamInfo;  
4 import com.genersoft.iot.vmp.gb28181.bean.Device; 3 import com.genersoft.iot.vmp.gb28181.bean.Device;
5 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; 4 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
6 import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; 5 import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
@@ -18,7 +18,6 @@ import org.springframework.stereotype.Component; @@ -18,7 +18,6 @@ import org.springframework.stereotype.Component;
18 18
19 import com.genersoft.iot.vmp.conf.SipConfig; 19 import com.genersoft.iot.vmp.conf.SipConfig;
20 import com.genersoft.iot.vmp.gb28181.bean.Device; 20 import com.genersoft.iot.vmp.gb28181.bean.Device;
21 -import com.genersoft.iot.vmp.gb28181.bean.Host;  
22 21
23 /** 22 /**
24 * @Description:摄像头命令request创造器 TODO 冗余代码太多待优化 23 * @Description:摄像头命令request创造器 TODO 冗余代码太多待优化
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
1 package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl; 1 package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl;
2 2
3 import java.text.ParseException; 3 import java.text.ParseException;
4 -import java.util.UUID;  
5 import java.util.regex.Matcher; 4 import java.util.regex.Matcher;
6 import java.util.regex.Pattern; 5 import java.util.regex.Pattern;
7 6
8 import javax.sip.*; 7 import javax.sip.*;
9 import javax.sip.address.SipURI; 8 import javax.sip.address.SipURI;
10 import javax.sip.header.CallIdHeader; 9 import javax.sip.header.CallIdHeader;
11 -import javax.sip.header.Header;  
12 import javax.sip.header.ViaHeader; 10 import javax.sip.header.ViaHeader;
13 import javax.sip.message.Request; 11 import javax.sip.message.Request;
14 12
15 import com.alibaba.fastjson.JSONObject; 13 import com.alibaba.fastjson.JSONObject;
16 import com.genersoft.iot.vmp.common.StreamInfo; 14 import com.genersoft.iot.vmp.common.StreamInfo;
17 import com.genersoft.iot.vmp.conf.MediaServerConfig; 15 import com.genersoft.iot.vmp.conf.MediaServerConfig;
18 -import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;  
19 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; 16 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
20 import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; 17 import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
21 import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; 18 import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/NotifyRequestProcessor.java
@@ -50,26 +50,20 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -50,26 +50,20 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
50 50
51 private final static Logger logger = LoggerFactory.getLogger(MessageRequestProcessor.class); 51 private final static Logger logger = LoggerFactory.getLogger(MessageRequestProcessor.class);
52 52
53 - private SIPCommander cmder;  
54 -  
55 private IVideoManagerStorager storager; 53 private IVideoManagerStorager storager;
56 54
57 private IRedisCatchStorage redisCatchStorage; 55 private IRedisCatchStorage redisCatchStorage;
58 56
59 private EventPublisher publisher; 57 private EventPublisher publisher;
60 58
61 - private RedisUtil redis;  
62 -  
63 - private DeferredResultHolder deferredResultHolder;  
64 -  
65 private DeviceOffLineDetector offLineDetector; 59 private DeviceOffLineDetector offLineDetector;
66 60
67 private static final String NOTIFY_CATALOG = "Catalog"; 61 private static final String NOTIFY_CATALOG = "Catalog";
68 private static final String NOTIFY_ALARM = "Alarm"; 62 private static final String NOTIFY_ALARM = "Alarm";
69 private static final String NOTIFY_MOBILE_POSITION = "MobilePosition"; 63 private static final String NOTIFY_MOBILE_POSITION = "MobilePosition";
70 64
71 - @Override  
72 - public void process(RequestEvent evt) { 65 + @Override
  66 + public void process(RequestEvent evt) {
73 try { 67 try {
74 Element rootElement = getRootElement(evt); 68 Element rootElement = getRootElement(evt);
75 String cmd = XmlUtil.getText(rootElement, "CmdType"); 69 String cmd = XmlUtil.getText(rootElement, "CmdType");
@@ -87,18 +81,19 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -87,18 +81,19 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
87 logger.info("接收到消息:" + cmd); 81 logger.info("接收到消息:" + cmd);
88 response200Ok(evt); 82 response200Ok(evt);
89 } 83 }
90 - } catch (DocumentException | SipException |InvalidArgumentException | ParseException e) { 84 + } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
91 e.printStackTrace(); 85 e.printStackTrace();
92 } 86 }
93 - } 87 + }
94 88
95 /** 89 /**
96 * 处理MobilePosition移动位置Notify 90 * 处理MobilePosition移动位置Notify
  91 + *
97 * @param evt 92 * @param evt
98 */ 93 */
99 private void processNotifyMobilePosition(RequestEvent evt) { 94 private void processNotifyMobilePosition(RequestEvent evt) {
100 try { 95 try {
101 - //回复 200 OK 96 + // 回复 200 OK
102 Element rootElement = getRootElement(evt); 97 Element rootElement = getRootElement(evt);
103 MobilePosition mobilePosition = new MobilePosition(); 98 MobilePosition mobilePosition = new MobilePosition();
104 Element deviceIdElement = rootElement.element("DeviceID"); 99 Element deviceIdElement = rootElement.element("DeviceID");
@@ -112,8 +107,8 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -112,8 +107,8 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
112 mobilePosition.setDeviceId(XmlUtil.getText(rootElement, "DeviceID")); 107 mobilePosition.setDeviceId(XmlUtil.getText(rootElement, "DeviceID"));
113 mobilePosition.setTime(XmlUtil.getText(rootElement, "Time")); 108 mobilePosition.setTime(XmlUtil.getText(rootElement, "Time"));
114 mobilePosition.setLongitude(Double.parseDouble(XmlUtil.getText(rootElement, "Longitude"))); 109 mobilePosition.setLongitude(Double.parseDouble(XmlUtil.getText(rootElement, "Longitude")));
115 - mobilePosition.setLatitude(Double.parseDouble(XmlUtil.getText(rootElement, "Latitude")));  
116 - if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Speed"))) { 110 + mobilePosition.setLatitude(Double.parseDouble(XmlUtil.getText(rootElement, "Latitude")));
  111 + if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Speed"))) {
117 mobilePosition.setSpeed(Double.parseDouble(XmlUtil.getText(rootElement, "Speed"))); 112 mobilePosition.setSpeed(Double.parseDouble(XmlUtil.getText(rootElement, "Speed")));
118 } else { 113 } else {
119 mobilePosition.setSpeed(0.0); 114 mobilePosition.setSpeed(0.0);
@@ -147,6 +142,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -147,6 +142,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
147 142
148 /*** 143 /***
149 * 处理alarm设备报警Notify 144 * 处理alarm设备报警Notify
  145 + *
150 * @param evt 146 * @param evt
151 */ 147 */
152 private void processNotifyAlarm(RequestEvent evt) { 148 private void processNotifyAlarm(RequestEvent evt) {
@@ -180,7 +176,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -180,7 +176,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
180 deviceAlarm.setLatitude(0.00); 176 deviceAlarm.setLatitude(0.00);
181 } 177 }
182 178
183 - if ( deviceAlarm.getAlarmMethod().equals("4")) { 179 + if (deviceAlarm.getAlarmMethod().equals("4")) {
184 MobilePosition mobilePosition = new MobilePosition(); 180 MobilePosition mobilePosition = new MobilePosition();
185 mobilePosition.setDeviceId(deviceAlarm.getDeviceId()); 181 mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
186 mobilePosition.setTime(deviceAlarm.getAlarmTime()); 182 mobilePosition.setTime(deviceAlarm.getAlarmTime());
@@ -245,7 +241,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -245,7 +241,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
245 DeviceChannel deviceChannel = new DeviceChannel(); 241 DeviceChannel deviceChannel = new DeviceChannel();
246 deviceChannel.setName(channelName); 242 deviceChannel.setName(channelName);
247 deviceChannel.setChannelId(channelDeviceId); 243 deviceChannel.setChannelId(channelDeviceId);
248 - // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理 244 + // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理
249 if (status.equals("ON") || status.equals("On") || status.equals("ONLINE")) { 245 if (status.equals("ON") || status.equals("On") || status.equals("ONLINE")) {
250 deviceChannel.setStatus(1); 246 deviceChannel.setStatus(1);
251 } 247 }
@@ -259,29 +255,34 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -259,29 +255,34 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
259 deviceChannel.setCivilCode(XmlUtil.getText(itemDevice, "CivilCode")); 255 deviceChannel.setCivilCode(XmlUtil.getText(itemDevice, "CivilCode"));
260 deviceChannel.setBlock(XmlUtil.getText(itemDevice, "Block")); 256 deviceChannel.setBlock(XmlUtil.getText(itemDevice, "Block"));
261 deviceChannel.setAddress(XmlUtil.getText(itemDevice, "Address")); 257 deviceChannel.setAddress(XmlUtil.getText(itemDevice, "Address"));
262 - if (XmlUtil.getText(itemDevice, "Parental") == null || XmlUtil.getText(itemDevice, "Parental") == "") { 258 + if (XmlUtil.getText(itemDevice, "Parental") == null
  259 + || XmlUtil.getText(itemDevice, "Parental") == "") {
263 deviceChannel.setParental(0); 260 deviceChannel.setParental(0);
264 } else { 261 } else {
265 deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); 262 deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")));
266 - } 263 + }
267 deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); 264 deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID"));
268 - if (XmlUtil.getText(itemDevice, "SafetyWay") == null || XmlUtil.getText(itemDevice, "SafetyWay")== "") { 265 + if (XmlUtil.getText(itemDevice, "SafetyWay") == null
  266 + || XmlUtil.getText(itemDevice, "SafetyWay") == "") {
269 deviceChannel.setSafetyWay(0); 267 deviceChannel.setSafetyWay(0);
270 } else { 268 } else {
271 deviceChannel.setSafetyWay(Integer.parseInt(XmlUtil.getText(itemDevice, "SafetyWay"))); 269 deviceChannel.setSafetyWay(Integer.parseInt(XmlUtil.getText(itemDevice, "SafetyWay")));
272 } 270 }
273 - if (XmlUtil.getText(itemDevice, "RegisterWay") == null || XmlUtil.getText(itemDevice, "RegisterWay") =="") { 271 + if (XmlUtil.getText(itemDevice, "RegisterWay") == null
  272 + || XmlUtil.getText(itemDevice, "RegisterWay") == "") {
274 deviceChannel.setRegisterWay(1); 273 deviceChannel.setRegisterWay(1);
275 } else { 274 } else {
276 deviceChannel.setRegisterWay(Integer.parseInt(XmlUtil.getText(itemDevice, "RegisterWay"))); 275 deviceChannel.setRegisterWay(Integer.parseInt(XmlUtil.getText(itemDevice, "RegisterWay")));
277 } 276 }
278 deviceChannel.setCertNum(XmlUtil.getText(itemDevice, "CertNum")); 277 deviceChannel.setCertNum(XmlUtil.getText(itemDevice, "CertNum"));
279 - if (XmlUtil.getText(itemDevice, "Certifiable") == null || XmlUtil.getText(itemDevice, "Certifiable") == "") { 278 + if (XmlUtil.getText(itemDevice, "Certifiable") == null
  279 + || XmlUtil.getText(itemDevice, "Certifiable") == "") {
280 deviceChannel.setCertifiable(0); 280 deviceChannel.setCertifiable(0);
281 } else { 281 } else {
282 deviceChannel.setCertifiable(Integer.parseInt(XmlUtil.getText(itemDevice, "Certifiable"))); 282 deviceChannel.setCertifiable(Integer.parseInt(XmlUtil.getText(itemDevice, "Certifiable")));
283 } 283 }
284 - if (XmlUtil.getText(itemDevice, "ErrCode") == null || XmlUtil.getText(itemDevice, "ErrCode") == "") { 284 + if (XmlUtil.getText(itemDevice, "ErrCode") == null
  285 + || XmlUtil.getText(itemDevice, "ErrCode") == "") {
285 deviceChannel.setErrCode(0); 286 deviceChannel.setErrCode(0);
286 } else { 287 } else {
287 deviceChannel.setErrCode(Integer.parseInt(XmlUtil.getText(itemDevice, "ErrCode"))); 288 deviceChannel.setErrCode(Integer.parseInt(XmlUtil.getText(itemDevice, "ErrCode")));
@@ -289,7 +290,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -289,7 +290,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
289 deviceChannel.setEndTime(XmlUtil.getText(itemDevice, "EndTime")); 290 deviceChannel.setEndTime(XmlUtil.getText(itemDevice, "EndTime"));
290 deviceChannel.setSecrecy(XmlUtil.getText(itemDevice, "Secrecy")); 291 deviceChannel.setSecrecy(XmlUtil.getText(itemDevice, "Secrecy"));
291 deviceChannel.setIpAddress(XmlUtil.getText(itemDevice, "IPAddress")); 292 deviceChannel.setIpAddress(XmlUtil.getText(itemDevice, "IPAddress"));
292 - if (XmlUtil.getText(itemDevice, "Port") == null || XmlUtil.getText(itemDevice, "Port") =="") { 293 + if (XmlUtil.getText(itemDevice, "Port") == null || XmlUtil.getText(itemDevice, "Port") == "") {
293 deviceChannel.setPort(0); 294 deviceChannel.setPort(0);
294 } else { 295 } else {
295 deviceChannel.setPort(Integer.parseInt(XmlUtil.getText(itemDevice, "Port"))); 296 deviceChannel.setPort(Integer.parseInt(XmlUtil.getText(itemDevice, "Port")));
@@ -305,7 +306,8 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -305,7 +306,8 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
305 } else { 306 } else {
306 deviceChannel.setLatitude(0.00); 307 deviceChannel.setLatitude(0.00);
307 } 308 }
308 - if (XmlUtil.getText(itemDevice, "PTZType") == null || XmlUtil.getText(itemDevice, "PTZType") == "") { 309 + if (XmlUtil.getText(itemDevice, "PTZType") == null
  310 + || XmlUtil.getText(itemDevice, "PTZType") == "") {
309 deviceChannel.setPTZType(0); 311 deviceChannel.setPTZType(0);
310 } else { 312 } else {
311 deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType"))); 313 deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType")));
@@ -330,9 +332,9 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -330,9 +332,9 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
330 } 332 }
331 } 333 }
332 334
333 -  
334 - /*** 335 + /***
335 * 回复200 OK 336 * 回复200 OK
  337 + *
336 * @param evt 338 * @param evt
337 * @throws SipException 339 * @throws SipException
338 * @throws InvalidArgumentException 340 * @throws InvalidArgumentException
@@ -343,7 +345,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -343,7 +345,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
343 getServerTransaction(evt).sendResponse(response); 345 getServerTransaction(evt).sendResponse(response);
344 } 346 }
345 347
346 - private Element getRootElement(RequestEvent evt) throws DocumentException { 348 + private Element getRootElement(RequestEvent evt) throws DocumentException {
347 Request request = evt.getRequest(); 349 Request request = evt.getRequest();
348 SAXReader reader = new SAXReader(); 350 SAXReader reader = new SAXReader();
349 reader.setEncoding("gbk"); 351 reader.setEncoding("gbk");
@@ -352,7 +354,6 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -352,7 +354,6 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
352 } 354 }
353 355
354 public void setCmder(SIPCommander cmder) { 356 public void setCmder(SIPCommander cmder) {
355 - this.cmder = cmder;  
356 } 357 }
357 358
358 public void setStorager(IVideoManagerStorager storager) { 359 public void setStorager(IVideoManagerStorager storager) {
@@ -364,11 +365,9 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor { @@ -364,11 +365,9 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
364 } 365 }
365 366
366 public void setRedis(RedisUtil redis) { 367 public void setRedis(RedisUtil redis) {
367 - this.redis = redis;  
368 } 368 }
369 369
370 public void setDeferredResultHolder(DeferredResultHolder deferredResultHolder) { 370 public void setDeferredResultHolder(DeferredResultHolder deferredResultHolder) {
371 - this.deferredResultHolder = deferredResultHolder;  
372 } 371 }
373 372
374 public void setOffLineDetector(DeviceOffLineDetector offLineDetector) { 373 public void setOffLineDetector(DeviceOffLineDetector offLineDetector) {
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
@@ -145,7 +145,7 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor { @@ -145,7 +145,7 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
145 // 下发catelog查询目录 145 // 下发catelog查询目录
146 if (registerFlag == 1 && device != null) { 146 if (registerFlag == 1 && device != null) {
147 logger.info("注册成功! deviceId:" + device.getDeviceId()); 147 logger.info("注册成功! deviceId:" + device.getDeviceId());
148 - boolean exists = storager.exists(device.getDeviceId()); 148 + // boolean exists = storager.exists(device.getDeviceId());
149 device.setRegisterTimeMillis(System.currentTimeMillis()); 149 device.setRegisterTimeMillis(System.currentTimeMillis());
150 storager.updateDevice(device); 150 storager.updateDevice(device);
151 publisher.onlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_ONLINE_REGISTER); 151 publisher.onlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_ONLINE_REGISTER);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/InviteResponseProcessor.java
@@ -12,14 +12,12 @@ import javax.sip.header.ViaHeader; @@ -12,14 +12,12 @@ import javax.sip.header.ViaHeader;
12 import javax.sip.message.Request; 12 import javax.sip.message.Request;
13 import javax.sip.message.Response; 13 import javax.sip.message.Response;
14 14
15 -import gov.nist.javax.sip.header.CSeq;  
16 -import org.slf4j.Logger;  
17 -import org.slf4j.LoggerFactory; 15 +// import org.slf4j.Logger;
  16 +// import org.slf4j.LoggerFactory;
18 import org.springframework.stereotype.Component; 17 import org.springframework.stereotype.Component;
19 18
20 import com.genersoft.iot.vmp.conf.SipConfig; 19 import com.genersoft.iot.vmp.conf.SipConfig;
21 import com.genersoft.iot.vmp.gb28181.SipLayer; 20 import com.genersoft.iot.vmp.gb28181.SipLayer;
22 -import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorFactory;  
23 import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor; 21 import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor;
24 22
25 23
@@ -31,7 +29,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor; @@ -31,7 +29,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor;
31 @Component 29 @Component
32 public class InviteResponseProcessor implements ISIPResponseProcessor { 30 public class InviteResponseProcessor implements ISIPResponseProcessor {
33 31
34 - private final static Logger logger = LoggerFactory.getLogger(InviteResponseProcessor.class); 32 + // private final static Logger logger = LoggerFactory.getLogger(InviteResponseProcessor.class);
35 33
36 /** 34 /**
37 * 处理invite响应 35 * 处理invite响应
src/main/java/com/genersoft/iot/vmp/gb28181/utils/NumericUtil.java
@@ -15,10 +15,10 @@ public class NumericUtil { @@ -15,10 +15,10 @@ public class NumericUtil {
15 public static boolean isDouble(String str) { 15 public static boolean isDouble(String str) {
16 try { 16 try {
17 Double num2 = Double.valueOf(str); 17 Double num2 = Double.valueOf(str);
18 - System.out.println(num2 + " Is an Integer!"); 18 + System.out.println(num2 + " is a valid numeric string!");
19 return true; 19 return true;
20 } catch (Exception e) { 20 } catch (Exception e) {
21 - System.out.println(str + " Is not an Integer!"); 21 + System.out.println(str + " is an invalid numeric string!");
22 return false; 22 return false;
23 } 23 }
24 } 24 }
@@ -31,10 +31,10 @@ public class NumericUtil { @@ -31,10 +31,10 @@ public class NumericUtil {
31 public static boolean isInteger(String str) { 31 public static boolean isInteger(String str) {
32 try { 32 try {
33 int num2 = Integer.valueOf(str); 33 int num2 = Integer.valueOf(str);
34 - System.out.println(num2 + " Is Number!"); 34 + System.out.println(num2 + " is an integer!");
35 return true; 35 return true;
36 } catch (Exception e) { 36 } catch (Exception e) {
37 - System.out.println(str + " Is not Number!"); 37 + System.out.println(str + " is not an integer!");
38 return false; 38 return false;
39 } 39 }
40 } 40 }
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java
1 package com.genersoft.iot.vmp.media.zlm; 1 package com.genersoft.iot.vmp.media.zlm;
2 2
3 -import com.alibaba.fastjson.JSONObject;  
4 import com.genersoft.iot.vmp.conf.MediaServerConfig; 3 import com.genersoft.iot.vmp.conf.MediaServerConfig;
5 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 4 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
6 -import com.genersoft.iot.vmp.storager.IVideoManagerStorager;  
7 -import org.slf4j.Logger;  
8 -import org.slf4j.LoggerFactory; 5 +// import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
  6 +// import org.slf4j.Logger;
  7 +// import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.beans.factory.annotation.Value; 9 import org.springframework.beans.factory.annotation.Value;
11 -import org.springframework.http.HttpHeaders;  
12 -import org.springframework.http.HttpRequest;  
13 -import org.springframework.http.HttpStatus;  
14 -import org.springframework.http.ResponseEntity;  
15 import org.springframework.web.bind.annotation.*; 10 import org.springframework.web.bind.annotation.*;
16 import org.springframework.web.client.HttpClientErrorException; 11 import org.springframework.web.client.HttpClientErrorException;
17 import org.springframework.web.client.RestTemplate; 12 import org.springframework.web.client.RestTemplate;
18 13
19 import javax.servlet.http.HttpServletRequest; 14 import javax.servlet.http.HttpServletRequest;
20 import javax.servlet.http.HttpServletResponse; 15 import javax.servlet.http.HttpServletResponse;
21 -import java.util.Enumeration;  
22 16
23 @RestController 17 @RestController
24 @RequestMapping("/zlm") 18 @RequestMapping("/zlm")
25 public class ZLMHTTPProxyController { 19 public class ZLMHTTPProxyController {
26 20
27 21
28 - private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class); 22 + // private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class);
29 23
30 - @Autowired  
31 - private IVideoManagerStorager storager; 24 + // @Autowired
  25 + // private IVideoManagerStorager storager;
32 26
33 @Autowired 27 @Autowired
34 private IRedisCatchStorage redisCatchStorage; 28 private IRedisCatchStorage redisCatchStorage;
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
1 package com.genersoft.iot.vmp.media.zlm; 1 package com.genersoft.iot.vmp.media.zlm;
2 2
3 -import java.math.BigInteger;  
4 -import java.text.DecimalFormat;  
5 -import java.util.ArrayList;  
6 -import java.util.List;  
7 import java.util.UUID; 3 import java.util.UUID;
8 4
9 import com.alibaba.fastjson.JSON; 5 import com.alibaba.fastjson.JSON;
10 -import com.alibaba.fastjson.JSONArray;  
11 import com.genersoft.iot.vmp.common.StreamInfo; 6 import com.genersoft.iot.vmp.common.StreamInfo;
12 import com.genersoft.iot.vmp.conf.MediaServerConfig; 7 import com.genersoft.iot.vmp.conf.MediaServerConfig;
13 import com.genersoft.iot.vmp.gb28181.bean.Device; 8 import com.genersoft.iot.vmp.gb28181.bean.Device;
14 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 9 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
15 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
16 -import com.genersoft.iot.vmp.utils.IpUtil;  
17 import com.genersoft.iot.vmp.vmanager.service.IPlayService; 11 import com.genersoft.iot.vmp.vmanager.service.IPlayService;
18 import org.slf4j.Logger; 12 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
@@ -57,8 +51,8 @@ public class ZLMHttpHookListener { @@ -57,8 +51,8 @@ public class ZLMHttpHookListener {
57 @Autowired 51 @Autowired
58 private IRedisCatchStorage redisCatchStorage; 52 private IRedisCatchStorage redisCatchStorage;
59 53
60 - @Autowired  
61 - private ZLMRESTfulUtils zlmresTfulUtils; 54 + // @Autowired
  55 + // private ZLMRESTfulUtils zlmresTfulUtils;
62 56
63 @Autowired 57 @Autowired
64 private ZLMHttpHookSubscribe subscribe; 58 private ZLMHttpHookSubscribe subscribe;
@@ -86,9 +80,6 @@ public class ZLMHttpHookListener { @@ -86,9 +80,6 @@ public class ZLMHttpHookListener {
86 if (logger.isDebugEnabled()) { 80 if (logger.isDebugEnabled()) {
87 logger.debug("ZLM HOOK on_flow_report API调用,参数:" + json.toString()); 81 logger.debug("ZLM HOOK on_flow_report API调用,参数:" + json.toString());
88 } 82 }
89 - // TODO Auto-generated method stub  
90 -  
91 -  
92 JSONObject ret = new JSONObject(); 83 JSONObject ret = new JSONObject();
93 ret.put("code", 0); 84 ret.put("code", 0);
94 ret.put("msg", "success"); 85 ret.put("msg", "success");
@@ -106,8 +97,6 @@ public class ZLMHttpHookListener { @@ -106,8 +97,6 @@ public class ZLMHttpHookListener {
106 if (logger.isDebugEnabled()) { 97 if (logger.isDebugEnabled()) {
107 logger.debug("ZLM HOOK on_http_access API 调用,参数:" + json.toString()); 98 logger.debug("ZLM HOOK on_http_access API 调用,参数:" + json.toString());
108 } 99 }
109 - // TODO Auto-generated method stub  
110 -  
111 JSONObject ret = new JSONObject(); 100 JSONObject ret = new JSONObject();
112 ret.put("code", 0); 101 ret.put("code", 0);
113 ret.put("err", ""); 102 ret.put("err", "");
@@ -127,8 +116,6 @@ public class ZLMHttpHookListener { @@ -127,8 +116,6 @@ public class ZLMHttpHookListener {
127 if (logger.isDebugEnabled()) { 116 if (logger.isDebugEnabled()) {
128 logger.debug("ZLM HOOK on_play API调用,参数:" + json.toString()); 117 logger.debug("ZLM HOOK on_play API调用,参数:" + json.toString());
129 } 118 }
130 - // TODO Auto-generated method stub  
131 -  
132 JSONObject ret = new JSONObject(); 119 JSONObject ret = new JSONObject();
133 ret.put("code", 0); 120 ret.put("code", 0);
134 ret.put("msg", "success"); 121 ret.put("msg", "success");
@@ -146,15 +133,12 @@ public class ZLMHttpHookListener { @@ -146,15 +133,12 @@ public class ZLMHttpHookListener {
146 if (logger.isDebugEnabled()) { 133 if (logger.isDebugEnabled()) {
147 logger.debug("ZLM HOOK on_publish API调用,参数:" + json.toString()); 134 logger.debug("ZLM HOOK on_publish API调用,参数:" + json.toString());
148 } 135 }
149 - String app = json.getString("app");  
150 - String streamId = json.getString("id"); 136 + // String app = json.getString("app");
  137 + // String streamId = json.getString("id");
151 138
152 ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json); 139 ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json);
153 if (subscribe != null) subscribe.response(json); 140 if (subscribe != null) subscribe.response(json);
154 141
155 -  
156 - // TODO Auto-generated method stub  
157 -  
158 JSONObject ret = new JSONObject(); 142 JSONObject ret = new JSONObject();
159 ret.put("code", 0); 143 ret.put("code", 0);
160 ret.put("msg", "success"); 144 ret.put("msg", "success");
@@ -175,8 +159,6 @@ public class ZLMHttpHookListener { @@ -175,8 +159,6 @@ public class ZLMHttpHookListener {
175 if (logger.isDebugEnabled()) { 159 if (logger.isDebugEnabled()) {
176 logger.debug("ZLM HOOK on_record_mp4 API调用,参数:" + json.toString()); 160 logger.debug("ZLM HOOK on_record_mp4 API调用,参数:" + json.toString());
177 } 161 }
178 - // TODO Auto-generated method stub  
179 -  
180 JSONObject ret = new JSONObject(); 162 JSONObject ret = new JSONObject();
181 ret.put("code", 0); 163 ret.put("code", 0);
182 ret.put("msg", "success"); 164 ret.put("msg", "success");
@@ -194,8 +176,6 @@ public class ZLMHttpHookListener { @@ -194,8 +176,6 @@ public class ZLMHttpHookListener {
194 if (logger.isDebugEnabled()) { 176 if (logger.isDebugEnabled()) {
195 logger.debug("ZLM HOOK on_rtsp_realm API调用,参数:" + json.toString()); 177 logger.debug("ZLM HOOK on_rtsp_realm API调用,参数:" + json.toString());
196 } 178 }
197 - // TODO Auto-generated method stub  
198 -  
199 JSONObject ret = new JSONObject(); 179 JSONObject ret = new JSONObject();
200 ret.put("code", 0); 180 ret.put("code", 0);
201 ret.put("realm", ""); 181 ret.put("realm", "");
@@ -214,8 +194,6 @@ public class ZLMHttpHookListener { @@ -214,8 +194,6 @@ public class ZLMHttpHookListener {
214 if (logger.isDebugEnabled()) { 194 if (logger.isDebugEnabled()) {
215 logger.debug("ZLM HOOK on_rtsp_auth API调用,参数:" + json.toString()); 195 logger.debug("ZLM HOOK on_rtsp_auth API调用,参数:" + json.toString());
216 } 196 }
217 - // TODO Auto-generated method stub  
218 -  
219 JSONObject ret = new JSONObject(); 197 JSONObject ret = new JSONObject();
220 ret.put("code", 0); 198 ret.put("code", 0);
221 ret.put("encrypted", false); 199 ret.put("encrypted", false);
@@ -234,8 +212,6 @@ public class ZLMHttpHookListener { @@ -234,8 +212,6 @@ public class ZLMHttpHookListener {
234 if (logger.isDebugEnabled()) { 212 if (logger.isDebugEnabled()) {
235 logger.debug("ZLM HOOK on_shell_login API调用,参数:" + json.toString()); 213 logger.debug("ZLM HOOK on_shell_login API调用,参数:" + json.toString());
236 } 214 }
237 - // TODO Auto-generated method stub  
238 -  
239 JSONObject ret = new JSONObject(); 215 JSONObject ret = new JSONObject();
240 ret.put("code", 0); 216 ret.put("code", 0);
241 ret.put("msg", "success"); 217 ret.put("msg", "success");
@@ -267,8 +243,6 @@ public class ZLMHttpHookListener { @@ -267,8 +243,6 @@ public class ZLMHttpHookListener {
267 redisCatchStorage.stopPlayback(streamInfo); 243 redisCatchStorage.stopPlayback(streamInfo);
268 } 244 }
269 } 245 }
270 -  
271 -  
272 JSONObject ret = new JSONObject(); 246 JSONObject ret = new JSONObject();
273 ret.put("code", 0); 247 ret.put("code", 0);
274 ret.put("msg", "success"); 248 ret.put("msg", "success");
@@ -316,8 +290,6 @@ public class ZLMHttpHookListener { @@ -316,8 +290,6 @@ public class ZLMHttpHookListener {
316 if (logger.isDebugEnabled()) { 290 if (logger.isDebugEnabled()) {
317 logger.debug("ZLM HOOK on_stream_not_found API调用,参数:" + json.toString()); 291 logger.debug("ZLM HOOK on_stream_not_found API调用,参数:" + json.toString());
318 } 292 }
319 - // TODO Auto-generated method stub  
320 -  
321 if (autoApplyPlay) { 293 if (autoApplyPlay) {
322 String app = json.getString("app"); 294 String app = json.getString("app");
323 String streamId = json.getString("stream"); 295 String streamId = json.getString("stream");
@@ -367,8 +339,6 @@ public class ZLMHttpHookListener { @@ -367,8 +339,6 @@ public class ZLMHttpHookListener {
367 mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp); 339 mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp);
368 mediaServerConfig.setLocalIP(mediaIp); 340 mediaServerConfig.setLocalIP(mediaIp);
369 redisCatchStorage.updateMediaInfo(mediaServerConfig); 341 redisCatchStorage.updateMediaInfo(mediaServerConfig);
370 - // TODO Auto-generated method stub  
371 -  
372 JSONObject ret = new JSONObject(); 342 JSONObject ret = new JSONObject();
373 ret.put("code", 0); 343 ret.put("code", 0);
374 ret.put("msg", "success"); 344 ret.put("msg", "success");
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java
1 package com.genersoft.iot.vmp.media.zlm; 1 package com.genersoft.iot.vmp.media.zlm;
2 2
3 -import com.alibaba.fastjson.JSON;  
4 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
5 -import com.genersoft.iot.vmp.common.StreamInfo;  
6 -import com.genersoft.iot.vmp.conf.MediaServerConfig;  
7 -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;  
8 -import com.genersoft.iot.vmp.storager.IVideoManagerStorager;  
9 -import org.slf4j.Logger;  
10 -import org.slf4j.LoggerFactory;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.beans.factory.annotation.Value;  
13 -import org.springframework.http.HttpStatus;  
14 -import org.springframework.http.ResponseEntity;  
15 import org.springframework.stereotype.Component; 4 import org.springframework.stereotype.Component;
16 -import org.springframework.util.ConcurrentReferenceHashMap;  
17 -import org.springframework.web.bind.annotation.*;  
18 5
19 -import javax.servlet.http.HttpServletRequest;  
20 -import java.math.BigInteger;  
21 -import java.text.DecimalFormat;  
22 import java.util.HashMap; 6 import java.util.HashMap;
23 import java.util.Map; 7 import java.util.Map;
24 import java.util.concurrent.ConcurrentHashMap; 8 import java.util.concurrent.ConcurrentHashMap;
@@ -31,8 +15,6 @@ import java.util.concurrent.ConcurrentHashMap; @@ -31,8 +15,6 @@ import java.util.concurrent.ConcurrentHashMap;
31 @Component 15 @Component
32 public class ZLMHttpHookSubscribe { 16 public class ZLMHttpHookSubscribe {
33 17
34 - private final static Logger logger = LoggerFactory.getLogger(ZLMHttpHookSubscribe.class);  
35 -  
36 public enum HookType{ 18 public enum HookType{
37 on_flow_report, 19 on_flow_report,
38 on_http_access, 20 on_http_access,
@@ -72,8 +54,6 @@ public class ZLMHttpHookSubscribe { @@ -72,8 +54,6 @@ public class ZLMHttpHookSubscribe {
72 for (JSONObject key : eventMap.keySet()) { 54 for (JSONObject key : eventMap.keySet()) {
73 Boolean result = null; 55 Boolean result = null;
74 for (String s : key.keySet()) { 56 for (String s : key.keySet()) {
75 - String string = hookResponse.getString(s);  
76 - String string1 = key.getString(s);  
77 if (result == null) { 57 if (result == null) {
78 result = key.getString(s).equals(hookResponse.getString(s)); 58 result = key.getString(s).equals(hookResponse.getString(s));
79 }else { 59 }else {
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component; @@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
11 import java.io.IOException; 11 import java.io.IOException;
12 import java.net.ConnectException; 12 import java.net.ConnectException;
13 import java.util.HashMap; 13 import java.util.HashMap;
14 -import java.util.HashSet;  
15 import java.util.Map; 14 import java.util.Map;
16 15
17 @Component 16 @Component
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java
@@ -5,8 +5,7 @@ import com.alibaba.fastjson.JSONArray; @@ -5,8 +5,7 @@ import com.alibaba.fastjson.JSONArray;
5 import com.alibaba.fastjson.JSONObject; 5 import com.alibaba.fastjson.JSONObject;
6 import com.genersoft.iot.vmp.conf.MediaServerConfig; 6 import com.genersoft.iot.vmp.conf.MediaServerConfig;
7 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 7 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
8 -import com.genersoft.iot.vmp.storager.IVideoManagerStorager;  
9 -import okhttp3.*; 8 +//import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
10 import org.slf4j.Logger; 9 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,9 +15,6 @@ import org.springframework.core.annotation.Order; @@ -16,9 +15,6 @@ import org.springframework.core.annotation.Order;
16 import org.springframework.stereotype.Component; 15 import org.springframework.stereotype.Component;
17 import org.springframework.util.StringUtils; 16 import org.springframework.util.StringUtils;
18 17
19 -import java.io.IOException;  
20 -import java.io.UnsupportedEncodingException;  
21 -import java.net.URLEncoder;  
22 import java.util.HashMap; 18 import java.util.HashMap;
23 import java.util.Map; 19 import java.util.Map;
24 20
@@ -28,8 +24,8 @@ public class ZLMRunner implements CommandLineRunner { @@ -28,8 +24,8 @@ public class ZLMRunner implements CommandLineRunner {
28 24
29 private final static Logger logger = LoggerFactory.getLogger(ZLMRunner.class); 25 private final static Logger logger = LoggerFactory.getLogger(ZLMRunner.class);
30 26
31 - @Autowired  
32 - private IVideoManagerStorager storager; 27 + // @Autowired
  28 + // private IVideoManagerStorager storager;
33 29
34 @Autowired 30 @Autowired
35 private IRedisCatchStorage redisCatchStorage; 31 private IRedisCatchStorage redisCatchStorage;
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
@@ -12,6 +12,7 @@ import com.github.pagehelper.PageInfo; @@ -12,6 +12,7 @@ import com.github.pagehelper.PageInfo;
12 * @author: swwheihei 12 * @author: swwheihei
13 * @date: 2020年5月6日 下午2:14:31 13 * @date: 2020年5月6日 下午2:14:31
14 */ 14 */
  15 +@SuppressWarnings("rawtypes")
15 public interface IVideoManagerStorager { 16 public interface IVideoManagerStorager {
16 17
17 /** 18 /**
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Component; 11 import org.springframework.stereotype.Component;
12 12
13 import java.util.HashMap; 13 import java.util.HashMap;
14 -import java.util.HashSet;  
15 import java.util.List; 14 import java.util.List;
16 import java.util.Map; 15 import java.util.Map;
17 16
@@ -144,9 +143,9 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { @@ -144,9 +143,9 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
144 143
145 @Override 144 @Override
146 public StreamInfo queryPlaybackByDevice(String deviceId, String code) { 145 public StreamInfo queryPlaybackByDevice(String deviceId, String code) {
147 - String format = String.format("%S_*_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,  
148 - deviceId,  
149 - code); 146 + // String format = String.format("%S_*_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
  147 + // deviceId,
  148 + // code);
150 List<Object> playLeys = redis.scan(String.format("%S_*_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX, 149 List<Object> playLeys = redis.scan(String.format("%S_*_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
151 deviceId, 150 deviceId,
152 code)); 151 code));
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -9,19 +9,18 @@ import com.genersoft.iot.vmp.storager.dao.DeviceMapper; @@ -9,19 +9,18 @@ import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
9 import com.genersoft.iot.vmp.storager.dao.DeviceMobilePositionMapper; 9 import com.genersoft.iot.vmp.storager.dao.DeviceMobilePositionMapper;
10 import com.github.pagehelper.PageHelper; 10 import com.github.pagehelper.PageHelper;
11 import com.github.pagehelper.PageInfo; 11 import com.github.pagehelper.PageInfo;
12 -import io.swagger.models.auth.In;  
13 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Component; 13 import org.springframework.stereotype.Component;
15 14
16 import com.genersoft.iot.vmp.gb28181.bean.Device; 15 import com.genersoft.iot.vmp.gb28181.bean.Device;
17 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 16 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
18 -import org.springframework.util.StringUtils;  
19 17
20 /** 18 /**
21 * @Description:视频设备数据存储-jdbc实现 19 * @Description:视频设备数据存储-jdbc实现
22 * @author: swwheihei 20 * @author: swwheihei
23 * @date: 2020年5月6日 下午2:31:42 21 * @date: 2020年5月6日 下午2:31:42
24 */ 22 */
  23 +@SuppressWarnings("rawtypes")
25 @Component 24 @Component
26 public class VideoManagerStoragerImpl implements IVideoManagerStorager { 25 public class VideoManagerStoragerImpl implements IVideoManagerStorager {
27 26
@@ -183,11 +182,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { @@ -183,11 +182,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
183 @Override 182 @Override
184 public synchronized boolean online(String deviceId) { 183 public synchronized boolean online(String deviceId) {
185 Device device = deviceMapper.getDeviceByDeviceId(deviceId); 184 Device device = deviceMapper.getDeviceByDeviceId(deviceId);
186 - device.setOnline(1);  
187 - System.out.println("更新设备在线");  
188 if (device == null) { 185 if (device == null) {
189 return false; 186 return false;
190 } 187 }
  188 + device.setOnline(1);
  189 + System.out.println("更新设备在线");
191 return deviceMapper.update(device) > 0; 190 return deviceMapper.update(device) > 0;
192 } 191 }
193 192
@@ -211,7 +210,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { @@ -211,7 +210,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
211 */ 210 */
212 @Override 211 @Override
213 public void cleanChannelsForDevice(String deviceId) { 212 public void cleanChannelsForDevice(String deviceId) {
214 - int result = deviceChannelMapper.cleanChannelsByDeviceId(deviceId); 213 + deviceChannelMapper.cleanChannelsByDeviceId(deviceId);
215 } 214 }
216 215
217 /** 216 /**
src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
@@ -4,8 +4,6 @@ import java.util.*; @@ -4,8 +4,6 @@ import java.util.*;
4 import java.util.concurrent.TimeUnit; 4 import java.util.concurrent.TimeUnit;
5 5
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
7 -import org.springframework.dao.DataAccessException;  
8 -import org.springframework.data.redis.connection.RedisConnection;  
9 import org.springframework.data.redis.core.*; 7 import org.springframework.data.redis.core.*;
10 import org.springframework.stereotype.Component; 8 import org.springframework.stereotype.Component;
11 import org.springframework.util.CollectionUtils; 9 import org.springframework.util.CollectionUtils;
@@ -16,6 +14,7 @@ import org.springframework.util.CollectionUtils; @@ -16,6 +14,7 @@ import org.springframework.util.CollectionUtils;
16 * @date: 2020年5月6日 下午8:27:29 14 * @date: 2020年5月6日 下午8:27:29
17 */ 15 */
18 @Component 16 @Component
  17 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
19 public class RedisUtil { 18 public class RedisUtil {
20 19
21 @Autowired 20 @Autowired
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceConfig.java
@@ -20,7 +20,6 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; @@ -20,7 +20,6 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
20 import org.slf4j.Logger; 20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 21 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
23 -import org.springframework.http.HttpStatus;  
24 import org.springframework.http.ResponseEntity; 23 import org.springframework.http.ResponseEntity;
25 import org.springframework.web.bind.annotation.*; 24 import org.springframework.web.bind.annotation.*;
26 import org.springframework.web.context.request.async.DeferredResult; 25 import org.springframework.web.context.request.async.DeferredResult;
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceQuery.java
@@ -17,11 +17,11 @@ import com.genersoft.iot.vmp.gb28181.bean.Device; @@ -17,11 +17,11 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
17 import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector; 17 import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector;
18 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; 18 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
19 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; 19 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
20 -import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;  
21 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 20 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
22 21
23 import javax.sip.message.Response; 22 import javax.sip.message.Response;
24 23
  24 +@SuppressWarnings("rawtypes")
25 @CrossOrigin 25 @CrossOrigin
26 @RestController 26 @RestController
27 @RequestMapping("/api") 27 @RequestMapping("/api")
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
1 package com.genersoft.iot.vmp.vmanager.play; 1 package com.genersoft.iot.vmp.vmanager.play;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 -import com.alibaba.fastjson.JSONArray;  
5 import com.genersoft.iot.vmp.common.StreamInfo; 4 import com.genersoft.iot.vmp.common.StreamInfo;
6 import com.genersoft.iot.vmp.conf.MediaServerConfig; 5 import com.genersoft.iot.vmp.conf.MediaServerConfig;
7 -import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;  
8 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; 6 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
9 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; 7 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
10 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; 8 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
11 -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;  
12 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 9 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
13 import com.genersoft.iot.vmp.vmanager.service.IPlayService; 10 import com.genersoft.iot.vmp.vmanager.service.IPlayService;
14 import org.slf4j.Logger; 11 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory; 12 import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
17 -import org.springframework.beans.factory.annotation.Value;  
18 import org.springframework.http.HttpStatus; 14 import org.springframework.http.HttpStatus;
19 import org.springframework.http.ResponseEntity; 15 import org.springframework.http.ResponseEntity;
20 import org.springframework.web.bind.annotation.CrossOrigin; 16 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -31,7 +27,6 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; @@ -31,7 +27,6 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
31 import org.springframework.web.context.request.async.DeferredResult; 27 import org.springframework.web.context.request.async.DeferredResult;
32 28
33 import javax.sip.message.Response; 29 import javax.sip.message.Response;
34 -import java.text.DecimalFormat;  
35 import java.util.UUID; 30 import java.util.UUID;
36 31
37 @CrossOrigin 32 @CrossOrigin
@@ -145,7 +140,7 @@ public class PlayController { @@ -145,7 +140,7 @@ public class PlayController {
145 storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); 140 storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
146 RequestMessage msg = new RequestMessage(); 141 RequestMessage msg = new RequestMessage();
147 msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid); 142 msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid);
148 - Response response = event.getResponse(); 143 + //Response response = event.getResponse();
149 msg.setData(String.format("success")); 144 msg.setData(String.format("success"));
150 resultHolder.invokeResult(msg); 145 resultHolder.invokeResult(msg);
151 } 146 }
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java
1 package com.genersoft.iot.vmp.vmanager.playback; 1 package com.genersoft.iot.vmp.vmanager.playback;
2 2
3 -import com.alibaba.fastjson.JSON;  
4 -import com.alibaba.fastjson.JSONArray;  
5 import com.genersoft.iot.vmp.common.StreamInfo; 3 import com.genersoft.iot.vmp.common.StreamInfo;
6 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; 4 import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
7 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; 5 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
8 -import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; 6 +//import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
9 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 7 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
10 import com.genersoft.iot.vmp.vmanager.service.IPlayService; 8 import com.genersoft.iot.vmp.vmanager.service.IPlayService;
11 import org.slf4j.Logger; 9 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
14 -import org.springframework.beans.factory.annotation.Value;  
15 import org.springframework.http.HttpStatus; 12 import org.springframework.http.HttpStatus;
16 import org.springframework.http.ResponseEntity; 13 import org.springframework.http.ResponseEntity;
17 -import org.springframework.util.StringUtils;  
18 import org.springframework.web.bind.annotation.CrossOrigin; 14 import org.springframework.web.bind.annotation.CrossOrigin;
19 import org.springframework.web.bind.annotation.GetMapping; 15 import org.springframework.web.bind.annotation.GetMapping;
20 import org.springframework.web.bind.annotation.PathVariable; 16 import org.springframework.web.bind.annotation.PathVariable;
21 -import org.springframework.web.bind.annotation.PostMapping;  
22 import org.springframework.web.bind.annotation.RequestMapping; 17 import org.springframework.web.bind.annotation.RequestMapping;
23 import org.springframework.web.bind.annotation.RestController; 18 import org.springframework.web.bind.annotation.RestController;
24 19
@@ -47,8 +42,8 @@ public class PlaybackController { @@ -47,8 +42,8 @@ public class PlaybackController {
47 @Autowired 42 @Autowired
48 private IRedisCatchStorage redisCatchStorage; 43 private IRedisCatchStorage redisCatchStorage;
49 44
50 - @Autowired  
51 - private ZLMRESTfulUtils zlmresTfulUtils; 45 + // @Autowired
  46 + // private ZLMRESTfulUtils zlmresTfulUtils;
52 47
53 @Autowired 48 @Autowired
54 private IPlayService playService; 49 private IPlayService playService;
src/main/java/com/genersoft/iot/vmp/vmanager/service/IPlayService.java
1 package com.genersoft.iot.vmp.vmanager.service; 1 package com.genersoft.iot.vmp.vmanager.service;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 -import com.genersoft.iot.vmp.common.StreamInfo;  
5 4
6 /** 5 /**
7 * 点播处理 6 * 点播处理
src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java
@@ -9,15 +9,12 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; @@ -9,15 +9,12 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
9 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; 9 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
11 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 11 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
12 -import com.genersoft.iot.vmp.vmanager.play.PlayController;  
13 import com.genersoft.iot.vmp.vmanager.service.IPlayService; 12 import com.genersoft.iot.vmp.vmanager.service.IPlayService;
14 import org.slf4j.Logger; 13 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.stereotype.Service; 16 import org.springframework.stereotype.Service;
18 17
19 -import java.text.DecimalFormat;  
20 -  
21 @Service 18 @Service
22 public class PlayServiceImpl implements IPlayService { 19 public class PlayServiceImpl implements IPlayService {
23 20
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
1 package com.genersoft.iot.vmp.vmanager.user; 1 package com.genersoft.iot.vmp.vmanager.user;
2 2
3 -import com.genersoft.iot.vmp.vmanager.play.PlayController;  
4 -import org.slf4j.Logger;  
5 -import org.slf4j.LoggerFactory;  
6 import org.springframework.beans.factory.annotation.Value; 3 import org.springframework.beans.factory.annotation.Value;
7 import org.springframework.util.StringUtils; 4 import org.springframework.util.StringUtils;
8 import org.springframework.web.bind.annotation.CrossOrigin; 5 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -14,9 +11,6 @@ import org.springframework.web.bind.annotation.RestController; @@ -14,9 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
14 @RequestMapping("/api") 11 @RequestMapping("/api")
15 public class UserController { 12 public class UserController {
16 13
17 - private final static Logger logger = LoggerFactory.getLogger(UserController.class);  
18 -  
19 -  
20 @Value("${auth.username}") 14 @Value("${auth.username}")
21 private String usernameConfig; 15 private String usernameConfig;
22 16
src/main/java/com/genersoft/iot/vmp/web/ApiControlController.java
@@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSONObject; @@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSONObject;
4 import com.genersoft.iot.vmp.gb28181.bean.Device; 4 import com.genersoft.iot.vmp.gb28181.bean.Device;
5 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; 5 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
6 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 6 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
7 -import com.genersoft.iot.vmp.vmanager.ptz.PtzController;  
8 import org.slf4j.Logger; 7 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
11 -import org.springframework.http.HttpStatus;  
12 -import org.springframework.http.ResponseEntity;  
13 import org.springframework.web.bind.annotation.*; 10 import org.springframework.web.bind.annotation.*;
14 11
15 /** 12 /**
src/main/java/com/genersoft/iot/vmp/web/ApiController.java
@@ -5,11 +5,9 @@ import com.genersoft.iot.vmp.conf.SipConfig; @@ -5,11 +5,9 @@ import com.genersoft.iot.vmp.conf.SipConfig;
5 import org.slf4j.Logger; 5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 -import org.springframework.beans.factory.annotation.Value;  
9 import org.springframework.stereotype.Controller; 8 import org.springframework.stereotype.Controller;
10 import org.springframework.web.bind.annotation.CrossOrigin; 9 import org.springframework.web.bind.annotation.CrossOrigin;
11 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
12 -import org.springframework.web.bind.annotation.RequestParam;  
13 import org.springframework.web.bind.annotation.ResponseBody; 11 import org.springframework.web.bind.annotation.ResponseBody;
14 12
15 /** 13 /**
src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java
@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONArray; @@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONArray;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
5 import com.genersoft.iot.vmp.gb28181.bean.Device; 5 import com.genersoft.iot.vmp.gb28181.bean.Device;
6 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; 6 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
7 -import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector;  
8 -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;  
9 -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; 7 +// import com.genersoft.iot.vmp.gb28181.event.DeviceOffLineDetector;
  8 +// import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
  9 +// import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
10 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
11 import com.github.pagehelper.PageInfo; 11 import com.github.pagehelper.PageInfo;
12 import org.slf4j.Logger; 12 import org.slf4j.Logger;
@@ -19,6 +19,7 @@ import java.util.List; @@ -19,6 +19,7 @@ import java.util.List;
19 /** 19 /**
20 * 兼容LiveGBS的API:设备信息 20 * 兼容LiveGBS的API:设备信息
21 */ 21 */
  22 +@SuppressWarnings("unchecked")
22 @CrossOrigin 23 @CrossOrigin
23 @RestController 24 @RestController
24 @RequestMapping(value = "/api/v1/device") 25 @RequestMapping(value = "/api/v1/device")
@@ -29,14 +30,14 @@ public class ApiDeviceController { @@ -29,14 +30,14 @@ public class ApiDeviceController {
29 @Autowired 30 @Autowired
30 private IVideoManagerStorager storager; 31 private IVideoManagerStorager storager;
31 32
32 - @Autowired  
33 - private SIPCommander cmder; 33 + // @Autowired
  34 + // private SIPCommander cmder;
34 35
35 - @Autowired  
36 - private DeferredResultHolder resultHolder; 36 + // @Autowired
  37 + // private DeferredResultHolder resultHolder;
37 38
38 - @Autowired  
39 - private DeviceOffLineDetector offLineDetector; 39 + // @Autowired
  40 + // private DeviceOffLineDetector offLineDetector;
40 41
41 /** 42 /**
42 * 分页获取设备列表 TODO 现在直接返回,尚未实现分页 43 * 分页获取设备列表 TODO 现在直接返回,尚未实现分页
src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java
1 package com.genersoft.iot.vmp.web; 1 package com.genersoft.iot.vmp.web;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 -import com.alibaba.fastjson.JSONArray;  
5 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
6 import com.genersoft.iot.vmp.common.StreamInfo; 5 import com.genersoft.iot.vmp.common.StreamInfo;
7 import com.genersoft.iot.vmp.gb28181.bean.Device; 6 import com.genersoft.iot.vmp.gb28181.bean.Device;
8 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; 7 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
9 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; 8 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
10 -import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; 9 +// import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
11 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 10 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
12 import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 11 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
13 import com.genersoft.iot.vmp.vmanager.play.PlayController; 12 import com.genersoft.iot.vmp.vmanager.play.PlayController;
14 import org.slf4j.Logger; 13 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
17 -import org.springframework.beans.factory.annotation.Value;  
18 -import org.springframework.http.HttpStatus;  
19 import org.springframework.http.ResponseEntity; 16 import org.springframework.http.ResponseEntity;
20 import org.springframework.web.bind.annotation.*; 17 import org.springframework.web.bind.annotation.*;
21 import org.springframework.web.context.request.async.DeferredResult; 18 import org.springframework.web.context.request.async.DeferredResult;
@@ -23,6 +20,7 @@ import org.springframework.web.context.request.async.DeferredResult; @@ -23,6 +20,7 @@ import org.springframework.web.context.request.async.DeferredResult;
23 /** 20 /**
24 * 兼容LiveGBS的API:实时直播 21 * 兼容LiveGBS的API:实时直播
25 */ 22 */
  23 +@SuppressWarnings(value = {"rawtypes", "unchecked"})
26 @CrossOrigin 24 @CrossOrigin
27 @RestController 25 @RestController
28 @RequestMapping(value = "/api/v1/stream") 26 @RequestMapping(value = "/api/v1/stream")
@@ -40,8 +38,8 @@ public class ApiStreamController { @@ -40,8 +38,8 @@ public class ApiStreamController {
40 private IRedisCatchStorage redisCatchStorage; 38 private IRedisCatchStorage redisCatchStorage;
41 39
42 40
43 - @Autowired  
44 - private ZLMRESTfulUtils zlmresTfulUtils; 41 + // @Autowired
  42 + // private ZLMRESTfulUtils zlmresTfulUtils;
45 43
46 44
47 @Autowired 45 @Autowired
src/main/java/com/genersoft/iot/vmp/web/AuthController.java
1 package com.genersoft.iot.vmp.web; 1 package com.genersoft.iot.vmp.web;
2 2
3 -import com.genersoft.iot.vmp.gb28181.bean.Device;  
4 import org.springframework.beans.factory.annotation.Value; 3 import org.springframework.beans.factory.annotation.Value;
5 -import org.springframework.http.ResponseEntity;  
6 -import org.springframework.stereotype.Controller;  
7 import org.springframework.util.StringUtils; 4 import org.springframework.util.StringUtils;
8 import org.springframework.web.bind.annotation.*; 5 import org.springframework.web.bind.annotation.*;
9 6