Commit e2ce28347aaa35bce29c2683158f8882c62d3a32
1 parent
52ef9a84
优化注释
Showing
13 changed files
with
108 additions
and
30 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
| @@ -25,10 +25,8 @@ import javax.sip.header.ToHeader; | @@ -25,10 +25,8 @@ import javax.sip.header.ToHeader; | ||
| 25 | import java.util.HashMap; | 25 | import java.util.HashMap; |
| 26 | import java.util.Map; | 26 | import java.util.Map; |
| 27 | 27 | ||
| 28 | -/** | ||
| 29 | - * @description:ACK请求处理器 | ||
| 30 | - * @author: swwheihei | ||
| 31 | - * @date: 2020年5月3日 下午5:31:45 | 28 | +/** |
| 29 | + * SIP命令类型: ACK请求 | ||
| 32 | */ | 30 | */ |
| 33 | @Component | 31 | @Component |
| 34 | public class AckRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 32 | public class AckRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
| @@ -28,10 +28,8 @@ import java.text.ParseException; | @@ -28,10 +28,8 @@ import java.text.ParseException; | ||
| 28 | import java.util.HashMap; | 28 | import java.util.HashMap; |
| 29 | import java.util.Map; | 29 | import java.util.Map; |
| 30 | 30 | ||
| 31 | -/** | ||
| 32 | - * @description: BYE请求处理器 | ||
| 33 | - * @author: lawrencehj | ||
| 34 | - * @date: 2021年3月9日 | 31 | +/** |
| 32 | + * SIP命令类型: BYE请求 | ||
| 35 | */ | 33 | */ |
| 36 | @Component | 34 | @Component |
| 37 | public class ByeRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 35 | public class ByeRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/CancelRequestProcessor.java
| @@ -9,10 +9,8 @@ import org.springframework.stereotype.Component; | @@ -9,10 +9,8 @@ import org.springframework.stereotype.Component; | ||
| 9 | 9 | ||
| 10 | import javax.sip.RequestEvent; | 10 | import javax.sip.RequestEvent; |
| 11 | 11 | ||
| 12 | -/** | ||
| 13 | - * @description:CANCEL请求处理器 | ||
| 14 | - * @author: swwheihei | ||
| 15 | - * @date: 2020年5月3日 下午5:32:23 | 12 | +/** |
| 13 | + * SIP命令类型: CANCEL请求 | ||
| 16 | */ | 14 | */ |
| 17 | @Component | 15 | @Component |
| 18 | public class CancelRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 16 | public class CancelRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| @@ -33,10 +33,8 @@ import javax.sip.message.Response; | @@ -33,10 +33,8 @@ import javax.sip.message.Response; | ||
| 33 | import java.text.ParseException; | 33 | import java.text.ParseException; |
| 34 | import java.util.Vector; | 34 | import java.util.Vector; |
| 35 | 35 | ||
| 36 | -/** | ||
| 37 | - * @description:处理INVITE请求 | ||
| 38 | - * @author: panll | ||
| 39 | - * @date: 2021年1月14日 | 36 | +/** |
| 37 | + * SIP命令类型: INVITE请求 | ||
| 40 | */ | 38 | */ |
| 41 | @SuppressWarnings("rawtypes") | 39 | @SuppressWarnings("rawtypes") |
| 42 | @Component | 40 | @Component |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
| @@ -35,9 +35,7 @@ import java.text.ParseException; | @@ -35,9 +35,7 @@ import java.text.ParseException; | ||
| 35 | import java.util.Iterator; | 35 | import java.util.Iterator; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | - * @description: Notify请求处理器 | ||
| 39 | - * @author: lawrencehj | ||
| 40 | - * @date: 2021年1月27日 | 38 | + * SIP命令类型: NOTIFY请求 |
| 41 | */ | 39 | */ |
| 42 | @Component | 40 | @Component |
| 43 | public class NotifyRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 41 | public class NotifyRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| @@ -35,10 +35,8 @@ import java.text.ParseException; | @@ -35,10 +35,8 @@ import java.text.ParseException; | ||
| 35 | import java.util.Calendar; | 35 | import java.util.Calendar; |
| 36 | import java.util.Locale; | 36 | import java.util.Locale; |
| 37 | 37 | ||
| 38 | -/** | ||
| 39 | - * @description:收到注册请求 处理 | ||
| 40 | - * @author: swwheihei | ||
| 41 | - * @date: 2020年5月3日 下午4:47:25 | 38 | +/** |
| 39 | + * SIP命令类型: REGISTER请求 | ||
| 42 | */ | 40 | */ |
| 43 | @Component | 41 | @Component |
| 44 | public class RegisterRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 42 | public class RegisterRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
| @@ -18,10 +18,8 @@ import javax.sip.message.Request; | @@ -18,10 +18,8 @@ import javax.sip.message.Request; | ||
| 18 | import javax.sip.message.Response; | 18 | import javax.sip.message.Response; |
| 19 | import java.text.ParseException; | 19 | import java.text.ParseException; |
| 20 | 20 | ||
| 21 | -/** | ||
| 22 | - * @description:SUBSCRIBE请求处理器 | ||
| 23 | - * @author: swwheihei | ||
| 24 | - * @date: 2020年5月3日 下午5:31:20 | 21 | +/** |
| 22 | + * SIP命令类型: SUBSCRIBE请求 | ||
| 25 | */ | 23 | */ |
| 26 | @Component | 24 | @Component |
| 27 | public class SubscribeRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { | 25 | public class SubscribeRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/ControlMessageHandler.java
| @@ -6,6 +6,12 @@ import org.springframework.beans.factory.InitializingBean; | @@ -6,6 +6,12 @@ import org.springframework.beans.factory.InitializingBean; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * 命令类型: 控制命令 | ||
| 11 | + * 命令类型: 设备控制: 远程启动, 录像控制(TODO), 报警布防/撤防命令(TODO), 报警复位命令(TODO), | ||
| 12 | + * 强制关键帧命令(TODO), 拉框放大/缩小控制命令(TODO), 看守位控制(TODO), 报警复位(TODO) | ||
| 13 | + * 命令类型: 设备配置: SVAC编码配置(TODO), 音频参数(TODO), SVAC解码配置(TODO) | ||
| 14 | + */ | ||
| 9 | @Component | 15 | @Component |
| 10 | public class ControlMessageHandler extends MessageHandlerAbstract implements InitializingBean { | 16 | public class ControlMessageHandler extends MessageHandlerAbstract implements InitializingBean { |
| 11 | 17 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/NotifyMessageHandler.java
| @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * 命令类型: 通知命令 | ||
| 11 | + * 命令类型: 状态信息(心跳)报送, 报警通知, 媒体通知, 移动设备位置数据,语音广播通知(TODO), 设备预置位(TODO) | ||
| 12 | + */ | ||
| 9 | @Component | 13 | @Component |
| 10 | public class NotifyMessageHandler extends MessageHandlerAbstract implements InitializingBean { | 14 | public class NotifyMessageHandler extends MessageHandlerAbstract implements InitializingBean { |
| 11 | 15 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
| @@ -46,9 +46,6 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | @@ -46,9 +46,6 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | ||
| 46 | @Autowired | 46 | @Autowired |
| 47 | private SipConfig config; | 47 | private SipConfig config; |
| 48 | 48 | ||
| 49 | - @Autowired | ||
| 50 | - private EventPublisher publisher; | ||
| 51 | - | ||
| 52 | @Override | 49 | @Override |
| 53 | public void afterPropertiesSet() throws Exception { | 50 | public void afterPropertiesSet() throws Exception { |
| 54 | notifyMessageHandler.addHandler(cmdType, this); | 51 | notifyMessageHandler.addHandler(cmdType, this); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/QueryMessageHandler.java
| @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * 命令类型: 查询指令 | ||
| 11 | + * 命令类型: 设备状态, 设备目录信息, 设备信息, 文件目录检索(TODO), 报警(TODO), 设备配置(TODO), 设备预置位(TODO), 移动设备位置数据(TODO) | ||
| 12 | + */ | ||
| 9 | @Component | 13 | @Component |
| 10 | public class QueryMessageHandler extends MessageHandlerAbstract implements InitializingBean { | 14 | public class QueryMessageHandler extends MessageHandlerAbstract implements InitializingBean { |
| 11 | 15 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/AlarmQueryMessageHandler.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd; | ||
| 2 | + | ||
| 3 | +import com.genersoft.iot.vmp.conf.SipConfig; | ||
| 4 | +import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 5 | +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | ||
| 6 | +import com.genersoft.iot.vmp.gb28181.bean.GbStream; | ||
| 7 | +import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 8 | +import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | ||
| 9 | +import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 10 | +import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; | ||
| 11 | +import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; | ||
| 12 | +import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; | ||
| 13 | +import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.QueryMessageHandler; | ||
| 14 | +import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 15 | +import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; | ||
| 16 | +import org.dom4j.Element; | ||
| 17 | +import org.slf4j.Logger; | ||
| 18 | +import org.slf4j.LoggerFactory; | ||
| 19 | +import org.springframework.beans.factory.InitializingBean; | ||
| 20 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 21 | +import org.springframework.stereotype.Component; | ||
| 22 | + | ||
| 23 | +import javax.sip.InvalidArgumentException; | ||
| 24 | +import javax.sip.RequestEvent; | ||
| 25 | +import javax.sip.SipException; | ||
| 26 | +import javax.sip.header.FromHeader; | ||
| 27 | +import javax.sip.message.Response; | ||
| 28 | +import java.text.ParseException; | ||
| 29 | +import java.util.List; | ||
| 30 | + | ||
| 31 | +@Component | ||
| 32 | +public class AlarmQueryMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { | ||
| 33 | + | ||
| 34 | + private Logger logger = LoggerFactory.getLogger(AlarmQueryMessageHandler.class); | ||
| 35 | + private final String cmdType = "Alarm"; | ||
| 36 | + | ||
| 37 | + @Autowired | ||
| 38 | + private QueryMessageHandler queryMessageHandler; | ||
| 39 | + | ||
| 40 | + @Autowired | ||
| 41 | + private IVideoManagerStorager storager; | ||
| 42 | + | ||
| 43 | + @Autowired | ||
| 44 | + private SIPCommanderFroPlatform cmderFroPlatform; | ||
| 45 | + | ||
| 46 | + @Autowired | ||
| 47 | + private SipConfig config; | ||
| 48 | + | ||
| 49 | + @Autowired | ||
| 50 | + private EventPublisher publisher; | ||
| 51 | + | ||
| 52 | + @Override | ||
| 53 | + public void afterPropertiesSet() throws Exception { | ||
| 54 | + queryMessageHandler.addHandler(cmdType, this); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @Override | ||
| 58 | + public void handForDevice(RequestEvent evt, Device device, Element element) { | ||
| 59 | + | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @Override | ||
| 63 | + public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { | ||
| 64 | + | ||
| 65 | + logger.info("不支持alarm查询"); | ||
| 66 | + try { | ||
| 67 | + responseAck(evt, Response.NOT_FOUND, "not support alarm query"); | ||
| 68 | + } catch (SipException e) { | ||
| 69 | + e.printStackTrace(); | ||
| 70 | + } catch (InvalidArgumentException e) { | ||
| 71 | + e.printStackTrace(); | ||
| 72 | + } catch (ParseException e) { | ||
| 73 | + e.printStackTrace(); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + } | ||
| 77 | +} |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/ResponseMessageHandler.java
| @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | @@ -6,6 +6,10 @@ import org.springframework.beans.factory.InitializingBean; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * 命令类型: 请求动作的应答 | ||
| 11 | + * 命令类型: 设备控制, 报警通知, 设备目录信息查询, 目录信息查询, 目录收到, 设备信息查询, 设备状态信息查询 ...... | ||
| 12 | + */ | ||
| 9 | @Component | 13 | @Component |
| 10 | public class ResponseMessageHandler extends MessageHandlerAbstract implements InitializingBean { | 14 | public class ResponseMessageHandler extends MessageHandlerAbstract implements InitializingBean { |
| 11 | 15 |