Class DefaultServerDeviceSupplier
java.lang.Object
io.github.lunasaw.gbproxy.server.service.DefaultServerDeviceSupplier
- All Implemented Interfaces:
DeviceSupplier,ServerDeviceSupplier
@Service
@ConditionalOnMissingBean(ServerDeviceSupplier.class)
public class DefaultServerDeviceSupplier
extends Object
implements ServerDeviceSupplier
服务端设备提供器默认实现
基于Gb28181ServerProperties配置的服务端设备管理
设计原则: 1. 线程安全的设备管理 2. 基于配置的服务端设备初始化 3. 支持动态设备添加和移除 4. 自动生成服务端发送方设备信息
- Author:
- luna
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid清空所有设备booleancontainsDevice(String userId) 检查设备是否存在根据用户ID获取指定设备 这是设备获取的核心方法,业务方通过userId获取设备数据getName()获取设备提供器的名称标识获取服务端发送方设备信息 用于服务端发送SIP消息时标识发送方设备void初始化服务端发送方设备信息 基于配置属性创建服务端设备voidsetServerFromDevice(FromDevice fromDevice) 设置服务端发送方设备信息 用于配置服务端的发送方设备标识Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.lunasaw.sip.common.service.DeviceSupplier
getToDevice, getToDeviceMethods inherited from interface io.github.lunasaw.sip.common.service.ServerDeviceSupplier
checkDevice
-
Constructor Details
-
DefaultServerDeviceSupplier
public DefaultServerDeviceSupplier()初始化服务端发送方设备信息
-
-
Method Details
-
initializeServerFromDevice
public void initializeServerFromDevice()初始化服务端发送方设备信息 基于配置属性创建服务端设备 -
getDevice
Description copied from interface:DeviceSupplier根据用户ID获取指定设备 这是设备获取的核心方法,业务方通过userId获取设备数据- Specified by:
getDevicein interfaceDeviceSupplier- Parameters:
userId- 用户ID- Returns:
- 设备信息,如果不存在则返回null
-
getServerFromDevice
Description copied from interface:ServerDeviceSupplier获取服务端发送方设备信息 用于服务端发送SIP消息时标识发送方设备- Specified by:
getServerFromDevicein interfaceServerDeviceSupplier- Returns:
- 服务端发送方设备信息,如果不存在则返回null
-
setServerFromDevice
Description copied from interface:ServerDeviceSupplier设置服务端发送方设备信息 用于配置服务端的发送方设备标识- Specified by:
setServerFromDevicein interfaceServerDeviceSupplier- Parameters:
fromDevice- 服务端发送方设备信息
-
getName
Description copied from interface:DeviceSupplier获取设备提供器的名称标识- Specified by:
getNamein interfaceDeviceSupplier- Returns:
- 提供器名称
-
clearAllDevices
public void clearAllDevices()清空所有设备 -
containsDevice
检查设备是否存在- Parameters:
userId- 用户ID- Returns:
- 是否存在
-