| org.ocast.core.Link |
Known Indirect Subclasses
|
Interface Link is implemented by driver libraries to provide a network link with the device
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| interface | Link.LinkListener | Listener interface to be notified of event happening on the Link | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract void |
connect(Runnable onSuccess, Consumer<Throwable> onFailure)
Establish a communication link with the device
| ||||||||||
| abstract void |
disconnect(Runnable onSuccess)
Release the communication link
| ||||||||||
| abstract String |
getUrl()
Returns the URL used to establish the link
| ||||||||||
| abstract boolean |
sendPayload(String domain, JSONObject payload, Consumer<Reply> onSuccess, Consumer<Throwable> onFailure)
Send a payload on the link for the given
Module | ||||||||||
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 |
|---|---|
| payload | the payload to be sent |
| onSuccess | called on success, providing the Reply |
| onFailure | called if an error occured |