Commit b7857027d51eca627a3f092415aa2e0d3b51313c
1 parent
2f165d59
去除冗余代码和死代码
Showing
19 changed files
with
36 additions
and
82 deletions
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java
| @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.conf; | @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.conf; | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; |
| 5 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 5 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| 6 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | ||
| 7 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 8 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 7 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
| 1 | package com.genersoft.iot.vmp.gb28181.event.offline; | 1 | package com.genersoft.iot.vmp.gb28181.event.offline; |
| 2 | 2 | ||
| 3 | -import org.slf4j.Logger; | ||
| 4 | -import org.slf4j.LoggerFactory; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 3 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | -import org.springframework.beans.factory.annotation.Value; | ||
| 7 | import org.springframework.data.redis.connection.Message; | 4 | import org.springframework.data.redis.connection.Message; |
| 8 | -import org.springframework.data.redis.connection.MessageListener; | ||
| 9 | import org.springframework.data.redis.listener.KeyExpirationEventMessageListener; | 5 | import org.springframework.data.redis.listener.KeyExpirationEventMessageListener; |
| 10 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; | 6 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| 11 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| @@ -13,8 +9,6 @@ import org.springframework.stereotype.Component; | @@ -13,8 +9,6 @@ import org.springframework.stereotype.Component; | ||
| 13 | import com.genersoft.iot.vmp.common.VideoManagerConstants; | 9 | import com.genersoft.iot.vmp.common.VideoManagerConstants; |
| 14 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 10 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| 15 | 11 | ||
| 16 | -import java.nio.charset.StandardCharsets; | ||
| 17 | - | ||
| 18 | /** | 12 | /** |
| 19 | * @Description:设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件 | 13 | * @Description:设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件 |
| 20 | * @author: swwheihei | 14 | * @author: swwheihei |
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformKeepaliveExpire/PlatformKeepaliveExpireEvent.java
| @@ -7,6 +7,11 @@ import org.springframework.context.ApplicationEvent; | @@ -7,6 +7,11 @@ import org.springframework.context.ApplicationEvent; | ||
| 7 | */ | 7 | */ |
| 8 | public class PlatformKeepaliveExpireEvent extends ApplicationEvent { | 8 | public class PlatformKeepaliveExpireEvent extends ApplicationEvent { |
| 9 | 9 | ||
| 10 | + /** | ||
| 11 | + * Add default serial version ID | ||
| 12 | + */ | ||
| 13 | + private static final long serialVersionUID = 1L; | ||
| 14 | + | ||
| 10 | private String platformGbID; | 15 | private String platformGbID; |
| 11 | 16 | ||
| 12 | public PlatformKeepaliveExpireEvent(Object source) { | 17 | public PlatformKeepaliveExpireEvent(Object source) { |
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformKeepaliveExpire/PlatformKeepaliveExpireEventLister.java
| @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire; | @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; |
| 5 | -import com.genersoft.iot.vmp.gb28181.bean.PlatformRegister; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 5 | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| 7 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 6 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| @@ -52,14 +51,14 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P | @@ -52,14 +51,14 @@ public class PlatformKeepaliveExpireEventLister implements ApplicationListener<P | ||
| 52 | } | 51 | } |
| 53 | ParentPlatform parentPlatform = storager.queryParentPlatById(event.getPlatformGbID()); | 52 | ParentPlatform parentPlatform = storager.queryParentPlatById(event.getPlatformGbID()); |
| 54 | ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(event.getPlatformGbID()); | 53 | ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(event.getPlatformGbID()); |
| 55 | - parentPlatformCatch.setParentPlatform(parentPlatform); | ||
| 56 | - if (parentPlatform == null) { | ||
| 57 | - logger.debug("平台心跳到期事件事件触发,但平台已经删除!!! 平台国标ID:" + event.getPlatformGbID()); | 54 | + if (parentPlatformCatch == null) { |
| 58 | return; | 55 | return; |
| 59 | } | 56 | } |
| 60 | - if (parentPlatformCatch == null) { | 57 | + if (parentPlatform == null) { |
| 58 | + logger.debug("平台心跳到期事件事件触发,但平台已经删除!!! 平台国标ID:" + event.getPlatformGbID()); | ||
| 61 | return; | 59 | return; |
| 62 | } | 60 | } |
| 61 | + parentPlatformCatch.setParentPlatform(parentPlatform); | ||
| 63 | // 发送心跳 | 62 | // 发送心跳 |
| 64 | if (parentPlatformCatch.getKeepAliveReply() >= 3) { | 63 | if (parentPlatformCatch.getKeepAliveReply() >= 3) { |
| 65 | // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册 | 64 | // 有3次未收到心跳回复, 设置平台状态为离线, 开始重新注册 |
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEvent.java
| 1 | package com.genersoft.iot.vmp.gb28181.event.platformNotRegister; | 1 | package com.genersoft.iot.vmp.gb28181.event.platformNotRegister; |
| 2 | 2 | ||
| 3 | -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 4 | import org.springframework.context.ApplicationEvent; | 3 | import org.springframework.context.ApplicationEvent; |
| 5 | 4 | ||
| 6 | public class PlatformNotRegisterEvent extends ApplicationEvent { | 5 | public class PlatformNotRegisterEvent extends ApplicationEvent { |
| 7 | 6 | ||
| 7 | + /** | ||
| 8 | + * Add default serial version ID | ||
| 9 | + */ | ||
| 10 | + private static final long serialVersionUID = 1L; | ||
| 11 | + | ||
| 8 | private String platformGbID; | 12 | private String platformGbID; |
| 9 | 13 | ||
| 10 | public PlatformNotRegisterEvent(Object source) { | 14 | public PlatformNotRegisterEvent(Object source) { |
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java
| 1 | package com.genersoft.iot.vmp.gb28181.event.platformNotRegister; | 1 | package com.genersoft.iot.vmp.gb28181.event.platformNotRegister; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 4 | -import com.genersoft.iot.vmp.gb28181.event.online.OnlineEvent; | ||
| 5 | -import com.genersoft.iot.vmp.gb28181.event.online.OnlineEventListener; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| 7 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 5 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 8 | -import com.genersoft.iot.vmp.utils.redis.RedisUtil; | ||
| 9 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 10 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.context.ApplicationEvent; | ||
| 13 | import org.springframework.context.ApplicationListener; | 9 | import org.springframework.context.ApplicationListener; |
| 14 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 15 | 11 | ||
| @@ -27,11 +23,12 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf | @@ -27,11 +23,12 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf | ||
| 27 | 23 | ||
| 28 | @Autowired | 24 | @Autowired |
| 29 | private IVideoManagerStorager storager; | 25 | private IVideoManagerStorager storager; |
| 26 | + | ||
| 30 | @Autowired | 27 | @Autowired |
| 31 | private SIPCommanderFroPlatform sipCommanderFroPlatform; | 28 | private SIPCommanderFroPlatform sipCommanderFroPlatform; |
| 32 | 29 | ||
| 33 | - @Autowired | ||
| 34 | - private RedisUtil redis; | 30 | + // @Autowired |
| 31 | + // private RedisUtil redis; | ||
| 35 | 32 | ||
| 36 | @Override | 33 | @Override |
| 37 | public void onApplicationEvent(PlatformNotRegisterEvent event) { | 34 | public void onApplicationEvent(PlatformNotRegisterEvent event) { |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java
| @@ -5,8 +5,6 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | @@ -5,8 +5,6 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 5 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 5 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 6 | 6 | ||
| 7 | import javax.sip.header.WWWAuthenticateHeader; | 7 | import javax.sip.header.WWWAuthenticateHeader; |
| 8 | -import java.nio.channels.Channel; | ||
| 9 | -import java.util.List; | ||
| 10 | 8 | ||
| 11 | public interface ISIPCommanderForPlatform { | 9 | public interface ISIPCommanderForPlatform { |
| 12 | 10 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.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.conf.SipConfig; | 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.Host; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 7 | -import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.beans.factory.annotation.Qualifier; | 6 | import org.springframework.beans.factory.annotation.Qualifier; |
| 10 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| @@ -16,10 +13,8 @@ import javax.sip.address.SipURI; | @@ -16,10 +13,8 @@ import javax.sip.address.SipURI; | ||
| 16 | import javax.sip.header.*; | 13 | import javax.sip.header.*; |
| 17 | import javax.sip.message.Request; | 14 | import javax.sip.message.Request; |
| 18 | import javax.validation.constraints.NotNull; | 15 | import javax.validation.constraints.NotNull; |
| 19 | -import java.nio.channels.Channel; | ||
| 20 | import java.text.ParseException; | 16 | import java.text.ParseException; |
| 21 | import java.util.ArrayList; | 17 | import java.util.ArrayList; |
| 22 | -import java.util.List; | ||
| 23 | import java.util.UUID; | 18 | import java.util.UUID; |
| 24 | 19 | ||
| 25 | /** | 20 | /** |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
| @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | ||
| 2 | 2 | ||
| 3 | import java.text.ParseException; | 3 | import java.text.ParseException; |
| 4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 5 | -import java.util.UUID; | ||
| 6 | 5 | ||
| 7 | import javax.sip.InvalidArgumentException; | 6 | import javax.sip.InvalidArgumentException; |
| 8 | import javax.sip.PeerUnavailableException; | 7 | import javax.sip.PeerUnavailableException; |
| @@ -12,17 +11,13 @@ import javax.sip.address.Address; | @@ -12,17 +11,13 @@ import javax.sip.address.Address; | ||
| 12 | import javax.sip.address.SipURI; | 11 | import javax.sip.address.SipURI; |
| 13 | import javax.sip.header.*; | 12 | import javax.sip.header.*; |
| 14 | import javax.sip.message.Request; | 13 | import javax.sip.message.Request; |
| 15 | -import javax.validation.constraints.NotNull; | ||
| 16 | 14 | ||
| 17 | -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.beans.factory.annotation.Qualifier; | 16 | import org.springframework.beans.factory.annotation.Qualifier; |
| 20 | import org.springframework.stereotype.Component; | 17 | import org.springframework.stereotype.Component; |
| 21 | 18 | ||
| 22 | import com.genersoft.iot.vmp.conf.SipConfig; | 19 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 23 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 20 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 24 | -import com.genersoft.iot.vmp.gb28181.bean.Host; | ||
| 25 | -import org.springframework.util.DigestUtils; | ||
| 26 | 21 | ||
| 27 | /** | 22 | /** |
| 28 | * @Description:摄像头命令request创造器 TODO 冗余代码太多待优化 | 23 | * @Description:摄像头命令request创造器 TODO 冗余代码太多待优化 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.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 com.genersoft.iot.vmp.conf.SipConfig; | ||
| 4 | -import com.genersoft.iot.vmp.gb28181.bean.Device; | 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; | 5 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 7 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; | 7 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; |
| 8 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 8 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 9 | -import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 9 | +//import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 10 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 10 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; | 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; |
| 12 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider; | 12 | +//import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider; |
| 13 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 13 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 14 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 14 | +//import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | import org.springframework.beans.factory.annotation.Qualifier; | 16 | import org.springframework.beans.factory.annotation.Qualifier; |
| 17 | import org.springframework.beans.factory.annotation.Value; | 17 | import org.springframework.beans.factory.annotation.Value; |
| @@ -22,28 +22,26 @@ import javax.sip.*; | @@ -22,28 +22,26 @@ import javax.sip.*; | ||
| 22 | import javax.sip.header.CallIdHeader; | 22 | import javax.sip.header.CallIdHeader; |
| 23 | import javax.sip.header.WWWAuthenticateHeader; | 23 | import javax.sip.header.WWWAuthenticateHeader; |
| 24 | import javax.sip.message.Request; | 24 | import javax.sip.message.Request; |
| 25 | -import java.nio.channels.Channel; | ||
| 26 | import java.text.ParseException; | 25 | import java.text.ParseException; |
| 27 | -import java.util.List; | ||
| 28 | import java.util.UUID; | 26 | import java.util.UUID; |
| 29 | 27 | ||
| 30 | @Component | 28 | @Component |
| 31 | public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | 29 | public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 32 | 30 | ||
| 33 | - @Autowired | ||
| 34 | - private SipConfig sipConfig; | 31 | + // @Autowired |
| 32 | + // private SipConfig sipConfig; | ||
| 35 | 33 | ||
| 36 | - @Autowired | ||
| 37 | - private SIPRequestHeaderProvider headerProvider; | 34 | + // @Autowired |
| 35 | + // private SIPRequestHeaderProvider headerProvider; | ||
| 38 | 36 | ||
| 39 | @Autowired | 37 | @Autowired |
| 40 | private SIPRequestHeaderPlarformProvider headerProviderPlarformProvider; | 38 | private SIPRequestHeaderPlarformProvider headerProviderPlarformProvider; |
| 41 | 39 | ||
| 42 | - @Autowired | ||
| 43 | - private VideoStreamSessionManager streamSession; | 40 | + // @Autowired |
| 41 | + // private VideoStreamSessionManager streamSession; | ||
| 44 | 42 | ||
| 45 | - @Autowired | ||
| 46 | - private IVideoManagerStorager storager; | 43 | + // @Autowired |
| 44 | + // private IVideoManagerStorager storager; | ||
| 47 | 45 | ||
| 48 | @Autowired | 46 | @Autowired |
| 49 | private IRedisCatchStorage redisCatchStorage; | 47 | private IRedisCatchStorage redisCatchStorage; |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java
| @@ -9,24 +9,15 @@ import com.genersoft.iot.vmp.gb28181.transmit.request.impl.RegisterRequestProces | @@ -9,24 +9,15 @@ import com.genersoft.iot.vmp.gb28181.transmit.request.impl.RegisterRequestProces | ||
| 9 | import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.response.ISIPResponseProcessor; |
| 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 gov.nist.core.Host; | ||
| 13 | -import gov.nist.javax.sip.address.AddressImpl; | ||
| 14 | -import gov.nist.javax.sip.address.SipUri; | ||
| 15 | -import gov.nist.javax.sip.header.To; | ||
| 16 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
| 17 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Component; | 15 | import org.springframework.stereotype.Component; |
| 20 | 16 | ||
| 21 | import javax.sip.ResponseEvent; | 17 | import javax.sip.ResponseEvent; |
| 22 | -import javax.sip.address.Address; | ||
| 23 | -import javax.sip.address.URI; | ||
| 24 | import javax.sip.header.CallIdHeader; | 18 | import javax.sip.header.CallIdHeader; |
| 25 | -import javax.sip.header.ExpiresHeader; | ||
| 26 | -import javax.sip.header.ToHeader; | ||
| 27 | import javax.sip.header.WWWAuthenticateHeader; | 19 | import javax.sip.header.WWWAuthenticateHeader; |
| 28 | import javax.sip.message.Response; | 20 | import javax.sip.message.Response; |
| 29 | -import java.util.UUID; | ||
| 30 | 21 | ||
| 31 | /** | 22 | /** |
| 32 | * @Description:Register响应处理器 | 23 | * @Description:Register响应处理器 |
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; |
| @@ -217,8 +211,8 @@ public class ZLMHttpHookListener { | @@ -217,8 +211,8 @@ public class ZLMHttpHookListener { | ||
| 217 | logger.debug("ZLM HOOK on_shell_login API调用,参数:" + json.toString()); | 211 | logger.debug("ZLM HOOK on_shell_login API调用,参数:" + json.toString()); |
| 218 | } | 212 | } |
| 219 | // TODO 如果是带有rtpstream则开启按需拉流 | 213 | // TODO 如果是带有rtpstream则开启按需拉流 |
| 220 | - String app = json.getString("app"); | ||
| 221 | - String stream = json.getString("stream"); | 214 | + // String app = json.getString("app"); |
| 215 | + // String stream = json.getString("stream"); | ||
| 222 | 216 | ||
| 223 | ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json); | 217 | ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json); |
| 224 | if (subscribe != null) subscribe.response(json); | 218 | if (subscribe != null) subscribe.response(json); |
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
| 1 | package com.genersoft.iot.vmp.storager; | 1 | package com.genersoft.iot.vmp.storager; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | -import java.util.Map; | ||
| 5 | 4 | ||
| 6 | -import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 7 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 8 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 6 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 9 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 7 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 10 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 8 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; |
| 11 | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; | 9 | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| 12 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 13 | -import gov.nist.javax.sip.stack.NioTcpMessageProcessor; | ||
| 14 | - | ||
| 15 | -import javax.swing.event.ChangeEvent; | ||
| 16 | 11 | ||
| 17 | /** | 12 | /** |
| 18 | * @Description:视频设备数据存储接口 | 13 | * @Description:视频设备数据存储接口 |
| 19 | * @author: swwheihei | 14 | * @author: swwheihei |
| 20 | * @date: 2020年5月6日 下午2:14:31 | 15 | * @date: 2020年5月6日 下午2:14:31 |
| 21 | */ | 16 | */ |
| 17 | +@SuppressWarnings("rawtypes") | ||
| 22 | public interface IVideoManagerStorager { | 18 | public interface IVideoManagerStorager { |
| 23 | 19 | ||
| 24 | /** | 20 | /** |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| 1 | package com.genersoft.iot.vmp.storager.dao; | 1 | package com.genersoft.iot.vmp.storager.dao; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 4 | -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 5 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 4 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; |
| 6 | import org.apache.ibatis.annotations.*; | 5 | import org.apache.ibatis.annotations.*; |
| 7 | import org.springframework.stereotype.Repository; | 6 | import org.springframework.stereotype.Repository; |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
| 1 | package com.genersoft.iot.vmp.storager.dao; | 1 | package com.genersoft.iot.vmp.storager.dao; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 5 | import org.apache.ibatis.annotations.*; | 4 | import org.apache.ibatis.annotations.*; |
| 6 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 7 | 6 |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; | @@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional; | ||
| 27 | * @author: swwheihei | 27 | * @author: swwheihei |
| 28 | * @date: 2020年5月6日 下午2:31:42 | 28 | * @date: 2020年5月6日 下午2:31:42 |
| 29 | */ | 29 | */ |
| 30 | +@SuppressWarnings("rawtypes") | ||
| 30 | @Component | 31 | @Component |
| 31 | public class VideoManagerStoragerImpl implements IVideoManagerStorager { | 32 | public class VideoManagerStoragerImpl implements IVideoManagerStorager { |
| 32 | 33 |
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
| 1 | package com.genersoft.iot.vmp.vmanager.platform; | 1 | package com.genersoft.iot.vmp.vmanager.platform; |
| 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.gb28181.bean.ParentPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| @@ -18,10 +17,6 @@ import org.springframework.util.StringUtils; | @@ -18,10 +17,6 @@ import org.springframework.util.StringUtils; | ||
| 18 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
| 19 | import com.genersoft.iot.vmp.conf.SipConfig; | 18 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 20 | 19 | ||
| 21 | -import java.util.List; | ||
| 22 | -import java.util.Map; | ||
| 23 | - | ||
| 24 | - | ||
| 25 | @CrossOrigin | 20 | @CrossOrigin |
| 26 | @RestController | 21 | @RestController |
| 27 | @RequestMapping("/api") | 22 | @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; | ||
| 4 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 5 | import com.genersoft.iot.vmp.conf.MediaServerConfig; | 4 | import com.genersoft.iot.vmp.conf.MediaServerConfig; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| @@ -22,12 +21,10 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -22,12 +21,10 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
| 22 | import org.springframework.web.bind.annotation.RestController; | 21 | import org.springframework.web.bind.annotation.RestController; |
| 23 | 22 | ||
| 24 | import com.alibaba.fastjson.JSONObject; | 23 | import com.alibaba.fastjson.JSONObject; |
| 25 | -import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 26 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 24 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 27 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 25 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 28 | import org.springframework.web.context.request.async.DeferredResult; | 26 | import org.springframework.web.context.request.async.DeferredResult; |
| 29 | 27 | ||
| 30 | -import javax.sip.message.Response; | ||
| 31 | import java.util.UUID; | 28 | import java.util.UUID; |
| 32 | 29 | ||
| 33 | @CrossOrigin | 30 | @CrossOrigin |
src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java
| @@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | @@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | ||
| 14 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 14 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 15 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 15 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 16 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 16 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 17 | -import com.genersoft.iot.vmp.vmanager.play.PlayController; | ||
| 18 | import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; | 17 | import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; |
| 19 | import com.genersoft.iot.vmp.vmanager.service.IPlayService; | 18 | import com.genersoft.iot.vmp.vmanager.service.IPlayService; |
| 20 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
| @@ -25,7 +24,6 @@ import org.springframework.stereotype.Service; | @@ -25,7 +24,6 @@ import org.springframework.stereotype.Service; | ||
| 25 | import org.springframework.web.context.request.async.DeferredResult; | 24 | import org.springframework.web.context.request.async.DeferredResult; |
| 26 | 25 | ||
| 27 | import javax.sip.message.Response; | 26 | import javax.sip.message.Response; |
| 28 | -import java.text.DecimalFormat; | ||
| 29 | import java.util.UUID; | 27 | import java.util.UUID; |
| 30 | 28 | ||
| 31 | @Service | 29 | @Service |