public class

Browser

extends Object
implements Driver.BrowserListener
java.lang.Object
   ↳ org.ocast.core.Browser

Class Overview

Class managing communication with the remote browser

Summary

Public Constructors
Browser(Driver driver)
Initializes a new Browser that will use the given Driver to communicate with the device.
Public Methods
void onData(JSONObject browserData)
void registerStream(DataStream dataStream)
Registers a DataStream that will be able to communicate with the remote browser
void sendData(String service, JSONObject data, Consumer<JSONObject> onSuccess, Consumer<Throwable> onFailure)
Sends data to the browser specifying a specific service to be addressed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.ocast.core.Driver.BrowserListener

Public Constructors

public Browser (Driver driver)

Initializes a new Browser that will use the given Driver to communicate with the device.

Parameters
driver a Driver object that will be used to send/receive data

Public Methods

public void onData (JSONObject browserData)

public void registerStream (DataStream dataStream)

Registers a DataStream that will be able to communicate with the remote browser

Parameters
dataStream a DataStream object that will be managed by this Browser

public void sendData (String service, JSONObject data, Consumer<JSONObject> onSuccess, Consumer<Throwable> onFailure)

Sends data to the browser specifying a specific service to be addressed. It basically wraps data adding the service key

Parameters
service the targeted service
data data to be sent
onSuccess to be called on success
onFailure to be called on failure