@Beta public interface DeviceHandshaker extends DeviceConnect
Modifier and Type | Method and Description |
---|---|
default void |
addDeviceAgentListener(ProviderId providerId,
DeviceAgentListener listener)
Adds a device agent listener for the given provider ID.
|
MastershipRole |
getRole()
Returns the last known mastership role agreed by the device for this
node.
|
CompletableFuture<Boolean> |
isReachable()
Checks the reachability (connectivity) of a device.
|
default void |
removeDeviceAgentListener(ProviderId providerId)
Removes a device agent listener previously registered for the given
provider ID.
|
void |
roleChanged(MastershipRole newRole)
Notifies the device a mastership role change as decided by the core.
|
connect, disconnect, isConnected
handler, setHandler
CompletableFuture<Boolean> isReachable()
void roleChanged(MastershipRole newRole)
DeviceAgentEvent
signaling the mastership role accepted by the device.newRole
- new mastership roleMastershipRole getRole()
default void addDeviceAgentListener(ProviderId providerId, DeviceAgentListener listener)
providerId
- provider IDlistener
- device agent listenerdefault void removeDeviceAgentListener(ProviderId providerId)
providerId
- provider ID