目录

Channel

Class Info

public final class Channel extends GenericJson

资源变更通知通道数据模型类。

Public Constructor Summary

Constructor Name

Channel()

Channel类构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

Channel

clone()

克隆一个Channel类对象。

Long

getExpirationTime()

获取通知通道到期的日期和时间。

String

getUrl()

获取接收通道通知的业务服务器地址。

String

getId()

获取一个唯一的ID,标识这个订阅通道。

String

getCategory()

获取资源类型,固定值为api#channel。

Map<String, String>

getParams()

获取控制下发信道行为的附加参数。

Boolean

getPayload()

获取是否需要信道的有效载荷。

String

getResourceId()

获取资源ID,标识通道上接收通知的资源。

String

getResourceUri()

获取资源版本标识符。

String

getType()

获取发送机制类型,当前固定值web_hook。

String

getUserToken()

获取任意字符串,携带回传给url。

Channel

set(String fieldName, Object value)

设置自定义属性及属性值。

Channel

setCategory(String category)

设置资源类型,固定值为api#channel。

Channel

setExpirationTime(Long expirationTime)

设置通知通道到期的日期和时间。

Channel

setId(String id)

设置一个唯一的ID,标识这个订阅通道。

Channel

setParams(Map<String, String> params)

设置控制下发信道行为的附加参数。

Channel

setPayload(Boolean payload)

设置是否需要信道的有效载荷。

Channel

setResourceId(String resourceId)

设置资源ID,标识通道上接收通知的资源。

Channel

setResourceUri(String resourceUri)

设置资源版本标识符。

Channel

setType(String type)

设置发送机制类型,当前固定值web_hook。

Channel

setUrl(String url)

设置接收通道通知的业务服务器地址。

Channel

setUserToken(String userToken)

设置任意字符串,携带回传给url。

Public Constructors

[h2]Channel

Constructor

Channel()

构造一个Channel类对象。

Public Methods

[h2]getUrl

Method

public String getUrl()

获取接收通道通知的业务服务器地址。

Returns

Type

Description

String

返回接收通道通知的业务服务器地址。

[h2]setUrl

Method

public Channel setUrl(String url)

设置接收通道通知的业务服务器地址。

Parameters

Name

Description

url

接收通道通知的业务服务器地址,必须为HTTPS地址,格式为https://…… 。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getId

Method

public String getId()

获取一个唯一的ID,标识这个订阅通道。

Returns

Type

Description

String

唯一的ID,标识这个订阅通道。

[h2]setId

Method

public Channel setId(String id)

设置一个唯一的ID,标识这个订阅通道。

Parameters

Name

Description

id

唯一的ID,标识这个订阅通道。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getCategory

Method

public String getCategory()

获取资源类型,固定值为api#channel。

Returns

Type

Description

String

资源类型,固定值为api#channel。

[h2]setCategory

Method

public Channel setCategory(String category)

设置资源类型,固定值为api#channel。

Parameters

Name

Description

category

资源类型,固定值为api#channel。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getResourceId

Method

public String getResourceId()

获取资源ID,标识通道上接收通知的资源。

Returns

Type

Description

String

资源ID,标识通道上接收通知的资源。

[h2]setResourceId

Method

public Channel setResourceId(String resourceId)

设置资源ID,标识通道上接收通知的资源。

Parameters

Name

Description

resourceId

资源ID,标识通道上接收通知的资源(响应结果必选)。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getResourceUri

Method

public String getResourceUri()

获取资源版本标识符。

Returns

Type

Description

String

资源版本标识符。

[h2]setResourceUri

Method

public Channel setResourceUri(String resourceUri)

设置资源版本标识符。

Parameters

Name

Description

resourceUri

资源版本标识符(响应结果必选)。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getUserToken

Method

public String getUserToken()

获取任意字符串,携带回传给url。

Returns

Type

Description

String

任意字符串,携带回传给url。

[h2]setUserToken

Method

public Channel setUserToken(String userToken)

设置任意字符串,携带回传给url。

Parameters

Name

Description

userToken

任意字符串。发送消息回调通知时,回传给业务,可选参数,如业务方接收的回调通知中需要携带userToken信息,可设置该参数,格式要求:使用数字或字母(大小写均可),长度<=64。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getType

Method

public String getType()

发送机制类型,当前固定值web_hook,表示通过web类型进行回调通知。

Returns

Type

Description

String

发送机制类型,当前固定值web_hook,表示通过web类型进行回调通知。

[h2]setType

Method

public Channel setType(String type)

设置发送机制类型,当前固定值web_hook,表示通过web类型进行回调通知。

Parameters

Name

Description

type

发送机制类型,当前固定值web_hook,表示通过web类型进行回调通知。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getExpirationTime

Method

public Long getExpirationTime()

获取通知通道到期的日期和时间,以Unix时间戳表示,以毫秒为单位,File资源最长1天,Change资源最长一周。

Returns

Type

Description

Long

通知通道到期的日期和时间。

[h2]setExpirationTime

Method

public Channel setExpirationTime(Long expirationTime)

设置通知通道到期的日期和时间。

Parameters

Name

Description

expirationTime

通知通道到期的日期和时间,以Unix时间戳表示,以毫秒为单位,File资源最长1天,Change资源最长一周。不传的话,Change资源默认有效期1小时。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getParams

Method

public Map<String, String> getParams()

获取控制下发信道行为的附加参数。

Returns

Type

Description

Map<String, String>

控制下发信道行为的附加参数。

[h2]setParams

Method

public Channel setParams(Map<String, String> params)

设置控制下发信道行为的附加参数。

Parameters

Name

Description

params

控制下发信道行为的附加参数。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]getPayload

Method

public Boolean getPayload()

获取是否需要信道的有效载荷。

Returns

Type

Description

Boolean

是否需要信道的有效载荷。

[h2]setPayload

Method

public Channel setPayload(Boolean payload)

设置是否需要信道的有效载荷。

Parameters

Name

Description

payload

是否需要信道的有效载荷。

true:需要;false:无需。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]set

Method

public Channel set(String fieldName,Object value)

设置自定义属性及属性值。

Parameters

Name

Description

fieldName

属性名称。

value

属性值。

Returns

Type

Description

Channel

返回一个Channel对象。

[h2]clone

Method

public Channel clone()

克隆一个Channel类对象。

Returns

Type

Description

Channel

返回一个Channel对象。