public class

ReferenceDriver

extends Object
implements Driver Link.LinkListener
java.lang.Object
   ↳ org.ocast.referencedriver.ReferenceDriver

Class Overview

Defines a driver implementing communications layers with a remote device

Summary

Nested Classes
class ReferenceDriver.ReferenceFactory A Driver.Factory for driver creation  
Constants
String SEARCH_TARGET
Public Constructors
ReferenceDriver(Device device, Driver.DriverListener listener)
ReferenceDriver(Device device, Driver.DriverListener listener, SSLConfig sslConfig)
Public Methods
void connect(Driver.Module module, Runnable onSuccess, Consumer<Throwable> onFailure)
Establish a network communication channel with the given Module
void connect(Driver.Module module, AdditionalData additionalData, Runnable onSuccess, Consumer<Throwable> onFailure)
Establish a network communication channel with the given Module
void disconnect(Driver.Module module, Runnable onSuccess)
Disconnects the given Module
PublicSettings getPublicSettings()
void onEvent(DriverEvent driverEvent)
an unsollicited event has been reported on the Link (could be a playback status update)
void onFailure(Throwable t)
Invoked when an error occured
void registerBrowser(Driver.BrowserListener browser)
void sendBrowserData(JSONObject data, Consumer<JSONObject> onSuccess, Consumer<Throwable> onFailure)
Sends data the the remote application browser
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.ocast.core.Driver
From interface org.ocast.core.Link.LinkListener

Constants

public static final String SEARCH_TARGET

Constant Value: "urn:cast-ocast-org:service:cast:1"

Public Constructors

public ReferenceDriver (Device device, Driver.DriverListener listener)

public ReferenceDriver (Device device, Driver.DriverListener listener, SSLConfig sslConfig)

Public Methods

public void connect (Driver.Module module, Runnable onSuccess, Consumer<Throwable> onFailure)

Establish a network communication channel with the given Module

Parameters
module the targeted Module
onSuccess to be called in case of success.
onFailure to be called in case of error.

public void connect (Driver.Module module, AdditionalData additionalData, Runnable onSuccess, Consumer<Throwable> onFailure)

Establish a network communication channel with the given Module

Parameters
module the targeted Module
onSuccess to be called in case of success.
onFailure to be called in case of error.

public void disconnect (Driver.Module module, Runnable onSuccess)

Disconnects the given Module

Parameters
module the module to be disconnected
onSuccess to be called in case of success.

public PublicSettings getPublicSettings ()

public void onEvent (DriverEvent driverEvent)

an unsollicited event has been reported on the Link (could be a playback status update)

public void onFailure (Throwable t)

Invoked when an error occured

Parameters
t the cause of the error

public void registerBrowser (Driver.BrowserListener browser)

public void sendBrowserData (JSONObject data, Consumer<JSONObject> onSuccess, Consumer<Throwable> onFailure)

Sends data the the remote application browser