xieb
2024-04-03 ba82d296ae3f3e5fd7e14907aab2103418d37011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.dji.sample.component.websocket.service;
 
import com.dji.sample.component.websocket.config.ConcurrentWebSocketSession;
import com.dji.sample.component.websocket.model.CustomWebSocketMessage;
 
import java.util.Collection;
 
/**
 * @author sean.zhou
 * @date 2021/11/24
 * @version 0.1
 */
public interface ISendMessageService {
 
    /**
     * Send a message to the specific connection.
     * @param session   A WebSocket connection object
     * @param message   message
     */
    void sendMessage(ConcurrentWebSocketSession session, CustomWebSocketMessage message);
 
    /**
     * Send the same message to specific connection.
     * @param sessions  A collection of WebSocket connection objects.
     * @param message   message
     */
    void sendBatch(Collection<ConcurrentWebSocketSession> sessions, CustomWebSocketMessage message);
 
    void sendBatch(String workspaceId, Integer userType, String bizCode, Object data);
 
    void sendBatch(String workspaceId, String bizCode, Object data);
}