From 76a0d248efb7a248890c73255b3775aa34268f45 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Sat, 10 Aug 2024 23:27:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/conf/SipPlatformRunner.java | 12 +- .../iot/vmp/gb28181/bean/CommonGBChannel.java | 14 +++ .../vmp/gb28181/bean/ParentPlatformCatch.java | 68 ----------- .../{ParentPlatform.java => Platform.java} | 46 +++++-- .../iot/vmp/gb28181/bean/PlatformCatch.java | 24 ++++ .../iot/vmp/gb28181/bean/SipMsgInfo.java | 8 +- .../gb28181/controller/AlarmController.java | 4 +- .../controller/PlatformController.java | 26 ++-- .../gb28181/dao/PlatformCatalogMapper.java | 66 ---------- .../gb28181/dao/PlatformChannelMapper.java | 2 +- .../gb28181/dao/PlatformGbStreamMapper.java | 114 ------------------ ...latformMapper.java => PlatformMapper.java} | 25 ++-- .../subscribe/catalog/CatalogEventLister.java | 16 +-- .../MobilePositionEventLister.java | 6 +- .../gb28181/service/IGbChannelService.java | 2 +- .../vmp/gb28181/service/IPlatformService.java | 24 ++-- .../iot/vmp/gb28181/service/IPlayService.java | 6 +- .../service/impl/GbChannelServiceImpl.java | 29 ++++- .../impl/PlatformChannelServiceImpl.java | 10 +- .../service/impl/PlatformServiceImpl.java | 62 +++++----- .../gb28181/service/impl/PlayServiceImpl.java | 6 +- .../iot/vmp/gb28181/task/SipRunner.java | 4 +- .../cmd/ISIPCommanderForPlatform.java | 40 +++--- .../cmd/SIPRequestHeaderPlarformProvider.java | 22 ++-- .../cmd/impl/SIPCommanderFroPlatform.java | 56 ++++----- .../request/SIPRequestProcessorParent.java | 6 +- .../request/impl/AckRequestProcessor.java | 4 +- .../request/impl/ByeRequestProcessor.java | 4 +- .../request/impl/InviteRequestProcessor.java | 18 +-- .../impl/SubscribeRequestProcessor.java | 10 +- .../impl/info/InfoRequestProcessor.java | 2 +- .../request/impl/message/IMessageHandler.java | 4 +- .../impl/message/MessageHandlerAbstract.java | 6 +- .../impl/message/MessageRequestProcessor.java | 4 +- .../cmd/DeviceControlQueryMessageHandler.java | 4 +- .../notify/cmd/AlarmNotifyMessageHandler.java | 2 +- .../cmd/BroadcastNotifyMessageHandler.java | 2 +- .../cmd/KeepaliveNotifyMessageHandler.java | 4 +- .../cmd/MediaStatusNotifyMessageHandler.java | 6 +- .../MobilePositionNotifyMessageHandler.java | 2 +- .../query/cmd/AlarmQueryMessageHandler.java | 4 +- .../query/cmd/CatalogQueryMessageHandler.java | 12 +- .../cmd/DeviceInfoQueryMessageHandler.java | 4 +- .../cmd/DeviceStatusQueryMessageHandler.java | 4 +- .../cmd/RecordInfoQueryMessageHandler.java | 4 +- .../cmd/AlarmResponseMessageHandler.java | 4 +- .../cmd/BroadcastResponseMessageHandler.java | 4 +- .../cmd/CatalogResponseMessageHandler.java | 2 +- .../ConfigDownloadResponseMessageHandler.java | 4 +- .../DeviceConfigResponseMessageHandler.java | 4 +- .../DeviceControlResponseMessageHandler.java | 4 +- .../cmd/DeviceInfoResponseMessageHandler.java | 4 +- .../DeviceStatusResponseMessageHandler.java | 4 +- .../MobilePositionResponseMessageHandler.java | 4 +- .../PresetQueryResponseMessageHandler.java | 4 +- .../cmd/RecordInfoResponseMessageHandler.java | 4 +- .../impl/RegisterResponseProcessor.java | 8 +- .../vmp/service/impl/MediaServiceImpl.java | 2 +- .../redisMsg/RedisAlarmMsgListener.java | 12 +- .../redisMsg/control/RedisRpcController.java | 4 +- .../iot/vmp/storager/IRedisCatchStorage.java | 8 +- .../vmp/storager/IVideoManagerStorage.java | 12 +- .../storager/impl/RedisCatchStorageImpl.java | 10 +- .../impl/VideoManagerStorageImpl.java | 43 ++----- 数据库/2.7.2-重构/初始化-mysql-2.7.2.sql | 83 ++++++------- 65 files changed, 421 insertions(+), 601 deletions(-) delete mode 100755 src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatformCatch.java rename src/main/java/com/genersoft/iot/vmp/gb28181/bean/{ParentPlatform.java => Platform.java} (66%) create mode 100755 src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatch.java delete mode 100755 src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformCatalogMapper.java delete mode 100755 src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformGbStreamMapper.java rename src/main/java/com/genersoft/iot/vmp/gb28181/dao/{ParentPlatformMapper.java => PlatformMapper.java} (82%) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java index c6a115e2..65024114 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.conf; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; +import com.genersoft.iot.vmp.gb28181.bean.Platform; +import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.service.IPlatformService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; @@ -38,14 +38,14 @@ public class SipPlatformRunner implements CommandLineRunner { @Override public void run(String... args) throws Exception { // 获取所有启用的平台 - List parentPlatforms = storager.queryEnableParentPlatformList(true); + List parentPlatforms = storager.queryEnableParentPlatformList(true); - for (ParentPlatform parentPlatform : parentPlatforms) { + for (Platform parentPlatform : parentPlatforms) { - ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); + PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // 更新缓存 - ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); + PlatformCatch parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setId(parentPlatform.getServerGBId()); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java index 4b383e41..9ab88cd5 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java @@ -342,4 +342,18 @@ public class CommonGBChannel { return channel; } + public static CommonGBChannel build(Platform platform) { + CommonGBChannel commonGBChannel = new CommonGBChannel(); + commonGBChannel.setGbDeviceId(platform.getDeviceGBId()); + commonGBChannel.setGbName(platform.getName()); + commonGBChannel.setGbManufacturer(platform.getManufacturer()); + commonGBChannel.setGbModel(platform.getModel()); + commonGBChannel.setGbCivilCode(platform.getCivilCode()); + commonGBChannel.setGbAddress(platform.getAddress()); + commonGBChannel.setGbRegisterWay(platform.getRegisterWay()); + commonGBChannel.setGbSecrecy(platform.getSecrecy()); + commonGBChannel.setGbStatus(platform.getStatus()); + return commonGBChannel; + } + } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatformCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatformCatch.java deleted file mode 100755 index 6ff2fe32..00000000 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatformCatch.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.genersoft.iot.vmp.gb28181.bean; - -public class ParentPlatformCatch { - - private String id; - - /** - * 心跳未回复次数 - */ - private int keepAliveReply; - - // 注册未回复次数 - private int registerAliveReply; - - private String callId; - - private ParentPlatform parentPlatform; - - private SipTransactionInfo sipTransactionInfo; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public int getKeepAliveReply() { - return keepAliveReply; - } - - public void setKeepAliveReply(int keepAliveReply) { - this.keepAliveReply = keepAliveReply; - } - - public int getRegisterAliveReply() { - return registerAliveReply; - } - - public void setRegisterAliveReply(int registerAliveReply) { - this.registerAliveReply = registerAliveReply; - } - - public ParentPlatform getParentPlatform() { - return parentPlatform; - } - - public void setParentPlatform(ParentPlatform parentPlatform) { - this.parentPlatform = parentPlatform; - } - - public String getCallId() { - return callId; - } - - public void setCallId(String callId) { - this.callId = callId; - } - - public SipTransactionInfo getSipTransactionInfo() { - return sipTransactionInfo; - } - - public void setSipTransactionInfo(SipTransactionInfo sipTransactionInfo) { - this.sipTransactionInfo = sipTransactionInfo; - } -} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Platform.java similarity index 66% rename from src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java rename to src/main/java/com/genersoft/iot/vmp/gb28181/bean/Platform.java index 747eff40..8ccc59e0 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Platform.java @@ -8,7 +8,7 @@ import lombok.Data; */ @Data @Schema(description = "平台信息") -public class ParentPlatform { +public class Platform { @Schema(description = "ID(数据库中)") private Integer id; @@ -70,9 +70,6 @@ public class ParentPlatform { @Schema(description = "在线状态") private int channelCount; - @Schema(description = "默认目录Id,自动添加的通道多放在这个目录下") - private String catalogId; - @Schema(description = "已被订阅目录信息") private boolean catalogSubscribe; @@ -82,9 +79,6 @@ public class ParentPlatform { @Schema(description = "已被订阅移动位置信息") private boolean mobilePositionSubscribe; - @Schema(description = "点播未推流的设备时是否使用redis通知拉起") - private boolean startOfflinePush; - @Schema(description = "目录分组-每次向上级发送通道信息时单个包携带的通道数量,取值1,2,4,8") private int catalogGroup; @@ -97,12 +91,46 @@ public class ParentPlatform { @Schema(description = "是否作为消息通道") private boolean asMessageChannel; - @Schema(description = "点播回复200OK使用次IP") + @Schema(description = "点播回复200OK使用的IP") private String sendStreamIp; @Schema(description = "是否使用自定义业务分组") - private Boolean customCatalog; + private Boolean customGroup; @Schema(description = "是否自动推送通道变化") private Boolean autoPushChannel; + + @Schema(description = "目录信息包含平台信息") + private Boolean catalogWithPlatform; + + @Schema(description = "目录信息包含分组信息") + private Boolean catalogWithGroup; + + @Schema(description = "目录信息包含行政区划") + private Boolean catalogWithRegion; + + @Schema(description = "行政区划") + private String civilCode; + + @Schema(description = "平台厂商") + private String manufacturer; + + @Schema(description = "平台型号") + private String model; + + @Schema(description = "平台安装地址") + private String address; + + @Schema(description = "注册方式(必选)缺省为1; " + + "1-符合IETF RFC 3261标准的认证注册模式;" + + "2-基于口令的双向认证注册模式;" + + "3-基于数字证书的双向认证注册模式(高安全级别要求);" + + "4-基于数字证书的单向认证注册模式(高安全级别要求)") + private int registerWay = 1; + + @Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密") + private int secrecy = 0; + + @Schema(description = "在线状态") + private String Status = "ON"; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatch.java new file mode 100755 index 00000000..ded3291c --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatch.java @@ -0,0 +1,24 @@ +package com.genersoft.iot.vmp.gb28181.bean; + +import lombok.Data; + +@Data +public class PlatformCatch { + + private String id; + + /** + * 心跳未回复次数 + */ + private int keepAliveReply; + + // 注册未回复次数 + private int registerAliveReply; + + private String callId; + + private Platform parentPlatform; + + private SipTransactionInfo sipTransactionInfo; + +} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SipMsgInfo.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SipMsgInfo.java index 302539b6..06d43c8d 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SipMsgInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SipMsgInfo.java @@ -7,7 +7,7 @@ import javax.sip.RequestEvent; public class SipMsgInfo { private RequestEvent evt; private Device device; - private ParentPlatform platform; + private Platform platform; private Element rootElement; public SipMsgInfo(RequestEvent evt, Device device, Element rootElement) { @@ -16,7 +16,7 @@ public class SipMsgInfo { this.rootElement = rootElement; } - public SipMsgInfo(RequestEvent evt, ParentPlatform platform, Element rootElement) { + public SipMsgInfo(RequestEvent evt, Platform platform, Element rootElement) { this.evt = evt; this.platform = platform; this.rootElement = rootElement; @@ -38,11 +38,11 @@ public class SipMsgInfo { this.device = device; } - public ParentPlatform getPlatform() { + public Platform getPlatform() { return platform; } - public void setPlatform(ParentPlatform platform) { + public void setPlatform(Platform platform) { this.platform = platform; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/AlarmController.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/AlarmController.java index e90a5d02..a08c7c71 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/AlarmController.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/AlarmController.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.service.IDeviceAlarmService; @@ -100,7 +100,7 @@ public class AlarmController { @Parameter(name = "deviceId", description = "设备国标编号") public void delete(@RequestParam String deviceId) { Device device = deviceService.getDevice(deviceId); - ParentPlatform platform = storage.queryParentPlatByServerGBId(deviceId); + Platform platform = storage.queryParentPlatByServerGBId(deviceId); DeviceAlarm deviceAlarm = new DeviceAlarm(); deviceAlarm.setChannelId(deviceId); deviceAlarm.setAlarmDescription("test"); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java index 29f9c159..0a4f6533 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java @@ -8,8 +8,8 @@ import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.security.JwtUtils; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; +import com.genersoft.iot.vmp.gb28181.bean.Platform; +import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce; @@ -100,8 +100,8 @@ public class PlatformController { @Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "id", description = "平台国标编号", required = true) @GetMapping("/info/{id}") - public ParentPlatform getPlatform(@PathVariable String id) { - ParentPlatform parentPlatform = platformService.queryPlatformByServerGBId(id); + public Platform getPlatform(@PathVariable String id) { + Platform parentPlatform = platformService.queryPlatformByServerGBId(id); if (parentPlatform != null) { return parentPlatform; } else { @@ -120,11 +120,11 @@ public class PlatformController { @Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "count", description = "每页条数", required = true) - public PageInfo platforms(@PathVariable int page, @PathVariable int count) { + public PageInfo platforms(@PathVariable int page, @PathVariable int count) { - PageInfo parentPlatformPageInfo = platformService.queryParentPlatformList(page, count); + PageInfo parentPlatformPageInfo = platformService.queryParentPlatformList(page, count); if (parentPlatformPageInfo.getList().size() > 0) { - for (ParentPlatform platform : parentPlatformPageInfo.getList()) { + for (Platform platform : parentPlatformPageInfo.getList()) { platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null); platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null); } @@ -141,7 +141,7 @@ public class PlatformController { @Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @PostMapping("/add") @ResponseBody - public void addPlatform(@RequestBody ParentPlatform parentPlatform) { + public void addPlatform(@RequestBody Platform parentPlatform) { if (log.isDebugEnabled()) { log.debug("保存上级平台信息API调用"); @@ -164,7 +164,7 @@ public class PlatformController { } - ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); + Platform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); if (parentPlatformOld != null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台 " + parentPlatform.getServerGBId() + " 已存在"); } @@ -186,7 +186,7 @@ public class PlatformController { @Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @PostMapping("/save") @ResponseBody - public void savePlatform(@RequestBody ParentPlatform parentPlatform) { + public void savePlatform(@RequestBody Platform parentPlatform) { if (log.isDebugEnabled()) { log.debug("保存上级平台信息API调用"); @@ -227,8 +227,8 @@ public class PlatformController { ) { throw new ControllerException(ErrorCode.ERROR400); } - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(serverGBId); + Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); + PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(serverGBId); if (parentPlatform == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在"); } @@ -279,7 +279,7 @@ public class PlatformController { @ResponseBody public Boolean exitPlatform(@PathVariable String serverGBId) { - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); + Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); return parentPlatform != null; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformCatalogMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformCatalogMapper.java deleted file mode 100755 index feaf5ecc..00000000 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformCatalogMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.genersoft.iot.vmp.gb28181.dao; - -import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; -import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; -import org.apache.ibatis.annotations.*; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - - -@Mapper -@Repository -public interface PlatformCatalogMapper { - - @Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" + - "(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})") - int add(PlatformCatalog platformCatalog); - - @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}") - int del(@Param("platformId") String platformId, @Param("id") String id); - - @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}") - int delByPlatformId(@Param("platformId") String platformId); - - @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " + - "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " + - "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " + - "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id") - List selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId); - - @Update(value = {" "}) - int update(@Param("platformCatalog") PlatformCatalog platformCatalog); - - @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") - List selectByPlatForm(@Param("platformId") String platformId); - - @Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})") - PlatformCatalog selectDefaultByPlatFormId(@Param("platformId") String platformId); - - @Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " + - " from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") - List queryCatalogInPlatform(@Param("platformId") String platformId); - - @Select("SELECT *, " + - "(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " + - " from wvp_platform_catalog pc " + - " WHERE pc.id=#{id} and pc.platform_id=#{platformId}") - PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id); - - - @Delete("") - int deleteAll(String platformId, List ids); - - @Select("SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}") - List queryCatalogFromParent(@Param("id") String id, @Param("platformId") String platformId); -} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java index a555ca4e..4669034d 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java @@ -97,7 +97,7 @@ public interface PlatformChannelMapper { "AND pp.server_gb_id IN" + " #{item}" + " ") - List queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List platforms); + List queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List platforms); @Delete("") - int batchAdd(List streamPushItems); - - @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})") - int delByAppAndStream(@Param("app") String app, @Param("stream") String stream); - - @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}") - int delByPlatformId(String platformId); - - @Select("SELECT " + - "pp.* " + - "FROM " + - "wvp_platform_gb_stream pgs " + - "LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id " + - "LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id " + - "WHERE " + - "gs.app =#{app} " + - "AND gs.stream =#{stream} ") - List selectByAppAndStream(@Param("app") String app, @Param("stream") String stream); - - @Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " + - "LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " + - "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}") - StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId); - - @Select("") - List queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); - - @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" + - "from wvp_gb_stream gs\n" + - " left join wvp_platform_gb_stream pgs\n" + - " on gs.gb_stream_id = pgs.gb_stream_id\n" + - "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") - List queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); - - @Select(" ") - List queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List platforms); - - @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}") - int delByAppAndStreamAndPlatform(String app, String stream, String platformId); - - @Delete("") - void delByGbStreams(List gbStreams); - - @Delete("") - void delByAppAndStreamsByPlatformId(@Param("gbStreams") List gbStreams, @Param("platformId") String platformId); - - @Delete("") - int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); -} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java similarity index 82% rename from src/main/java/com/genersoft/iot/vmp/gb28181/dao/ParentPlatformMapper.java rename to src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java index 890e5d14..fc33eec1 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java @@ -1,6 +1,6 @@ package com.genersoft.iot.vmp.gb28181.dao; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.Param; @@ -13,15 +13,15 @@ import java.util.List; */ @Mapper @Repository -public interface ParentPlatformMapper { +public interface PlatformMapper { @Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+ "device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,auto_push_channel,"+ - "status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " + + "status,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " + " VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " + " #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, #{autoPushChannel}, " + - " #{status}, #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})") - int addParentPlatform(ParentPlatform parentPlatform); + " #{status}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})") + int addParentPlatform(Platform parentPlatform); @Update("UPDATE wvp_platform " + "SET enable=#{enable}, " + @@ -44,7 +44,6 @@ public interface ParentPlatformMapper { "as_message_channel=#{asMessageChannel}, " + "auto_push_channel=#{autoPushChannel}, " + "status=#{status}, " + - "start_offline_push=#{startOfflinePush}, " + "catalog_group=#{catalogGroup}, " + "administrative_division=#{administrativeDivision}, " + "create_time=#{createTime}, " + @@ -52,10 +51,10 @@ public interface ParentPlatformMapper { "send_stream_ip=#{sendStreamIp}, " + "catalog_id=#{catalogId} " + "WHERE id=#{id}") - int updateParentPlatform(ParentPlatform parentPlatform); + int updateParentPlatform(Platform parentPlatform); @Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}") - int delParentPlatform(ParentPlatform parentPlatform); + int delParentPlatform(Platform parentPlatform); @Select("SELECT *, ((SELECT count(0)\n" + " FROM wvp_platform_gb_channel pc\n" + @@ -69,19 +68,19 @@ public interface ParentPlatformMapper { " FROM wvp_platform_catalog pgc\n" + " WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" + "FROM wvp_platform pp ") - List getParentPlatformList(); + List getParentPlatformList(); @Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ") - List getEnableParentPlatformList(boolean enable); + List getEnableParentPlatformList(boolean enable); @Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true") - List queryEnablePlatformListWithAsMessageChannel(); + List queryEnablePlatformListWithAsMessageChannel(); @Select("SELECT * FROM wvp_platform WHERE server_gb_id=#{platformGbId}") - ParentPlatform getParentPlatByServerGBId(String platformGbId); + Platform getParentPlatByServerGBId(String platformGbId); @Select("SELECT * FROM wvp_platform WHERE id=#{id}") - ParentPlatform getParentPlatById(int id); + Platform getParentPlatById(int id); @Update("UPDATE wvp_platform SET status=false" ) int outlineForAllParentPlatform(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java index 1b4b38f9..91f2bdd4 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.event.subscribe.catalog; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.service.IPlatformService; @@ -42,9 +42,9 @@ public class CatalogEventLister implements ApplicationListener { @Override public void onApplicationEvent(CatalogEvent event) { SubscribeInfo subscribe = null; - ParentPlatform parentPlatform = null; + Platform parentPlatform = null; - Map> parentPlatformMap = new HashMap<>(); + Map> parentPlatformMap = new HashMap<>(); Map channelMap = new HashMap<>(); if (event.getPlatformId() != null) { parentPlatform = platformService.queryOne(event.getPlatformId()); @@ -62,7 +62,7 @@ public class CatalogEventLister implements ApplicationListener { if (event.getChannels() != null) { if (!platforms.isEmpty()) { for (CommonGBChannel deviceChannel : event.getChannels()) { - List parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(deviceChannel.getGbDeviceId(), platforms); + List parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(deviceChannel.getGbDeviceId(), platforms); parentPlatformMap.put(deviceChannel.getGbDeviceId(), parentPlatformsForGB); channelMap.put(deviceChannel.getGbDeviceId(), deviceChannel); } @@ -90,9 +90,9 @@ public class CatalogEventLister implements ApplicationListener { } }else if (!parentPlatformMap.keySet().isEmpty()) { for (String gbId : parentPlatformMap.keySet()) { - List parentPlatforms = parentPlatformMap.get(gbId); + List parentPlatforms = parentPlatformMap.get(gbId); if (parentPlatforms != null && !parentPlatforms.isEmpty()) { - for (ParentPlatform platform : parentPlatforms) { + for (Platform platform : parentPlatforms) { SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId()); if (subscribeInfo == null) { continue; @@ -135,9 +135,9 @@ public class CatalogEventLister implements ApplicationListener { } }else if (!parentPlatformMap.keySet().isEmpty()) { for (String gbId : parentPlatformMap.keySet()) { - List parentPlatforms = parentPlatformMap.get(gbId); + List parentPlatforms = parentPlatformMap.get(gbId); if (parentPlatforms != null && !parentPlatforms.isEmpty()) { - for (ParentPlatform platform : parentPlatforms) { + for (Platform platform : parentPlatforms) { SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId()); if (subscribeInfo == null) { continue; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/mobilePosition/MobilePositionEventLister.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/mobilePosition/MobilePositionEventLister.java index 8ad6998c..83aba09d 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/mobilePosition/MobilePositionEventLister.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/mobilePosition/MobilePositionEventLister.java @@ -1,6 +1,6 @@ package com.genersoft.iot.vmp.gb28181.event.subscribe.mobilePosition; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; @@ -39,9 +39,9 @@ public class MobilePositionEventLister implements ApplicationListener parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(event.getMobilePosition().getChannelId(), platforms); + List parentPlatformsForGB = storager.queryPlatFormListForGBWithGBId(event.getMobilePosition().getChannelId(), platforms); - for (ParentPlatform platform : parentPlatformsForGB) { + for (Platform platform : parentPlatformsForGB) { log.info("[向上级发送MobilePosition] 通道:{},平台:{}, 位置: {}:{}", event.getMobilePosition().getChannelId(), platform.getServerGBId(), event.getMobilePosition().getLongitude(), event.getMobilePosition().getLatitude()); SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java index 1afbde0d..b57cb74a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java @@ -30,7 +30,7 @@ public interface IGbChannelService { void updateStatus(List channelList); - List queryByPlatformId(Integer platformId); + List queryByPlatform(Platform platform); CommonGBChannel getOne(int id); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java index b6217fcb..c34c44a0 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.service; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; import com.genersoft.iot.vmp.media.bean.MediaServer; @@ -19,7 +19,7 @@ import java.text.ParseException; */ public interface IPlatformService { - ParentPlatform queryPlatformByServerGBId(String platformGbId); + Platform queryPlatformByServerGBId(String platformGbId); /** * 分页获取上级平台 @@ -27,37 +27,37 @@ public interface IPlatformService { * @param count * @return */ - PageInfo queryParentPlatformList(int page, int count); + PageInfo queryParentPlatformList(int page, int count); /** * 添加级联平台 * @param parentPlatform 级联平台 */ - boolean add(ParentPlatform parentPlatform); + boolean add(Platform parentPlatform); /** * 添加级联平台 * @param parentPlatform 级联平台 */ - boolean update(ParentPlatform parentPlatform); + boolean update(Platform parentPlatform); /** * 平台上线 * @param parentPlatform 平台信息 */ - void online(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo); + void online(Platform parentPlatform, SipTransactionInfo sipTransactionInfo); /** * 平台离线 * @param parentPlatform 平台信息 */ - void offline(ParentPlatform parentPlatform, boolean stopRegisterTask); + void offline(Platform parentPlatform, boolean stopRegisterTask); /** * 向上级平台发起注册 * @param parentPlatform */ - void login(ParentPlatform parentPlatform); + void login(Platform parentPlatform); /** * 向上级平台发送位置订阅 @@ -73,15 +73,15 @@ public interface IPlatformService { * @param errorEvent 信令错误事件 * @param timeoutCallback 超时事件 */ - void broadcastInvite(ParentPlatform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, + void broadcastInvite(Platform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException; /** * 语音喊话回复BYE */ - void stopBroadcast(ParentPlatform platform, DeviceChannel channel, String stream,boolean sendBye, MediaServer mediaServerItem); + void stopBroadcast(Platform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem); - void addSimulatedSubscribeInfo(ParentPlatform parentPlatform); + void addSimulatedSubscribeInfo(Platform parentPlatform); - ParentPlatform queryOne(Integer platformId); + Platform queryOne(Integer platformId); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlayService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlayService.java index eaba7ef7..b7be536e 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlayService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlayService.java @@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.service; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.exception.ServiceException; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.media.bean.MediaInfo; @@ -55,9 +55,9 @@ public interface IPlayService { void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException; - void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, ParentPlatform platform, CallIdHeader callIdHeader); + void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader); - void startSendRtpStreamFailHand(SendRtpItem sendRtpItem,ParentPlatform platform, CallIdHeader callIdHeader); + void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, Platform platform, CallIdHeader callIdHeader); void talkCmd(Device device, String channelId, MediaServer mediaServerItem, String stream, AudioBroadcastEvent event); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java index fb295c0c..422fc10f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java @@ -299,10 +299,35 @@ public class GbChannelServiceImpl implements IGbChannelService { } @Override - public List queryByPlatformId(Integer platformId) { - return commonGBChannelMapper.queryByPlatformId(platformId); + public List queryByPlatform(Platform platform) { + if (platform == null) { + return null; + } + List commonGBChannelList = commonGBChannelMapper.queryWithPlatform(platform.getId()); + if (commonGBChannelList.isEmpty()) { + return new ArrayList<>(); + } + List channelList = new ArrayList<>(); + // 是否包含平台信息 + if (platform.getCatalogWithPlatform()) { + CommonGBChannel channel = CommonGBChannel.build(platform); + channelList.add(channel); + } + + // 是否包含行政区划信息 + if (platform.getCatalogWithRegion()) { + + } + // 是否包含分组信息 + if (platform.getCatalogWithGroup()) { + + } + + + return channelList; } + @Override public CommonGBChannel getOne(int id) { return commonGBChannelMapper.queryById(id); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java index 9dfa3798..88a14007 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java @@ -6,7 +6,7 @@ import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService; import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper; -import com.genersoft.iot.vmp.gb28181.dao.ParentPlatformMapper; +import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformCatalogMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper; import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce; @@ -51,14 +51,14 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { private PlatformCatalogMapper catalogManager; @Autowired - private ParentPlatformMapper platformMapper; + private PlatformMapper platformMapper; @Autowired EventPublisher eventPublisher; @Override public int updateChannelForGB(String platformId, List channelReduces, String catalogId) { - ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); + Platform platform = platformMapper.getParentPlatByServerGBId(platformId); if (platform == null) { log.warn("更新级联通道信息时未找到平台{}的信息", platformId); return 0; @@ -122,7 +122,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { return allCount; } - private List getDeviceChannelListByChannelReduceList(List channelReduces, String catalogId, ParentPlatform platform) { + private List getDeviceChannelListByChannelReduceList(List channelReduces, String catalogId, Platform platform) { List deviceChannelList = new ArrayList<>(); if (!channelReduces.isEmpty()){ PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId); @@ -157,7 +157,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { if (platformId == null) { return 0; } - ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); + Platform platform = platformMapper.getParentPlatByServerGBId(platformId); if (platform == null) { return 0; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java index 865b44e6..b6336939 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java @@ -25,7 +25,7 @@ import com.genersoft.iot.vmp.gb28181.service.IPlayService; import com.genersoft.iot.vmp.service.bean.*; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; -import com.genersoft.iot.vmp.gb28181.dao.ParentPlatformMapper; +import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper; import com.genersoft.iot.vmp.utils.DateUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -59,7 +59,7 @@ public class PlatformServiceImpl implements IPlatformService { private final static String KEEPALIVE_KEY_PREFIX = "platform_keepalive_"; @Autowired - private ParentPlatformMapper platformMapper; + private PlatformMapper platformMapper; @Autowired private IRedisCatchStorage redisCatchStorage; @@ -106,7 +106,7 @@ public class PlatformServiceImpl implements IPlatformService { for (SendRtpItem sendRtpItem : sendRtpItems) { if (sendRtpItem != null && sendRtpItem.getApp().equals(event.getApp())) { String platformId = sendRtpItem.getPlatformId(); - ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); + Platform platform = platformMapper.getParentPlatByServerGBId(platformId); try { if (platform != null) { @@ -132,7 +132,7 @@ public class PlatformServiceImpl implements IPlatformService { List sendRtpItems = redisCatchStorage.querySendRTPServerByStream(event.getStream()); if (sendRtpItems != null && !sendRtpItems.isEmpty()) { for (SendRtpItem sendRtpItem : sendRtpItems) { - ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId()); + Platform parentPlatform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId()); ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); try { commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId()); @@ -147,19 +147,19 @@ public class PlatformServiceImpl implements IPlatformService { @Override - public ParentPlatform queryPlatformByServerGBId(String platformGbId) { + public Platform queryPlatformByServerGBId(String platformGbId) { return platformMapper.getParentPlatByServerGBId(platformGbId); } @Override - public PageInfo queryParentPlatformList(int page, int count) { + public PageInfo queryParentPlatformList(int page, int count) { PageHelper.startPage(page, count); - List all = platformMapper.getParentPlatformList(); + List all = platformMapper.getParentPlatformList(); return new PageInfo<>(all); } @Override - public boolean add(ParentPlatform parentPlatform) { + public boolean add(Platform parentPlatform) { if (parentPlatform.getCatalogGroup() == 0) { // 每次发送目录的数量默认为1 @@ -168,7 +168,7 @@ public class PlatformServiceImpl implements IPlatformService { parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); int result = platformMapper.addParentPlatform(parentPlatform); // 添加缓存 - ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); + PlatformCatch parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatformCatch.setParentPlatform(parentPlatform); @@ -188,11 +188,11 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public boolean update(ParentPlatform parentPlatform) { + public boolean update(Platform parentPlatform) { log.info("[国标级联]更新平台 {}", parentPlatform.getDeviceGBId()); parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase()); - ParentPlatform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId()); - ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId()); + Platform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId()); + PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId()); parentPlatform.setUpdateTime(DateUtil.getNow()); // 停止心跳定时 @@ -221,7 +221,7 @@ public class PlatformServiceImpl implements IPlatformService { platformMapper.updateParentPlatform(parentPlatform); // 更新redis redisCatchStorage.delPlatformCatchInfo(parentPlatformOld.getServerGBId()); - ParentPlatformCatch parentPlatformCatch = new ParentPlatformCatch(); + PlatformCatch parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setId(parentPlatform.getServerGBId()); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); @@ -245,15 +245,15 @@ public class PlatformServiceImpl implements IPlatformService { @Override - public void online(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo) { + public void online(Platform parentPlatform, SipTransactionInfo sipTransactionInfo) { log.info("[国标级联]:{}, 平台上线", parentPlatform.getServerGBId()); final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId(); dynamicTask.stop(registerFailAgainTaskKey); platformMapper.updateParentPlatformStatus(parentPlatform.getServerGBId(), true); - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); + PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); if (parentPlatformCatch == null) { - parentPlatformCatch = new ParentPlatformCatch(); + parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setId(parentPlatform.getServerGBId()); parentPlatform.setStatus(true); @@ -288,7 +288,7 @@ public class PlatformServiceImpl implements IPlatformService { log.warn("[国标级联]发送心跳收到错误,code: {}, msg: {}", eventResult.statusCode, eventResult.msg); } // 心跳失败 - ParentPlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); + PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // 此时是第三次心跳超时, 平台离线 if (platformCatch.getKeepAliveReply() == 2) { // 设置平台离线,并重新注册 @@ -302,7 +302,7 @@ public class PlatformServiceImpl implements IPlatformService { }, eventResult -> { // 心跳成功 // 清空之前的心跳超时计数 - ParentPlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); + PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); if (platformCatch != null && platformCatch.getKeepAliveReply() > 0) { platformCatch.setKeepAliveReply(0); redisCatchStorage.updatePlatformCatchInfo(platformCatch); @@ -329,7 +329,7 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public void addSimulatedSubscribeInfo(ParentPlatform parentPlatform) { + public void addSimulatedSubscribeInfo(Platform parentPlatform) { // 自动添加一条模拟的订阅信息 SubscribeInfo subscribeInfo = new SubscribeInfo(); subscribeInfo.setId(parentPlatform.getServerGBId()); @@ -343,7 +343,7 @@ public class PlatformServiceImpl implements IPlatformService { subscribeHolder.putCatalogSubscribe(parentPlatform.getServerGBId(), subscribeInfo); } - private void registerTask(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo){ + private void registerTask(Platform parentPlatform, SipTransactionInfo sipTransactionInfo){ try { // 不在同一个会话中续订则每次全新注册 if (!userSetting.isRegisterKeepIntDialog()) { @@ -367,12 +367,12 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public void offline(ParentPlatform parentPlatform, boolean stopRegister) { + public void offline(Platform parentPlatform, boolean stopRegister) { log.info("[平台离线]:{}", parentPlatform.getServerGBId()); - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); + PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); parentPlatformCatch.setKeepAliveReply(0); parentPlatformCatch.setRegisterAliveReply(0); - ParentPlatform parentPlatformInCatch = parentPlatformCatch.getParentPlatform(); + Platform parentPlatformInCatch = parentPlatformCatch.getParentPlatform(); parentPlatformInCatch.setStatus(false); parentPlatformCatch.setParentPlatform(parentPlatformInCatch); redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); @@ -409,7 +409,7 @@ public class PlatformServiceImpl implements IPlatformService { if (!stopRegister) { // 设置为60秒自动尝试重新注册 final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId(); - ParentPlatform platform = platformMapper.getParentPlatById(parentPlatform.getId()); + Platform platform = platformMapper.getParentPlatById(parentPlatform.getId()); if (platform.isEnable()) { dynamicTask.startCron(registerFailAgainTaskKey, ()-> registerTask(platform, null), @@ -431,7 +431,7 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public void login(ParentPlatform parentPlatform) { + public void login(Platform parentPlatform) { final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId(); try { commanderForPlatform.register(parentPlatform, eventResult1 -> { @@ -449,7 +449,7 @@ public class PlatformServiceImpl implements IPlatformService { @Override public void sendNotifyMobilePosition(String platformId) { - ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId); + Platform platform = platformMapper.getParentPlatByServerGBId(platformId); if (platform == null) { return; } @@ -483,7 +483,7 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public void broadcastInvite(ParentPlatform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, + public void broadcastInvite(Platform platform, String channelId, MediaServer mediaServerItem, HookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent, InviteTimeOutCallback timeoutCallback) throws InvalidArgumentException, ParseException, SipException { if (mediaServerItem == null) { @@ -625,7 +625,7 @@ public class PlatformServiceImpl implements IPlatformService { } private void inviteOKHandler(SipSubscribe.EventResult eventResult, SSRCInfo ssrcInfo, int tcpMode, boolean ssrcCheck, MediaServer mediaServerItem, - ParentPlatform platform, String channelId, String timeOutTaskKey, ErrorCallback callback, + Platform platform, String channelId, String timeOutTaskKey, ErrorCallback callback, InviteInfo inviteInfo, InviteSessionType inviteSessionType){ inviteInfo.setStatus(InviteSessionStatus.ok); ResponseEvent responseEvent = (ResponseEvent) eventResult.event; @@ -727,7 +727,7 @@ public class PlatformServiceImpl implements IPlatformService { } - private void tcpActiveHandler(ParentPlatform platform, String channelId, String contentString, + private void tcpActiveHandler(Platform platform, String channelId, String contentString, MediaServer mediaServerItem, int tcpMode, boolean ssrcCheck, String timeOutTaskKey, SSRCInfo ssrcInfo, ErrorCallback callback){ if (tcpMode != 2) { @@ -776,7 +776,7 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public void stopBroadcast(ParentPlatform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem) { + public void stopBroadcast(Platform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServer mediaServerItem) { try { if (sendBye) { @@ -797,7 +797,7 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public ParentPlatform queryOne(Integer platformId) { + public Platform queryOne(Integer platformId) { return platformMapper.getParentPlatById(platformId); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java index f70fd790..5e02ceff 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java @@ -1155,7 +1155,7 @@ public class PlayServiceImpl implements IPlayService { if (sendRtpItems.size() > 0) { for (SendRtpItem sendRtpItem : sendRtpItems) { if (sendRtpItem.getMediaServerId().equals(mediaServerId)) { - ParentPlatform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); + Platform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); try { sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId()); } catch (SipException | InvalidArgumentException | ParseException e) { @@ -1423,7 +1423,7 @@ public class PlayServiceImpl implements IPlayService { } @Override - public void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, ParentPlatform platform, CallIdHeader callIdHeader) { + public void startPushStream(SendRtpItem sendRtpItem, SIPResponse sipResponse, Platform platform, CallIdHeader callIdHeader) { // 开始发流 MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); @@ -1448,7 +1448,7 @@ public class PlayServiceImpl implements IPlayService { } @Override - public void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, ParentPlatform platform, CallIdHeader callIdHeader) { + public void startSendRtpStreamFailHand(SendRtpItem sendRtpItem, Platform platform, CallIdHeader callIdHeader) { if (sendRtpItem.isOnlyAudio()) { Device device = deviceService.getDevice(sendRtpItem.getDeviceId()); AudioBroadcastCatch audioBroadcastCatch = audioBroadcastManager.get(sendRtpItem.getDeviceId(), sendRtpItem.getChannelId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java index ba1c9a30..6b5f7981 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/SipRunner.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.task; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; @@ -95,7 +95,7 @@ public class SipRunner implements CommandLineRunner { ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); boolean stopResult = mediaServerService.initStopSendRtp(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); if (stopResult) { - ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); + Platform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); if (platform != null) { try { commanderForPlatform.streamByeCmd(platform, sendRtpItem.getCallId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java index dbf800d8..393d0aac 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommanderForPlatform.java @@ -22,12 +22,12 @@ public interface ISIPCommanderForPlatform { * @param parentPlatform * @return */ - void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; + void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; - void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; + void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; - void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, WWWAuthenticateHeader www, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException; + void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, WWWAuthenticateHeader www, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException; /** * 向上级平台注销 @@ -35,7 +35,7 @@ public interface ISIPCommanderForPlatform { * @param parentPlatform * @return */ - void unregister(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; + void unregister(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException; /** @@ -44,7 +44,7 @@ public interface ISIPCommanderForPlatform { * @param parentPlatform * @return callId(作为接受回复的判定) */ - String keepalive(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) + String keepalive(Platform parentPlatform, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException; @@ -58,10 +58,10 @@ public interface ISIPCommanderForPlatform { * @param size * @return */ - void catalogQuery(CommonGBChannel channel, ParentPlatform parentPlatform, String sn, String fromTag, int size) + void catalogQuery(CommonGBChannel channel, Platform parentPlatform, String sn, String fromTag, int size) throws SipException, InvalidArgumentException, ParseException; - void catalogQuery(List channels, ParentPlatform parentPlatform, String sn, String fromTag) + void catalogQuery(List channels, Platform parentPlatform, String sn, String fromTag) throws InvalidArgumentException, ParseException, SipException; /** @@ -72,7 +72,7 @@ public interface ISIPCommanderForPlatform { * @param fromTag FROM头的tag信息 * @return */ - void deviceInfoResponse(ParentPlatform parentPlatform,Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException; + void deviceInfoResponse(Platform parentPlatform, Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException; /** * 向上级回复DeviceStatus查询信息 @@ -82,7 +82,7 @@ public interface ISIPCommanderForPlatform { * @param fromTag * @return */ - void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException; + void deviceStatusResponse(Platform parentPlatform, String channelId, String sn, String fromTag, boolean status) throws SipException, InvalidArgumentException, ParseException; /** * 向上级回复移动位置订阅消息 @@ -92,7 +92,7 @@ public interface ISIPCommanderForPlatform { * @param subscribeInfo 订阅相关的信息 * @return */ - void sendNotifyMobilePosition(ParentPlatform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) + void sendNotifyMobilePosition(Platform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; /** @@ -102,7 +102,7 @@ public interface ISIPCommanderForPlatform { * @param deviceAlarm 报警信息信息 * @return */ - void sendAlarmMessage(ParentPlatform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException; + void sendAlarmMessage(Platform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException; /** * 回复catalog事件-增加/更新 @@ -110,7 +110,7 @@ public interface ISIPCommanderForPlatform { * @param parentPlatform * @param deviceChannels */ - void sendNotifyForCatalogAddOrUpdate(String type, ParentPlatform parentPlatform, List deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; + void sendNotifyForCatalogAddOrUpdate(String type, Platform parentPlatform, List deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; /** * 回复catalog事件-删除 @@ -118,7 +118,7 @@ public interface ISIPCommanderForPlatform { * @param parentPlatform * @param deviceChannels */ - void sendNotifyForCatalogOther(String type, ParentPlatform parentPlatform, List deviceChannels, + void sendNotifyForCatalogOther(String type, Platform parentPlatform, List deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException; @@ -130,7 +130,7 @@ public interface ISIPCommanderForPlatform { * @param fromTag fromTag * @param recordInfo 录像信息 */ - void recordInfo(CommonGBChannel deviceChannel, ParentPlatform parentPlatform, String fromTag, RecordInfo recordInfo) + void recordInfo(CommonGBChannel deviceChannel, Platform parentPlatform, String fromTag, RecordInfo recordInfo) throws SipException, InvalidArgumentException, ParseException; /** @@ -140,7 +140,7 @@ public interface ISIPCommanderForPlatform { * @param sendRtpItem * @return */ - void sendMediaStatusNotify(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; + void sendMediaStatusNotify(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; /** * 向发起点播的上级回复bye @@ -148,15 +148,15 @@ public interface ISIPCommanderForPlatform { * @param platform 平台信息 * @param callId callId */ - void streamByeCmd(ParentPlatform platform, String callId) throws SipException, InvalidArgumentException, ParseException; + void streamByeCmd(Platform platform, String callId) throws SipException, InvalidArgumentException, ParseException; - void streamByeCmd(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; + void streamByeCmd(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException; - void streamByeCmd(ParentPlatform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException; + void streamByeCmd(Platform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException; - void broadcastInviteCmd(ParentPlatform platform, String channelId, MediaServer mediaServerItem, + void broadcastInviteCmd(Platform platform, String channelId, MediaServer mediaServerItem, SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException; - void broadcastResultCmd(ParentPlatform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; + void broadcastResultCmd(Platform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java index 543072ac..87f574e2 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.gb28181.SipLayer; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; @@ -47,7 +47,7 @@ public class SIPRequestHeaderPlarformProvider { @Autowired private IRedisCatchStorage redisCatchStorage; - public Request createRegisterRequest(@NotNull ParentPlatform parentPlatform, long CSeq, String fromTag, String toTag, CallIdHeader callIdHeader, int expires) throws ParseException, InvalidArgumentException, PeerUnavailableException { + public Request createRegisterRequest(@NotNull Platform parentPlatform, long CSeq, String fromTag, String toTag, CallIdHeader callIdHeader, int expires) throws ParseException, InvalidArgumentException, PeerUnavailableException { Request request = null; String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort(); //请求行 @@ -88,8 +88,8 @@ public class SIPRequestHeaderPlarformProvider { return request; } - public Request createRegisterRequest(@NotNull ParentPlatform parentPlatform, String fromTag, String toTag, - WWWAuthenticateHeader www , CallIdHeader callIdHeader, int expires) throws ParseException, PeerUnavailableException, InvalidArgumentException { + public Request createRegisterRequest(@NotNull Platform parentPlatform, String fromTag, String toTag, + WWWAuthenticateHeader www , CallIdHeader callIdHeader, int expires) throws ParseException, PeerUnavailableException, InvalidArgumentException { Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires); @@ -165,18 +165,18 @@ public class SIPRequestHeaderPlarformProvider { return registerRequest; } - public Request createMessageRequest(ParentPlatform parentPlatform, String content, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public Request createMessageRequest(Platform parentPlatform, String content, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { CallIdHeader callIdHeader = SipFactory.getInstance().createHeaderFactory().createCallIdHeader(sendRtpItem.getCallId()); callIdHeader.setCallId(sendRtpItem.getCallId()); return createMessageRequest(parentPlatform, content, sendRtpItem.getToTag(), SipUtils.getNewViaTag(), sendRtpItem.getFromTag(), callIdHeader); } - public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { return createMessageRequest(parentPlatform, content, fromTag, viaTag, null, callIdHeader); } - public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { Request request = null; String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort(); // sipuri @@ -214,7 +214,7 @@ public class SIPRequestHeaderPlarformProvider { return request; } - public SIPRequest createNotifyRequest(ParentPlatform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public SIPRequest createNotifyRequest(Platform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { SIPRequest request = null; // sipuri SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort()); @@ -269,7 +269,7 @@ public class SIPRequestHeaderPlarformProvider { return request; } - public SIPRequest createByeRequest(ParentPlatform platform, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public SIPRequest createByeRequest(Platform platform, SendRtpItem sendRtpItem) throws PeerUnavailableException, ParseException, InvalidArgumentException { if (sendRtpItem == null ) { return null; @@ -315,7 +315,7 @@ public class SIPRequestHeaderPlarformProvider { return request; } - public Request createInviteRequest(ParentPlatform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public Request createInviteRequest(Platform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { Request request = null; //请求行 String platformHostAddress = platform.getServerIP() + ":" + platform.getServerPort(); @@ -355,7 +355,7 @@ public class SIPRequestHeaderPlarformProvider { return request; } - public Request createByteRequest(ParentPlatform platform, String channelId, SipTransactionInfo transactionInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { + public Request createByteRequest(Platform platform, String channelId, SipTransactionInfo transactionInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException { String deviceHostAddress = platform.getDeviceIp() + ":" + platform.getDevicePort(); Request request = null; SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(channelId, deviceHostAddress); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 2a1fb7d2..4cddba52 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -85,24 +85,24 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { private GitUtil gitUtil; @Override - public void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { + public void register(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, null, null, errorEvent, okEvent, true); } @Override - public void register(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { + public void register(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, true); } @Override - public void unregister(ParentPlatform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { + public void unregister(Platform parentPlatform, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { register(parentPlatform, sipTransactionInfo, null, errorEvent, okEvent, false); } @Override - public void register(ParentPlatform parentPlatform, @Nullable SipTransactionInfo sipTransactionInfo, @Nullable WWWAuthenticateHeader www, - SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException { + public void register(Platform parentPlatform, @Nullable SipTransactionInfo sipTransactionInfo, @Nullable WWWAuthenticateHeader www, + SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean isRegister) throws SipException, InvalidArgumentException, ParseException { Request request; CallIdHeader callIdHeader = sipSender.getNewCallIdHeader(parentPlatform.getDeviceIp(),parentPlatform.getTransport()); @@ -148,7 +148,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public String keepalive(ParentPlatform parentPlatform,SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException { + public String keepalive(Platform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws SipException, InvalidArgumentException, ParseException { String characterSet = parentPlatform.getCharacterSet(); StringBuffer keepaliveXml = new StringBuffer(200); keepaliveXml.append(" channels, ParentPlatform parentPlatform, String sn, String fromTag) throws InvalidArgumentException, ParseException, SipException { + public void catalogQuery(List channels, Platform parentPlatform, String sn, String fromTag) throws InvalidArgumentException, ParseException, SipException { if ( parentPlatform ==null) { return ; } sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0, true); } - private String getCatalogXml(List channels, String sn, ParentPlatform parentPlatform, int size) { + private String getCatalogXml(List channels, String sn, Platform parentPlatform, int size) { String characterSet = parentPlatform.getCharacterSet(); StringBuffer catalogXml = new StringBuffer(600); catalogXml.append("\r\n") @@ -225,7 +225,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return catalogXml.toString(); } - private void sendCatalogResponse(List channels, ParentPlatform parentPlatform, String sn, String fromTag, int index, boolean sendAfterResponse) throws SipException, InvalidArgumentException, ParseException { + private void sendCatalogResponse(List channels, Platform parentPlatform, String sn, String fromTag, int index, boolean sendAfterResponse) throws SipException, InvalidArgumentException, ParseException { if (index >= channels.size()) { return; } @@ -295,7 +295,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { * @return */ @Override - public void deviceInfoResponse(ParentPlatform parentPlatform,Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException { + public void deviceInfoResponse(Platform parentPlatform, Device device, String sn, String fromTag) throws SipException, InvalidArgumentException, ParseException { if (parentPlatform == null) { return; } @@ -333,7 +333,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { * @return */ @Override - public void deviceStatusResponse(ParentPlatform parentPlatform,String channelId, String sn, String fromTag,boolean status) throws SipException, InvalidArgumentException, ParseException { + public void deviceStatusResponse(Platform parentPlatform, String channelId, String sn, String fromTag, boolean status) throws SipException, InvalidArgumentException, ParseException { if (parentPlatform == null) { return ; } @@ -357,7 +357,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void sendNotifyMobilePosition(ParentPlatform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { + public void sendNotifyMobilePosition(Platform parentPlatform, GPSMsgInfo gpsMsgInfo, SubscribeInfo subscribeInfo) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { if (parentPlatform == null) { return; } @@ -385,7 +385,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void sendAlarmMessage(ParentPlatform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException { + public void sendAlarmMessage(Platform parentPlatform, DeviceAlarm deviceAlarm) throws SipException, InvalidArgumentException, ParseException { if (parentPlatform == null) { return; } @@ -417,7 +417,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void sendNotifyForCatalogAddOrUpdate(String type, ParentPlatform parentPlatform, List deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { + public void sendNotifyForCatalogAddOrUpdate(String type, Platform parentPlatform, List deviceChannels, SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { if (parentPlatform == null || deviceChannels == null || deviceChannels.isEmpty() || subscribeInfo == null) { return; } @@ -451,8 +451,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { })); } - private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent, - SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) + private void sendNotify(Platform parentPlatform, String catalogXmlContent, + SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) throws SipException, ParseException, InvalidArgumentException { MessageFactoryImpl messageFactory = (MessageFactoryImpl) SipFactory.getInstance().createMessageFactory(); String characterSet = parentPlatform.getCharacterSet(); @@ -464,7 +464,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { sipSender.transmitRequest(parentPlatform.getDeviceIp(), notifyRequest, errorEvent, okEvent); } - private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List channels, int sumNum, String type, SubscribeInfo subscribeInfo) { + private String getCatalogXmlContentForCatalogAddOrUpdate(Platform parentPlatform, List channels, int sumNum, String type, SubscribeInfo subscribeInfo) { StringBuffer catalogXml = new StringBuffer(600); String characterSet = parentPlatform.getCharacterSet(); catalogXml.append("\r\n") @@ -485,8 +485,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void sendNotifyForCatalogOther(String type, ParentPlatform parentPlatform, List deviceChannels, - SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { + public void sendNotifyForCatalogOther(String type, Platform parentPlatform, List deviceChannels, + SubscribeInfo subscribeInfo, Integer index) throws InvalidArgumentException, ParseException, NoSuchFieldException, SipException, IllegalAccessException { if (parentPlatform == null || deviceChannels == null || deviceChannels.size() == 0 @@ -523,7 +523,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { }); } - private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, List channels, String type) { + private String getCatalogXmlContentForCatalogOther(Platform parentPlatform, List channels, String type) { String characterSet = parentPlatform.getCharacterSet(); StringBuffer catalogXml = new StringBuffer(600); @@ -544,7 +544,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return catalogXml.toString(); } @Override - public void recordInfo(CommonGBChannel deviceChannel, ParentPlatform parentPlatform, String fromTag, RecordInfo recordInfo) throws SipException, InvalidArgumentException, ParseException { + public void recordInfo(CommonGBChannel deviceChannel, Platform parentPlatform, String fromTag, RecordInfo recordInfo) throws SipException, InvalidArgumentException, ParseException { if ( parentPlatform ==null) { return ; } @@ -597,7 +597,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void sendMediaStatusNotify(ParentPlatform parentPlatform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { + public void sendMediaStatusNotify(Platform parentPlatform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { if (sendRtpItem == null || parentPlatform == null) { return; } @@ -621,7 +621,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void streamByeCmd(ParentPlatform platform, String callId) throws SipException, InvalidArgumentException, ParseException { + public void streamByeCmd(Platform platform, String callId) throws SipException, InvalidArgumentException, ParseException { if (platform == null) { return; } @@ -632,7 +632,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public synchronized void streamByeCmd(ParentPlatform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { + public synchronized void streamByeCmd(Platform platform, SendRtpItem sendRtpItem) throws SipException, InvalidArgumentException, ParseException { if (sendRtpItem == null ) { log.info("[向上级发送BYE], sendRtpItem 为NULL"); return; @@ -656,7 +656,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void streamByeCmd(ParentPlatform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException { + public void streamByeCmd(Platform platform, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException { SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(platform.getServerGBId(), channelId, callId, stream); if (ssrcTransaction == null) { throw new SsrcTransactionNotFoundException(platform.getServerGBId(), channelId, callId, stream); @@ -671,7 +671,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void broadcastResultCmd(ParentPlatform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException { + public void broadcastResultCmd(Platform platform, CommonGBChannel deviceChannel, String sn, boolean result, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException { if (platform == null || deviceChannel == null) { return; } @@ -694,7 +694,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } @Override - public void broadcastInviteCmd(ParentPlatform platform, String channelId, MediaServer mediaServerItem, + public void broadcastInviteCmd(Platform platform, String channelId, MediaServer mediaServerItem, SSRCInfo ssrcInfo, HookSubscribe.Event event, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws ParseException, SipException, InvalidArgumentException { String stream = ssrcInfo.getStream(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java index 4d9027e6..3615619a 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java @@ -1,6 +1,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; import com.genersoft.iot.vmp.gb28181.utils.SipUtils; import com.google.common.primitives.Bytes; @@ -127,7 +127,7 @@ public abstract class SIPRequestProcessorParent { /** * 回复带sdp的200 */ - public SIPResponse responseSdpAck(SIPRequest request, String sdp, ParentPlatform platform) throws SipException, InvalidArgumentException, ParseException { + public SIPResponse responseSdpAck(SIPRequest request, String sdp, Platform platform) throws SipException, InvalidArgumentException, ParseException { ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("APPLICATION", "SDP"); @@ -150,7 +150,7 @@ public abstract class SIPRequestProcessorParent { /** * 回复带xml的200 */ - public SIPResponse responseXmlAck(SIPRequest request, String xml, ParentPlatform platform, Integer expires) throws SipException, InvalidArgumentException, ParseException { + public SIPResponse responseXmlAck(SIPRequest request, String xml, Platform platform, Integer expires) throws SipException, InvalidArgumentException, ParseException { ContentTypeHeader contentTypeHeader = SipFactory.getInstance().createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); SipURI sipURI = (SipURI)request.getRequestURI(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java index 51cd15bf..6329833a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; @@ -100,7 +100,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In sendRtpItem.getSsrc(), sendRtpItem.isTcp()?(sendRtpItem.isTcpActive()?"TCP主动":"TCP被动"):"UDP" ); - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(fromUserId); + Platform parentPlatform = storager.queryParentPlatByServerGBId(fromUserId); if (parentPlatform != null) { if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java index 8619763c..c3601671 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java @@ -123,7 +123,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In if (sendRtpItem.getPlayType().equals(InviteStreamType.PUSH)) { // 不是本平台的就发送redis消息让其他wvp停止发流 - ParentPlatform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); + Platform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId()); if (platform != null) { redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform); if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) { @@ -185,7 +185,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In } log.info("[收到bye] 来自设备:{}, 通道: {}, 类型: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getType()); - ParentPlatform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); + Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); if (platform != null ) { if (ssrcTransaction.getType().equals(InviteSessionType.BROADCAST)) { log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index 1bd55dd2..6c3fe7e4 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -184,7 +184,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements requesterId, callIdHeader.getCallId(), request.getRemoteAddress(), request.getRemotePort()); // 查询请求是否来自上级平台\设备 - ParentPlatform platform = storager.queryParentPlatByServerGBId(requesterId); + Platform platform = storager.queryParentPlatByServerGBId(requesterId); if (platform == null) { inviteFromDeviceHandle(request, requesterId, channelId); @@ -644,7 +644,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements } } - private void startSendRtpStreamHand(RequestEvent evt, SendRtpItem sendRtpItem, ParentPlatform parentPlatform, + private void startSendRtpStreamHand(RequestEvent evt, SendRtpItem sendRtpItem, Platform parentPlatform, JSONObject jsonObject, Map param, CallIdHeader callIdHeader) { if (jsonObject == null) { log.error("下级TCP被动启动监听失败: 请检查ZLM服务"); @@ -659,7 +659,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements /** * 安排推流 */ - private void sendProxyStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { + private void sendProxyStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) { MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); if (mediaInfo != null) { @@ -688,7 +688,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements } } - private void sendPushStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { + private void sendPushStream(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) { // 推流 if (sendRtpItem.getServerId().equals(userSetting.getServerId())) { MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); @@ -729,7 +729,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements /** * 通知流上线 */ - private void notifyProxyStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { + private void notifyProxyStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) { // TODO 控制启用以使设备上线 log.info("[ app={}, stream={} ]通道未推流,启用流后开始推流", sendRtpItem.getApp(), sendRtpItem.getStream()); // 监听流上线 @@ -758,7 +758,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements /** * 通知流上线 */ - private void notifyPushStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, ParentPlatform platform, SIPRequest request) { + private void notifyPushStreamOnline(SendRtpItem sendRtpItem, MediaServer mediaServerItem, Platform platform, SIPRequest request) { // 发送redis消息以使设备上线,流上线后被 log.info("[ app={}, stream={} ]通道未推流,发送redis信息控制设备开始推流", sendRtpItem.getApp(), sendRtpItem.getStream()); MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(1, @@ -847,7 +847,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements /** * 来自其他wvp的推流 */ - private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, ParentPlatform platform) { + private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, Platform platform) { log.info("[级联点播] 来自其他wvp的推流 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream()); sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem.getRedisKey()); if (sendRtpItem == null) { @@ -862,7 +862,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements redisCatchStorage.updateSendRTPSever(sendRtpItem); } - public SIPResponse sendStreamAck(SIPRequest request, SendRtpItem sendRtpItem, ParentPlatform platform) { + public SIPResponse sendStreamAck(SIPRequest request, SendRtpItem sendRtpItem, Platform platform) { String sdpIp = sendRtpItem.getLocalIp(); if (!ObjectUtils.isEmpty(platform.getSendStreamIp())) { @@ -1117,7 +1117,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements content.append("y=" + ssrc + "\r\n"); content.append("f=v/////a/1/8/1\r\n"); - ParentPlatform parentPlatform = new ParentPlatform(); + Platform parentPlatform = new Platform(); parentPlatform.setServerIP(device.getIp()); parentPlatform.setServerPort(device.getPort()); parentPlatform.setServerGBId(device.getDeviceId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java index db6f856b..262abf38 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; import com.genersoft.iot.vmp.gb28181.bean.CmdType; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; @@ -108,7 +108,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme } String platformId = SipUtils.getUserIdFromFromHeader(request); String deviceId = XmlUtil.getText(rootElement, "DeviceID"); - ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); + Platform platform = storager.queryParentPlatByServerGBId(platformId); SubscribeInfo subscribeInfo = new SubscribeInfo(request, platformId); if (platform == null) { return; @@ -137,7 +137,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme } try { - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId); + Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId); SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires()); if (subscribeInfo.getExpires() == 0) { subscribeHolder.removeMobilePositionSubscribe(platformId); @@ -163,7 +163,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme } String platformId = SipUtils.getUserIdFromFromHeader(request); String deviceId = XmlUtil.getText(rootElement, "DeviceID"); - ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); + Platform platform = storager.queryParentPlatByServerGBId(platformId); if (platform == null){ return; } @@ -186,7 +186,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme subscribeHolder.removeCatalogSubscribe(platformId); } try { - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId); + Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId); SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires()); if (subscribeInfo.getExpires() == 0) { subscribeHolder.removeCatalogSubscribe(platformId); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java index aac7dfe7..6a206cf9 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java @@ -80,7 +80,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I // 查询设备是否存在 Device device = redisCatchStorage.getDevice(deviceId); // 查询上级平台是否存在 - ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); + Platform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); try { if (device != null && parentPlatform != null) { log.warn("[重复]平台与设备编号重复:{}", deviceId); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/IMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/IMessageHandler.java index 7eba0d52..085f9212 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/IMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/IMessageHandler.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import org.dom4j.Element; import javax.sip.RequestEvent; @@ -19,5 +19,5 @@ public interface IMessageHandler { * @param evt * @param parentPlatform */ - void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element); + void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java index fecf6dad..e694db2b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; @@ -49,7 +49,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i //两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑 //所以对目录查询单独做了校验 if(messageHandler instanceof CatalogQueryMessageHandler){ - ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId()); + Platform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId()); messageHandler.handForPlatform(evt, parentPlatform, element); return; } @@ -58,7 +58,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { String cmd = getText(element, "CmdType"); IMessageHandler messageHandler = messageHandlerMap.get(cmd); if (messageHandler != null) { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java index a95939df..8af2fd89 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageRequestProcessor.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceNotFoundEvent; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; @@ -78,7 +78,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement // 查询设备是否存在 Device device = redisCatchStorage.getDevice(deviceId); // 查询上级平台是否存在 - ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); + Platform parentPlatform = storage.queryParentPlatByServerGBId(deviceId); try { if (device != null && parentPlatform != null) { String hostAddress = request.getRemoteAddress().getHostAddress(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java index d2b6c449..c5e76260 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.enums.DeviceControlType; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DragZoomRequest; import com.genersoft.iot.vmp.gb28181.bean.HomePositionRequest; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -56,7 +56,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { SIPRequest request = (SIPRequest) evt.getRequest(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java index 395da429..f7d0492e 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java @@ -198,7 +198,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { log.info("收到来自平台[{}]的报警通知", parentPlatform.getServerGBId()); // 回复200 OK try { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java index eb492c6b..df483ca4 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java @@ -74,7 +74,7 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform platform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform platform, Element rootElement) { // 来自上级平台的语音喊话请求 SIPRequest request = (SIPRequest) evt.getRequest(); try { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java index d3279f19..6eba7ffe 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; @@ -119,7 +119,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { // 个别平台保活不回复200OK会判定离线 try { responseAck((SIPRequest) evt.getRequest(), Response.OK); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java index 55188a66..24f9e020 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MediaStatusNotifyMessageHandler.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; @@ -110,7 +110,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i // 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题,需要将点播CallId进行上下级绑定 SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(null, ssrcTransaction.getChannelId(), null, null); if (sendRtpItem != null) { - ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); + Platform parentPlatform = storage.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); if (parentPlatform == null) { log.warn("[级联消息发送]:发送MediaStatus发现上级平台{}不存在", sendRtpItem.getPlatformId()); return; @@ -128,7 +128,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java index 360b6a17..66088684 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java @@ -146,7 +146,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/AlarmQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/AlarmQueryMessageHandler.java index 3f22851b..adcfb868 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/AlarmQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/AlarmQueryMessageHandler.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.QueryMessageHandler; @@ -38,7 +38,7 @@ public class AlarmQueryMessageHandler extends SIPRequestProcessorParent implemen } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { log.info("不支持alarm查询"); try { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java index fb8828f0..1c076257 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java @@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query. import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.service.IGbChannelService; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; @@ -61,7 +61,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform platform, Element rootElement) { FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); try { @@ -72,16 +72,14 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem } Element snElement = rootElement.element("SN"); String sn = snElement.getText(); - List channelList = channelService.queryByPlatformId(parentPlatform.getId()); - - // TODO 是否包含平台信息,做成一个策略 + List channelList = channelService.queryByPlatform(platform); try { if (!channelList.isEmpty()) { - cmderFroPlatform.catalogQuery(channelList, parentPlatform, sn, fromHeader.getTag()); + cmderFroPlatform.catalogQuery(channelList, platform, sn, fromHeader.getTag()); }else { // 回复无通道 - cmderFroPlatform.catalogQuery(null, parentPlatform, sn, fromHeader.getTag(), 0); + cmderFroPlatform.catalogQuery(null, platform, sn, fromHeader.getTag(), 0); } } catch (SipException | InvalidArgumentException | ParseException e) { log.error("[命令发送失败] 国标级联 目录查询回复: {}", e.getMessage()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java index 95f85550..2aaa27ca 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; @@ -48,7 +48,7 @@ public class DeviceInfoQueryMessageHandler extends SIPRequestProcessorParent imp } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { log.info("[DeviceInfo查询]消息"); FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); try { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceStatusQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceStatusQueryMessageHandler.java index 7953068e..343826a1 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceStatusQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceStatusQueryMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query. import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; @@ -50,7 +50,7 @@ public class DeviceStatusQueryMessageHandler extends SIPRequestProcessorParent i } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { log.info("接收到DeviceStatus查询消息"); FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/RecordInfoQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/RecordInfoQueryMessageHandler.java index cf294e78..823d5301 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/RecordInfoQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/RecordInfoQueryMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query. import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.event.record.RecordEndEventListener; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; @@ -58,7 +58,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { SIPRequest request = (SIPRequest) evt.getRequest(); Element snElement = rootElement.element("SN"); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/AlarmResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/AlarmResponseMessageHandler.java index e03634c1..41853465 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/AlarmResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/AlarmResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -51,7 +51,7 @@ public class AlarmResponseMessageHandler extends SIPRequestProcessorParent imple } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java index bc4269fc..ea65db4a 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatch; import com.genersoft.iot.vmp.gb28181.bean.AudioBroadcastCatchStatus; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; @@ -82,7 +82,7 @@ public class BroadcastResponseMessageHandler extends SIPRequestProcessorParent i } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index be7d032b..c2a6e696 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -196,7 +196,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/ConfigDownloadResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/ConfigDownloadResponseMessageHandler.java index f0181059..ed2c8b0a 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/ConfigDownloadResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/ConfigDownloadResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -67,7 +67,7 @@ public class ConfigDownloadResponseMessageHandler extends SIPRequestProcessorPar } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { // 不会收到上级平台的心跳信息 } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceConfigResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceConfigResponseMessageHandler.java index 1334d9ff..453d8066 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceConfigResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceConfigResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -52,6 +52,6 @@ public class DeviceConfigResponseMessageHandler extends SIPRequestProcessorParen } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceControlResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceControlResponseMessageHandler.java index fb6c1aa6..ef3531a8 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceControlResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceControlResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -64,6 +64,6 @@ public class DeviceControlResponseMessageHandler extends SIPRequestProcessorPare } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceInfoResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceInfoResponseMessageHandler.java index d3523dcf..9db37b41 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceInfoResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceInfoResponseMessageHandler.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -100,7 +100,7 @@ public class DeviceInfoResponseMessageHandler extends SIPRequestProcessorParent } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceStatusResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceStatusResponseMessageHandler.java index 90d3256e..c6e36644 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceStatusResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/DeviceStatusResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -81,7 +81,7 @@ public class DeviceStatusResponseMessageHandler extends SIPRequestProcessorParen } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java index ddaf739a..a239b385 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java @@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; @@ -131,7 +131,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/PresetQueryResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/PresetQueryResponseMessageHandler.java index b9d539a5..119b0c7f 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/PresetQueryResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/PresetQueryResponseMessageHandler.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; @@ -113,7 +113,7 @@ public class PresetQueryResponseMessageHandler extends SIPRequestProcessorParent } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element rootElement) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element rootElement) { } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java index 2ab92b56..655c0551 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respon import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.RecordInfo; import com.genersoft.iot.vmp.gb28181.bean.RecordItem; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; @@ -160,7 +160,7 @@ public class RecordInfoResponseMessageHandler extends SIPRequestProcessorParent } @Override - public void handForPlatform(RequestEvent evt, ParentPlatform parentPlatform, Element element) { + public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) { } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java index b0b80ec2..302a7789 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch; +import com.genersoft.iot.vmp.gb28181.bean.Platform; +import com.genersoft.iot.vmp.gb28181.bean.PlatformCatch; import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; @@ -65,7 +65,7 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract { return; } - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformRegisterInfo.getPlatformId()); + PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformRegisterInfo.getPlatformId()); if (parentPlatformCatch == null) { log.warn(String.format("[国标级联]收到注册/注销%S请求,平台:%s,但是平台缓存信息未查询到!!!", response.getStatusCode(),platformRegisterInfo.getPlatformId())); return; @@ -73,7 +73,7 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract { String action = platformRegisterInfo.isRegister() ? "注册" : "注销"; log.info(String.format("[国标级联]%s %S响应,%s ", action, response.getStatusCode(), platformRegisterInfo.getPlatformId() )); - ParentPlatform parentPlatform = parentPlatformCatch.getParentPlatform(); + Platform parentPlatform = parentPlatformCatch.getParentPlatform(); if (parentPlatform == null) { log.warn(String.format("[国标级联]收到 %s %s的%S请求, 但是平台信息未查询到!!!", platformRegisterInfo.getPlatformId(), action, response.getStatusCode())); return; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java index 01e211e0..9a742073 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java @@ -234,7 +234,7 @@ public class MediaServiceImpl implements IMediaService { inviteInfo.getChannelId()); if (!sendRtpItems.isEmpty()) { for (SendRtpItem sendRtpItem : sendRtpItems) { - ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); + Platform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); try { commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId()); } catch (SipException | InvalidArgumentException | ParseException e) { diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java index 01a51094..fbe6e78d 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java @@ -5,7 +5,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.AlarmChannelMessage; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService; @@ -89,9 +89,9 @@ public class RedisAlarmMsgListener implements MessageListener { if (ObjectUtils.isEmpty(gbId)) { if (userSetting.getSendToPlatformsWhenIdLost()) { // 发送给所有的上级 - List parentPlatforms = storage.queryEnableParentPlatformList(true); + List parentPlatforms = storage.queryEnableParentPlatformList(true); if (parentPlatforms.size() > 0) { - for (ParentPlatform parentPlatform : parentPlatforms) { + for (Platform parentPlatform : parentPlatforms) { try { deviceAlarm.setChannelId(parentPlatform.getDeviceGBId()); commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); @@ -102,9 +102,9 @@ public class RedisAlarmMsgListener implements MessageListener { } }else { // 获取开启了消息推送的设备和平台 - List parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel(); + List parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel(); if (parentPlatforms.size() > 0) { - for (ParentPlatform parentPlatform : parentPlatforms) { + for (Platform parentPlatform : parentPlatforms) { try { deviceAlarm.setChannelId(parentPlatform.getDeviceGBId()); commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); @@ -130,7 +130,7 @@ public class RedisAlarmMsgListener implements MessageListener { }else { Device device = deviceService.getDevice(gbId); - ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); + Platform platform = storage.queryParentPlatByServerGBId(gbId); if (device != null && platform == null) { try { commander.sendAlarmMessage(device, deviceAlarm); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java index cdd4f4a9..f5c05b60 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/control/RedisRpcController.java @@ -8,7 +8,7 @@ import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest; import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; @@ -318,7 +318,7 @@ public class RedisRpcController { } log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() ); String platformId = sendRtpItem.getPlatformId(); - ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); + Platform platform = storager.queryParentPlatByServerGBId(platformId); if (platform == null) { return response; } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java b/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java index 2f0f839e..f0007475 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java @@ -22,9 +22,9 @@ public interface IRedisCatchStorage { */ Long getCSEQ(); - void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch); + void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch); - ParentPlatformCatch queryPlatformCatchInfo(String platformGbId); + PlatformCatch queryPlatformCatchInfo(String platformGbId); void delPlatformCatchInfo(String platformGbId); @@ -208,9 +208,9 @@ public interface IRedisCatchStorage { void sendChannelAddOrDelete(String deviceId, String channelId, boolean add); - void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform); + void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, Platform platform); - void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform); + void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform); void addPushListItem(String app, String stream, MediaInfo param); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java index 8205def3..8afbd590 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java @@ -20,26 +20,26 @@ public interface IVideoManagerStorage { * 更新上级平台 * @param parentPlatform */ - boolean updateParentPlatform(ParentPlatform parentPlatform); + boolean updateParentPlatform(Platform parentPlatform); /** * 删除上级平台 * @param parentPlatform */ - boolean deleteParentPlatform(ParentPlatform parentPlatform); + boolean deleteParentPlatform(Platform parentPlatform); /** * 获取所有已启用的平台 * @return */ - List queryEnableParentPlatformList(boolean enable); + List queryEnableParentPlatformList(boolean enable); /** * 获取上级平台 * @param platformGbId * @return */ - ParentPlatform queryParentPlatByServerGBId(String platformGbId); + Platform queryParentPlatByServerGBId(String platformGbId); /** * 移除上级平台的通道信息 @@ -95,12 +95,12 @@ public interface IVideoManagerStorage { int updateStreamGPS(List gpsMsgInfo); - List queryPlatFormListForGBWithGBId(String channelId, List platforms); + List queryPlatFormListForGBWithGBId(String channelId, List platforms); void delRelationByPlatformId(String serverGBId); List getChannelSource(String platformId, String gbId); - List queryEnablePlatformListWithAsMessageChannel(); + List queryEnablePlatformListWithAsMessageChannel(); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java index a049ef27..895efa3c 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java @@ -89,14 +89,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { } @Override - public void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch) { + public void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch) { String key = VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + parentPlatformCatch.getId(); redisTemplate.opsForValue().set(key, parentPlatformCatch); } @Override - public ParentPlatformCatch queryPlatformCatchInfo(String platformGbId) { - return (ParentPlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId); + public PlatformCatch queryPlatformCatchInfo(String platformGbId) { + return (PlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId); } @Override @@ -662,7 +662,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { } @Override - public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) { + public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, Platform platform) { if (sendRtpItem.getPlayType() == InviteStreamType.PUSH && platform != null) { MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getChannelId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(), @@ -675,7 +675,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { } @Override - public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) { + public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform) { MessageForPushChannel msg = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getChannelId(), diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 4ee3ebc6..013b0779 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -56,7 +56,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { private DeviceMobilePositionMapper deviceMobilePositionMapper; @Autowired - private ParentPlatformMapper platformMapper; + private PlatformMapper platformMapper; @Autowired private IRedisCatchStorage redisCatchStorage; @@ -91,27 +91,27 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } @Override - public boolean updateParentPlatform(ParentPlatform parentPlatform) { + public boolean updateParentPlatform(Platform parentPlatform) { int result = 0; if (parentPlatform.getCatalogGroup() == 0) { parentPlatform.setCatalogGroup(1); } - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); + PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); if (parentPlatform.getId() == null ) { if (parentPlatform.getCatalogId() == null) { parentPlatform.setCatalogId(parentPlatform.getServerGBId()); } result = platformMapper.addParentPlatform(parentPlatform); if (parentPlatformCatch == null) { - parentPlatformCatch = new ParentPlatformCatch(); + parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); parentPlatformCatch.setId(parentPlatform.getServerGBId()); } }else { if (parentPlatformCatch == null) { // serverGBId 已变化 - ParentPlatform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId()); + Platform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId()); // 使用旧的查出缓存ID - parentPlatformCatch = new ParentPlatformCatch(); + parentPlatformCatch = new PlatformCatch(); parentPlatformCatch.setId(parentPlatform.getServerGBId()); redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId()); } @@ -127,7 +127,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @Transactional @Override - public boolean deleteParentPlatform(ParentPlatform parentPlatform) { + public boolean deleteParentPlatform(Platform parentPlatform) { int result = platformMapper.delParentPlatform(parentPlatform); // 删除关联的通道 platformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId()); @@ -135,17 +135,17 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } @Override - public ParentPlatform queryParentPlatByServerGBId(String platformGbId) { + public Platform queryParentPlatByServerGBId(String platformGbId) { return platformMapper.getParentPlatByServerGBId(platformGbId); } @Override - public List queryEnableParentPlatformList(boolean enable) { + public List queryEnableParentPlatformList(boolean enable) { return platformMapper.getEnableParentPlatformList(enable); } @Override - public List queryEnablePlatformListWithAsMessageChannel() { + public List queryEnablePlatformListWithAsMessageChannel() { return platformMapper.queryEnablePlatformListWithAsMessageChannel(); } @@ -266,29 +266,8 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { return gbStreamMapper.updateStreamGPS(gpsMsgInfos); } - - private DeviceChannel getDeviceChannelByCatalog(PlatformCatalog catalog) { - ParentPlatform platform = platformMapper.getParentPlatByServerGBId(catalog.getPlatformId()); - DeviceChannel deviceChannel = new DeviceChannel(); - deviceChannel.setDeviceId(catalog.getId()); - deviceChannel.setName(catalog.getName()); - deviceChannel.setDeviceId(platform.getDeviceGBId()); - deviceChannel.setManufacturer("wvp-pro"); - deviceChannel.setStatus("ON"); - deviceChannel.setParental(1); - - deviceChannel.setRegisterWay(1); - deviceChannel.setParentId(catalog.getParentId()); - deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId()); - - deviceChannel.setModel("live"); - deviceChannel.setOwner("wvp-pro"); - deviceChannel.setSecrecy(0); - return deviceChannel; - } - @Override - public List queryPlatFormListForGBWithGBId(String channelId, List platforms) { + public List queryPlatFormListForGBWithGBId(String channelId, List platforms) { return platformChannelMapper.queryPlatFormListForGBWithGBId(channelId, platforms); } diff --git a/数据库/2.7.2-重构/初始化-mysql-2.7.2.sql b/数据库/2.7.2-重构/初始化-mysql-2.7.2.sql index 89285a67..5c28e239 100644 --- a/数据库/2.7.2-重构/初始化-mysql-2.7.2.sql +++ b/数据库/2.7.2-重构/初始化-mysql-2.7.2.sql @@ -244,33 +244,35 @@ create table wvp_media_server create table wvp_platform ( - id serial primary key, - enable bool default false, - name character varying(255), - server_gb_id character varying(50), - server_gb_domain character varying(50), - server_ip character varying(50), - server_port integer, - device_gb_id character varying(50), - device_ip character varying(50), - device_port character varying(50), - username character varying(255), - password character varying(50), - expires character varying(50), - keep_timeout character varying(50), - transport character varying(50), - character_set character varying(50), - catalog_id character varying(50), - ptz bool default false, - rtcp bool default false, - status bool default false, - start_offline_push bool default false, - catalog_group integer, - create_time character varying(50), - update_time character varying(50), - as_message_channel bool default false, - custom_catalog bool default false, - send_stream_ip character varying(50), + id serial primary key, + enable bool default false, + name character varying(255), + server_gb_id character varying(50), + server_gb_domain character varying(50), + server_ip character varying(50), + server_port integer, + device_gb_id character varying(50), + device_ip character varying(50), + device_port character varying(50), + username character varying(255), + password character varying(50), + expires character varying(50), + keep_timeout character varying(50), + transport character varying(50), + character_set character varying(50), + ptz bool default false, + rtcp bool default false, + status bool default false, + catalog_group integer, + create_time character varying(50), + update_time character varying(50), + as_message_channel bool default false, + custom_group bool default false, + catalog_with_platform bool default true, + catalog_with_group bool default true, + catalog_with_region bool default true, + send_stream_ip character varying(50), + device_civil_code character varying(50), constraint uk_platform_unique_server_gb_id unique (server_gb_id) ); @@ -283,9 +285,8 @@ create table wvp_platform_gb_channel device_id character varying(50), name character varying(255), civil_code character varying(50), - group_id integer, - parental integer, - parent_id character varying(255), + parent_id character varying(50), + business_group_id character varying(50), constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id), constraint uk_platform_gb_channel_device_id unique (device_id) ); @@ -316,17 +317,17 @@ create table wvp_stream_proxy create table wvp_stream_push ( - id serial primary key, - app character varying(255), - stream character varying(255), - create_time character varying(50), - media_server_id character varying(50), - server_id character varying(50), - push_time character varying(50), - status bool default false, - update_time character varying(50), - pushing bool default false, - self bool default false, + id serial primary key, + app character varying(255), + stream character varying(255), + create_time character varying(50), + media_server_id character varying(50), + server_id character varying(50), + push_time character varying(50), + status bool default false, + update_time character varying(50), + pushing bool default false, + self bool default false, start_offline_push bool default true, constraint uk_stream_push_app_stream unique (app, stream) );