NIMSDK-AOS  9.19.0
CallExParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.avsignalling.model;
2 
4 
5 public class CallExParam {
6 
7  private final ChannelType channelType;
8  private final String accountId;
9  private final String requestId;
10 
11  private String channelName;
12  private String channelExt;
13  private Long selfUid;
14  private Boolean offlineEnable;
15  private String customInfo;
16  private SignallingPushConfig pushConfig;
17  private String nertcChannelName;
18  private Long nertcTokenTtl;
19  private String nertcJoinRoomQueryParamMap;
20 
21  private CallExParam(ChannelType channelType, String accountId, String requestId) {
22  this.channelType = channelType;
23  this.accountId = accountId;
24  this.requestId = requestId;
25  }
26 
27  /**
28  * 获取频道类型
29  */
31  return channelType;
32  }
33 
34  /**
35  * 获取对方的accid
36  */
37  public String getAccountId() {
38  return accountId;
39  }
40 
41  /**
42  * 获取邀请id
43  */
44  public String getRequestId() {
45  return requestId;
46  }
47 
48  /**
49  * 获取频道名
50  */
51  public String getChannelName() {
52  return channelName;
53  }
54 
55  /**
56  * 获取频道扩展字段
57  */
58  public String getChannelExt() {
59  return channelExt;
60  }
61 
62  /**
63  * 获取自己的uid
64  */
65  public Long getSelfUid() {
66  return selfUid;
67  }
68 
69  /**
70  * 相应的通知是否存离线
71  */
72  public Boolean getOfflineEnable() {
73  return offlineEnable;
74  }
75 
76  /**
77  * 获取邀请者附加的自定义信息,透传给被邀请者
78  */
79  public String getCustomInfo() {
80  return customInfo;
81  }
82 
83  /**
84  * 获取推送配置
85  */
87  return pushConfig;
88  }
89 
90  /**
91  * 获取云信G2-RTC的房间名
92  */
93  public String getNertcChannelName() {
94  return nertcChannelName;
95  }
96 
97  /**
98  * 获取云信G2-RTC的token的有效期
99  */
100  public Long getNertcTokenTtl() {
101  return nertcTokenTtl;
102  }
103 
104  /**
105  * 获取云信G2-RTC加入房间的请求参数
106  */
108  return nertcJoinRoomQueryParamMap;
109  }
110 
111  public static final class CallExParamBuilder {
112  private final ChannelType channelType;
113  private final String accountId;
114  private final String requestId;
115  private String channelName;
116  private String channelExt;
117  private Long selfUid;
118  private Boolean offlineEnable;
119  private String customInfo;
120  private SignallingPushConfig pushConfig;
121  private String nertcChannelName;
122  private Long nertcTokenTtl;
123  private String nertcJoinRoomQueryParamMap;
124 
125  /***
126  * @param channelType 频道类型
127  * @param accountId 对方的accid
128  * @param requestId 邀请id ,发起邀请者自行生成(要保证唯一性)
129  */
130  public CallExParamBuilder(ChannelType channelType, String accountId, String requestId) {
131  this.channelType = channelType;
132  this.accountId = accountId;
133  this.requestId = requestId;
134  }
135 
136  /**
137  * 指定频道名
138  */
139  public CallExParamBuilder withChannelName(String channelName) {
140  this.channelName = channelName;
141  return this;
142  }
143 
144  /**
145  * 指定频道扩展字段
146  */
147  public CallExParamBuilder withChannelExt(String channelExt) {
148  this.channelExt = channelExt;
149  return this;
150  }
151 
152  /**
153  * 指定自己的uid,不指定的话,服务端会自动生成。如果指定请保持维一性
154  */
155  public CallExParamBuilder withSelfUid(Long selfUid) {
156  this.selfUid = selfUid;
157  return this;
158  }
159 
160  /**
161  * 指定相应的通知是否存离线
162  */
163  public CallExParamBuilder withOfflineEnable(Boolean offlineEnable) {
164  this.offlineEnable = offlineEnable;
165  return this;
166  }
167 
168  /**
169  * 指定邀请者附加的自定义信息,透传给被邀请者
170  */
171  public CallExParamBuilder withCustomInfo(String customInfo) {
172  this.customInfo = customInfo;
173  return this;
174  }
175 
176  /**
177  * 指定推送配置
178  */
179  public CallExParamBuilder withPushConfig(SignallingPushConfig pushConfig) {
180  this.pushConfig = pushConfig;
181  return this;
182  }
183 
184  /**
185  * 指定云信G2-RTC的房间名,如果填了该字段,则会返回token
186  */
187  public CallExParamBuilder withNertcChannelName(String nertcChannelName) {
188  this.nertcChannelName = nertcChannelName;
189  return this;
190  }
191 
192  /**
193  * 指定云信G2-RTC的token的有效期,单位秒,选填,默认10分钟
194  */
195  public CallExParamBuilder withNertcTokenTtl(Long nertcTokenTtl) {
196  this.nertcTokenTtl = nertcTokenTtl;
197  return this;
198  }
199 
200  /**
201  * 指定云信G2-RTC加入房间的请求参数,可转化为json的字符串
202  */
203  public CallExParamBuilder withNertcJoinRoomQueryParamMap(String nertcJoinRoomQueryParamMap) {
204  this.nertcJoinRoomQueryParamMap = nertcJoinRoomQueryParamMap;
205  return this;
206  }
207 
208  public CallExParam build() {
209  CallExParam callExParam = new CallExParam( this.channelType, this.accountId, this.requestId);
210  callExParam.nertcChannelName = this.nertcChannelName;
211  callExParam.channelExt = this.channelExt;
212  callExParam.pushConfig = this.pushConfig;
213  callExParam.channelName = this.channelName;
214  callExParam.customInfo = this.customInfo;
215  callExParam.nertcJoinRoomQueryParamMap = this.nertcJoinRoomQueryParamMap;
216  callExParam.selfUid = this.selfUid;
217  callExParam.offlineEnable = this.offlineEnable;
218  callExParam.nertcTokenTtl = this.nertcTokenTtl;
219  return callExParam;
220  }
221  }
222 }
String getCustomInfo()
获取邀请者附加的自定义信息,透传给被邀请者
String getChannelExt()
获取频道扩展字段
String getNertcChannelName()
获取云信G2-RTC的房间名
String getNertcJoinRoomQueryParamMap()
获取云信G2-RTC加入房间的请求参数
ChannelType getChannelType()
获取频道类型
Boolean getOfflineEnable()
相应的通知是否存离线
Long getNertcTokenTtl()
获取云信G2-RTC的token的有效期
SignallingPushConfig getPushConfig()
获取推送配置