shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.walker.push;
 
import java.util.List;
 
/**
 * 推送管理器定义,负责推送处理,外部调用该对象。
 * @author 时克英
 * @date 2023-04-21
 */
public interface PushManager {
 
    void register(Pushable pushable);
 
    /**
     * 推送通知,当指定了推送者id时,优先使用。
     * @param notification
     * @param pushableId 指定的推送者id,只有同一个通道存在多个实现时可用。
     * @return
     */
    PushResult push(Notification notification, String pushableId);
 
    /**
     * 推送短信接口单独定义,因为平台业务中需要重新实现,包装。
     * @param notification
     * @return
     * @date 2023-04-25
     * @date 2023-04-26 去掉mock参数,直接由通道决定是否测试
     */
    PushResult pushSms(Notification notification);
 
    PushResult push(List<Notification> list);
 
    void addStrategy(Strategy strategy);
 
    /**
     * 返回已注册的推送对象集合。
     * @return
     * @date 2023-04-25
     */
    List<Pushable> getPushList();
 
    /**
     * 根据通道类型,返回该类型下推送对象(集合),可能会存在多个。
     * @param channel
     * @return
     * @date 2023-04-25
     */
    List<Pushable> getPushList(NotificationChannel channel);
 
    /**
     * 根据索引值,获取推送者对象。
     * @param id 推送对象id
     * @return
     * @date 2023-04-25
     */
    Pushable getPushObject(String id);
 
    /**
     * 对于普通消息推送,存在多通道时,是否支持并行(全部推送),<br>
     * 如果为否,则表示:只要一个通道完成即可。
     * @return
     * @date 2023-04-26
     */
    boolean isMessageParallel();
 
    /**
     * 返回普通消息,推送的配置的通道索引集合。
     * @return
     * @date 2023-04-26
     */
    List<String> getMessageChannelNames();
 
    /**
     * 设置异步推送者需要的监听器。
     * @param listener
     * @date 2023-04-27
     */
    void setAsyncListener(PushStatusListener listener);
}