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 DeviceAlarmNotifystatic DeviceResponsestatic DeviceConfigResponsestatic DeviceInfostatic DeviceRecordstatic DeviceStatusstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic DeviceKeepLiveNotify获取接收到的心跳voidhandleMessageError(javax.sip.RequestEvent evt, String errorMessage) 处理MESSAGE请求错误voidhandleMessageRequest(javax.sip.RequestEvent evt, FromDevice fromDevice) 处理MESSAGE请求static booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic boolean检查是否接收到心跳voidkeepLiveDevice(DeviceKeepLiveNotify deviceKeepLiveNotify) 更新设备心跳信息static voidvoidupdateDeviceAlarm(DeviceAlarmNotify deviceAlarmNotify) 更新报警信息voidupdateDeviceConfig(String userId, DeviceConfigResponse deviceConfigResponse) voidupdateDeviceInfo(String userId, DeviceInfo deviceInfo) 更新设备信息voidupdateDeviceRecord(String userId, DeviceRecord deviceRecord) 更新设备录像voidupdateDeviceResponse(String userId, DeviceResponse deviceResponse) 更新设备通道voidupdateDeviceStatus(String userId, DeviceStatus deviceStatus) static voidupdateInvitePlay(String callId, String sdpContent, String fromUserId) static voidupdateInvitePlayBack(String callId, String sdpContent, String fromUserId) voidupdateMediaStatus(MediaStatusNotify mediaStatusNotify) 更新媒体状态voidupdateMobilePosition(MobilePositionNotify mobilePositionNotify) 更新位置信息voidupdateRemoteAddress(String userId, RemoteAddressInfo remoteAddressInfo) 更新设备地址信息booleanvalidateDevicePermission(javax.sip.RequestEvent evt) 验证设备权限static booleanwaitForAlarm(long timeout, TimeUnit unit) static booleanwaitForCatalog(long timeout, TimeUnit unit) static booleanwaitForDeviceConfig(long timeout, TimeUnit unit) static booleanwaitForDeviceInfo(long timeout, TimeUnit unit) static booleanwaitForDeviceRecord(long timeout, TimeUnit unit) static booleanwaitForDeviceStatus(long timeout, TimeUnit unit) static booleanwaitForInvitePlay(long timeout, TimeUnit unit) static booleanwaitForInvitePlayBack(long timeout, TimeUnit unit) static booleanwaitForKeepalive(long timeout, TimeUnit unit) 等待心跳接收
-
Constructor Details
-
TestServerMessageProcessorHandler
public TestServerMessageProcessorHandler()
-
-
Method Details
-
handleMessageRequest
Description copied from interface:ServerMessageProcessorHandler处理MESSAGE请求- Specified by:
handleMessageRequestin interfaceServerMessageProcessorHandler- Parameters:
evt- 请求事件fromDevice- 发送设备
-
validateDevicePermission
public boolean validateDevicePermission(javax.sip.RequestEvent evt) Description copied from interface:ServerMessageProcessorHandler验证设备权限- Specified by:
validateDevicePermissionin interfaceServerMessageProcessorHandler- Parameters:
evt- 请求事件- Returns:
- 是否有权限
-
getFromDevice
Description copied from interface:ServerMessageProcessorHandler获取发送设备信息- Specified by:
getFromDevicein interfaceServerMessageProcessorHandler- Returns:
- 发送设备
-
handleMessageError
Description copied from interface:ServerMessageProcessorHandler处理MESSAGE请求错误- Specified by:
handleMessageErrorin interfaceServerMessageProcessorHandler- Parameters:
evt- 请求事件errorMessage- 错误消息
-
keepLiveDevice
Description copied from interface:ServerMessageProcessorHandler更新设备心跳信息- Specified by:
keepLiveDevicein interfaceServerMessageProcessorHandler
-
updateRemoteAddress
Description copied from interface:ServerMessageProcessorHandler更新设备地址信息- Specified by:
updateRemoteAddressin interfaceServerMessageProcessorHandler
-
updateDeviceAlarm
Description copied from interface:ServerMessageProcessorHandler更新报警信息- Specified by:
updateDeviceAlarmin interfaceServerMessageProcessorHandler
-
updateMobilePosition
Description copied from interface:ServerMessageProcessorHandler更新位置信息- Specified by:
updateMobilePositionin interfaceServerMessageProcessorHandler
-
updateMediaStatus
Description copied from interface:ServerMessageProcessorHandler更新媒体状态- Specified by:
updateMediaStatusin interfaceServerMessageProcessorHandler
-
updateDeviceRecord
Description copied from interface:ServerMessageProcessorHandler更新设备录像- Specified by:
updateDeviceRecordin interfaceServerMessageProcessorHandler
-
updateDeviceResponse
Description copied from interface:ServerMessageProcessorHandler更新设备通道- Specified by:
updateDeviceResponsein interfaceServerMessageProcessorHandler
-
updateDeviceInfo
Description copied from interface:ServerMessageProcessorHandler更新设备信息- Specified by:
updateDeviceInfoin interfaceServerMessageProcessorHandler
-
updateDeviceConfig
- Specified by:
updateDeviceConfigin interfaceServerMessageProcessorHandler
-
updateDeviceStatus
- Specified by:
updateDeviceStatusin 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
-