Class ServerCommandSender

java.lang.Object
io.github.lunasaw.gbproxy.server.transmit.cmd.ServerCommandSender

public class ServerCommandSender extends Object
GB28181服务端命令发送器 使用策略模式和建造者模式,提供更灵活和可扩展的命令发送接口
Author:
luna
  • Constructor Details

    • ServerCommandSender

      public ServerCommandSender()
  • Method Details

    • sendCommand

      public static String sendCommand(String commandType, FromDevice fromDevice, ToDevice toDevice, Map<String,Object> params)
      使用策略模式发送命令
      Parameters:
      commandType - 命令类型
      fromDevice - 发送设备
      toDevice - 接收设备
      params - 命令参数
      Returns:
      callId
    • sendCommand

      public static String sendCommand(String commandType, FromDevice fromDevice, ToDevice toDevice, Event errorEvent, Event okEvent, Map<String,Object> params)
      使用策略模式发送命令(带事件)
      Parameters:
      commandType - 命令类型
      fromDevice - 发送设备
      toDevice - 接收设备
      errorEvent - 错误事件
      okEvent - 成功事件
      params - 命令参数
      Returns:
      callId
    • deviceInfoQuery

      public static String deviceInfoQuery(FromDevice fromDevice, ToDevice toDevice)
      设备信息查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceStatusQuery

      public static String deviceStatusQuery(FromDevice fromDevice, ToDevice toDevice)
      设备状态查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceCatalogQuery

      public static String deviceCatalogQuery(FromDevice fromDevice, ToDevice toDevice)
      设备目录查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • devicePresetQuery

      public static String devicePresetQuery(FromDevice fromDevice, ToDevice toDevice)
      设备预设位置查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceRecordInfoQuery

      public static String deviceRecordInfoQuery(FromDevice fromDevice, ToDevice toDevice, String startTime, String endTime)
      设备录像信息查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      startTime - 开始时间
      endTime - 结束时间
      Returns:
      callId
    • deviceRecordInfoQuery

      public static String deviceRecordInfoQuery(FromDevice fromDevice, ToDevice toDevice, long startTime, long endTime)
      设备录像信息查询(时间戳)
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      startTime - 开始时间戳
      endTime - 结束时间戳
      Returns:
      callId
    • deviceRecordInfoQuery

      public static String deviceRecordInfoQuery(FromDevice fromDevice, ToDevice toDevice, Date startTime, Date endTime)
      设备录像信息查询(Date对象)
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      startTime - 开始时间
      endTime - 结束时间
      Returns:
      callId
    • deviceMobilePositionQuery

      public static String deviceMobilePositionQuery(FromDevice fromDevice, ToDevice toDevice, String interval)
      查询移动设备位置数据
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      interval - 间隔
      Returns:
      callId
    • deviceCatalogSubscribe

      public static String deviceCatalogSubscribe(FromDevice fromDevice, ToDevice toDevice, Integer expires, String eventType)
      设备目录订阅
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      expires - 过期时间
      eventType - 事件类型
      Returns:
      callId
    • deviceMobilePositionSubscribe

      public static String deviceMobilePositionSubscribe(FromDevice fromDevice, ToDevice toDevice, String interval, Integer expires, String eventType, String eventId)
      订阅移动设备位置数据
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      interval - 间隔
      expires - 过期时间
      eventType - 事件类型
      eventId - 事件ID
      Returns:
      callId
    • deviceAlarmQuery

      public static String deviceAlarmQuery(FromDevice fromDevice, ToDevice toDevice, Date startTime, Date endTime, String startPriority, String endPriority, String alarmMethod, String alarmType)
      设备告警查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      startTime - 开始时间
      endTime - 结束时间
      startPriority - 开始优先级
      endPriority - 结束优先级
      alarmMethod - 告警方式
      alarmType - 告警类型
      Returns:
      callId
    • deviceControlGuardCmd

      public static String deviceControlGuardCmd(FromDevice fromDevice, ToDevice toDevice, String guardCmdStr)
      设备守卫控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      guardCmdStr - 守卫命令字符串
      Returns:
      callId
    • deviceControlAlarm

      public static String deviceControlAlarm(FromDevice fromDevice, ToDevice toDevice, String alarmMethod, String alarmType)
      设备告警控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      alarmMethod - 告警方式
      alarmType - 告警类型
      Returns:
      callId
    • deviceControlPtzCmd

      public static String deviceControlPtzCmd(FromDevice fromDevice, ToDevice toDevice, PtzCmdEnum ptzCmdEnum, Integer speed)
      设备云台控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      ptzCmdEnum - 云台命令
      speed - 速度
      Returns:
      callId
    • deviceControlPtzCmd

      public static String deviceControlPtzCmd(FromDevice fromDevice, ToDevice toDevice, String ptzCmd)
      设备云台控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      ptzCmd - 云台命令
      Returns:
      callId
    • deviceControlReboot

      public static String deviceControlReboot(FromDevice fromDevice, ToDevice toDevice)
      设备重启控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceControlRecord

      public static String deviceControlRecord(FromDevice fromDevice, ToDevice toDevice, String recordCmd)
      设备录像控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      recordCmd - 录像命令 Record/StopRecord
      Returns:
      callId
    • deviceConfig

      public static String deviceConfig(FromDevice fromDevice, ToDevice toDevice, String name, String expiration, String heartBeatInterval, String heartBeatCount)
      设备配置
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      name - 设备名称
      expiration - 过期时间
      heartBeatInterval - 心跳间隔
      heartBeatCount - 心跳次数
      Returns:
      callId
    • deviceConfigDownload

      public static String deviceConfigDownload(FromDevice fromDevice, ToDevice toDevice, String configType)
      设备配置下载
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      configType - 配置类型
      Returns:
      callId
    • deviceConfigDownloadQuery

      public static String deviceConfigDownloadQuery(FromDevice fromDevice, ToDevice toDevice, String configType)
      设备配置查询
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      configType - 配置类型(如BasicParam/VideoParamOpt等)
      Returns:
      callId
    • deviceBroadcast

      public static String deviceBroadcast(FromDevice fromDevice, ToDevice toDevice)
      设备广播
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceInvitePlay

      public static String deviceInvitePlay(FromDevice fromDevice, ToDevice toDevice, String sdpIp, Integer mediaPort)
      设备实时流点播
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      sdpIp - SDP IP
      mediaPort - 媒体端口
      Returns:
      callId
    • deviceInvitePlay

      public static String deviceInvitePlay(FromDevice fromDevice, ToDevice toDevice, InviteRequest inviteRequest)
      设备实时流点播
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      inviteRequest - 邀请请求
      Returns:
      callId
    • deviceInvitePlayBack

      public static String deviceInvitePlayBack(FromDevice fromDevice, ToDevice toDevice, String sdpIp, Integer mediaPort, String startTime, String endTime)
      设备回放流点播
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      sdpIp - SDP IP
      mediaPort - 媒体端口
      startTime - 开始时间
      endTime - 结束时间
      Returns:
      callId
    • deviceInvitePlayBack

      public static String deviceInvitePlayBack(FromDevice fromDevice, ToDevice toDevice, InviteRequest inviteRequest)
      设备回放流点播
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      inviteRequest - 邀请请求
      Returns:
      callId
    • deviceInvitePlayBackControl

      public static String deviceInvitePlayBackControl(FromDevice fromDevice, ToDevice toDevice, PlayActionEnums playActionEnums)
      设备回放流点播控制
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      playActionEnums - 播放操作
      Returns:
      callId
    • deviceAck

      public static String deviceAck(FromDevice fromDevice, ToDevice toDevice)
      发送ACK响应命令
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • deviceAck

      public static String deviceAck(FromDevice fromDevice, ToDevice toDevice, String callId)
      发送ACK响应命令(指定callId)
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      callId - 呼叫ID
      Returns:
      callId
    • deviceBye

      public static String deviceBye(FromDevice fromDevice, ToDevice toDevice)
      发送BYE请求命令
      Parameters:
      fromDevice - 发送设备
      toDevice - 接收设备
      Returns:
      callId
    • builder

      public static ServerCommandSender.CommandBuilder builder()
      创建命令建造者
      Returns:
      命令建造者