目录

Public Constructor Summary

Constructor
public Policy.Builder()
Creates an instance of Policy.

Public Method Summary

Return typeMethod name
Policybuild()
Creates an instance of Policy.
Policy.Builder setFindingMode(int findingMode)
Sets the scanning mode.
Policy.Builder setDistanceType(int distanceType)
For message publishing, the published message will only be delivered to subscribing devices that are at the most specified distance. For message subscription, messages will only be delivered if the publishing device is at the most specified distance.
Policy.Builder setTtlSeconds(int ttlSeconds)
Sets the time to live (TTL) of a published or subscribed message.

Public Constructors

Constructor
public Policy.Builder()
Creates an instance of Policy.

Public Methods

Method
public Policy build()
Creates an instance of Policy.
Method
public Policy.Builder setFindingMode(int findingMode)
Sets the scanning mode, which determines how devices detect each other.

Parameters

Parameter nameParameter desc
findingModeMode to detect devices, which is one of Policy.POLICY_FINDING_MODE_*.
Method
public Policy.Builder setDistanceType(int distanceType)
For message publishing, the published message will only be delivered to subscribing devices that are at the most specified distance. For message subscription, messages will only be delivered if the publishing device is at the most specified distance.

Parameters

Parameter nameParameter desc
distanceTypeDistance type, which is one of Policy.POLICY_DISTANCE_TYPE_*.
Method
public Policy.Builder setTtlSeconds(int ttlSeconds)
Sets the TTL of a published or subscribed message. The TTL can either be TTL_SECONDS_INFINITE or a value ranging from 1 to TTL_SECONDS_MAX. If the TTL is not set, TTL_SECONDS_DEFAULT is used by default.

Parameters

Parameter nameParameter desc
ttlSecondsTTL.