Class TestServerMessageProcessorHandler
java.lang.Object
io.github.lunasaw.gbproxy.test.handler.TestServerMessageProcessorHandler
- All Implemented Interfaces:
ServerMessageProcessorHandler
@Component
@Primary
public class TestServerMessageProcessorHandler
extends Object
implements ServerMessageProcessorHandler
测试专用的ServerMessageProcessorHandler实现
用于验证MESSAGE请求的处理流程
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取发送设备信息static DeviceAlarmNotify
static DeviceResponse
static DeviceConfigResponse
static DeviceInfo
static DeviceRecord
static DeviceStatus
static String
static String
static String
static String
static String
static String
static DeviceKeepLiveNotify
获取接收到的心跳void
handleMessageError
(javax.sip.RequestEvent evt, String errorMessage) 处理MESSAGE请求错误void
handleMessageRequest
(javax.sip.RequestEvent evt, FromDevice fromDevice) 处理MESSAGE请求static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
检查是否接收到心跳void
keepLiveDevice
(DeviceKeepLiveNotify deviceKeepLiveNotify) 更新设备心跳信息static void
void
updateDeviceAlarm
(DeviceAlarmNotify deviceAlarmNotify) 更新报警信息void
updateDeviceConfig
(String userId, DeviceConfigResponse deviceConfigResponse) void
updateDeviceInfo
(String userId, DeviceInfo deviceInfo) 更新设备信息void
updateDeviceRecord
(String userId, DeviceRecord deviceRecord) 更新设备录像void
updateDeviceResponse
(String userId, DeviceResponse deviceResponse) 更新设备通道void
updateDeviceStatus
(String userId, DeviceStatus deviceStatus) static void
updateInvitePlay
(String callId, String sdpContent, String fromUserId) static void
updateInvitePlayBack
(String callId, String sdpContent, String fromUserId) void
updateMediaStatus
(MediaStatusNotify mediaStatusNotify) 更新媒体状态void
updateMobilePosition
(MobilePositionNotify mobilePositionNotify) 更新位置信息void
updateRemoteAddress
(String userId, RemoteAddressInfo remoteAddressInfo) 更新设备地址信息boolean
validateDevicePermission
(javax.sip.RequestEvent evt) 验证设备权限static boolean
waitForAlarm
(long timeout, TimeUnit unit) static boolean
waitForCatalog
(long timeout, TimeUnit unit) static boolean
waitForDeviceConfig
(long timeout, TimeUnit unit) static boolean
waitForDeviceInfo
(long timeout, TimeUnit unit) static boolean
waitForDeviceRecord
(long timeout, TimeUnit unit) static boolean
waitForDeviceStatus
(long timeout, TimeUnit unit) static boolean
waitForInvitePlay
(long timeout, TimeUnit unit) static boolean
waitForInvitePlayBack
(long timeout, TimeUnit unit) static boolean
waitForKeepalive
(long timeout, TimeUnit unit) 等待心跳接收
-
Constructor Details
-
TestServerMessageProcessorHandler
public TestServerMessageProcessorHandler()
-
-
Method Details
-
handleMessageRequest
Description copied from interface:ServerMessageProcessorHandler
处理MESSAGE请求- Specified by:
handleMessageRequest
in interfaceServerMessageProcessorHandler
- Parameters:
evt
- 请求事件fromDevice
- 发送设备
-
validateDevicePermission
public boolean validateDevicePermission(javax.sip.RequestEvent evt) Description copied from interface:ServerMessageProcessorHandler
验证设备权限- Specified by:
validateDevicePermission
in interfaceServerMessageProcessorHandler
- Parameters:
evt
- 请求事件- Returns:
- 是否有权限
-
getFromDevice
Description copied from interface:ServerMessageProcessorHandler
获取发送设备信息- Specified by:
getFromDevice
in interfaceServerMessageProcessorHandler
- Returns:
- 发送设备
-
handleMessageError
Description copied from interface:ServerMessageProcessorHandler
处理MESSAGE请求错误- Specified by:
handleMessageError
in interfaceServerMessageProcessorHandler
- Parameters:
evt
- 请求事件errorMessage
- 错误消息
-
keepLiveDevice
Description copied from interface:ServerMessageProcessorHandler
更新设备心跳信息- Specified by:
keepLiveDevice
in interfaceServerMessageProcessorHandler
-
updateRemoteAddress
Description copied from interface:ServerMessageProcessorHandler
更新设备地址信息- Specified by:
updateRemoteAddress
in interfaceServerMessageProcessorHandler
-
updateDeviceAlarm
Description copied from interface:ServerMessageProcessorHandler
更新报警信息- Specified by:
updateDeviceAlarm
in interfaceServerMessageProcessorHandler
-
updateMobilePosition
Description copied from interface:ServerMessageProcessorHandler
更新位置信息- Specified by:
updateMobilePosition
in interfaceServerMessageProcessorHandler
-
updateMediaStatus
Description copied from interface:ServerMessageProcessorHandler
更新媒体状态- Specified by:
updateMediaStatus
in interfaceServerMessageProcessorHandler
-
updateDeviceRecord
Description copied from interface:ServerMessageProcessorHandler
更新设备录像- Specified by:
updateDeviceRecord
in interfaceServerMessageProcessorHandler
-
updateDeviceResponse
Description copied from interface:ServerMessageProcessorHandler
更新设备通道- Specified by:
updateDeviceResponse
in interfaceServerMessageProcessorHandler
-
updateDeviceInfo
Description copied from interface:ServerMessageProcessorHandler
更新设备信息- Specified by:
updateDeviceInfo
in interfaceServerMessageProcessorHandler
-
updateDeviceConfig
- Specified by:
updateDeviceConfig
in interfaceServerMessageProcessorHandler
-
updateDeviceStatus
- Specified by:
updateDeviceStatus
in interfaceServerMessageProcessorHandler
-
resetTestState
public static void resetTestState() -
waitForKeepalive
等待心跳接收- Throws:
InterruptedException
-
hasReceivedKeepalive
public static boolean hasReceivedKeepalive()检查是否接收到心跳 -
getReceivedKeepalive
获取接收到的心跳 -
waitForAlarm
- Throws:
InterruptedException
-
hasReceivedAlarm
public static boolean hasReceivedAlarm() -
getReceivedAlarm
-
waitForCatalog
- Throws:
InterruptedException
-
hasReceivedCatalog
public static boolean hasReceivedCatalog() -
getReceivedCatalog
-
waitForDeviceInfo
- Throws:
InterruptedException
-
hasReceivedDeviceInfo
public static boolean hasReceivedDeviceInfo() -
getReceivedDeviceInfo
-
waitForDeviceStatus
- Throws:
InterruptedException
-
hasReceivedDeviceStatus
public static boolean hasReceivedDeviceStatus() -
getReceivedDeviceStatus
-
waitForDeviceRecord
- Throws:
InterruptedException
-
hasReceivedDeviceRecord
public static boolean hasReceivedDeviceRecord() -
getReceivedDeviceRecord
-
waitForDeviceConfig
- Throws:
InterruptedException
-
hasReceivedDeviceConfig
public static boolean hasReceivedDeviceConfig() -
getReceivedDeviceConfig
-
waitForInvitePlay
- Throws:
InterruptedException
-
hasReceivedInvitePlay
public static boolean hasReceivedInvitePlay() -
getReceivedInvitePlayCallId
-
getReceivedInvitePlaySdp
-
getReceivedInvitePlayFromUserId
-
waitForInvitePlayBack
public static boolean waitForInvitePlayBack(long timeout, TimeUnit unit) throws InterruptedException - Throws:
InterruptedException
-
hasReceivedInvitePlayBack
public static boolean hasReceivedInvitePlayBack() -
getReceivedInvitePlayBackCallId
-
getReceivedInvitePlayBackSdp
-
getReceivedInvitePlayBackFromUserId
-
updateInvitePlay
-
updateInvitePlayBack
-