| java.lang.Object | |
| ↳ | org.ocast.referencedriver.ReferenceLink |
Defines a logical link between the driver and a remote device
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | PING_INTERVAL | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ReferenceLink(LinkProfile profile, Link.LinkListener listener) | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
connect(Runnable onSuccess, Consumer<Throwable> onFailure)
Establish a communication link with the device
| ||||||||||
| void |
disconnect(Runnable onSuccess)
Release the communication link
| ||||||||||
| String |
getUrl()
Returns the URL used to establish the link
| ||||||||||
| boolean |
sendPayload(String domain, JSONObject message, Consumer<Reply> onSuccess, Consumer<Throwable> onFailure)
Send a payload on the link for the given
Module | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.ocast.core.Link
| |||||||||||
Establish a communication link with the device
| onSuccess | called when the link has been properly connected |
|---|---|
| onFailure | called when an error |
Release the communication link
Returns the URL used to establish the link
Send a payload on the link for the given Module
| domain | the targeted Module |
|---|---|
| message | the payload to be sent |
| onSuccess | called on success, providing the Reply |
| onFailure | called if an error occured |