public class

DeviceManager

extends Object
implements Driver.DriverListener
java.lang.Object
   ↳ org.ocast.core.DeviceManager

Class Overview

Device manager is used to get control over your device.

Summary

Nested Classes
enum DeviceManager.Failure  
Public Constructors
DeviceManager(Device device, Consumer<DeviceManager.Failure> listener)
Initializes a new DeviceManager
DeviceManager(Device device, SSLConfig sslConfig, Consumer<DeviceManager.Failure> listener)
Initializes a new DeviceManager
Public Methods
void getApplicationController(String appId, Consumer<ApplicationController> onSuccess, Consumer<Throwable> onFailure)
Used to retrieve a reference to the ApplicationController
void getPrivateSettings(Consumer<PublicSettings> onSuccess, Consumer<Throwable> onFailure)
Used to get a reference to the private Setting controller class
void getPublicSettings(Consumer<PublicSettings> onSuccess, Consumer<Throwable> onFailure)
Used to get a reference to the public Settings controller class
void onFailure(Driver.Failure failure)
static void registerDriver(String id, Driver.Factory factory)
Registers a driver to connect to a device.
void releasePrivateSettings(Runnable callback)
Used to release the private settings controller resources
void releasePublicSettings(Runnable callback)
Used to release the public settings controller resources
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.ocast.core.Driver.DriverListener

Public Constructors

public DeviceManager (Device device, Consumer<DeviceManager.Failure> listener)

Initializes a new DeviceManager

Parameters
device the device to be managed
listener to be called to notify failures

public DeviceManager (Device device, SSLConfig sslConfig, Consumer<DeviceManager.Failure> listener)

Initializes a new DeviceManager

Parameters
device the device to be managed
sslConfig SSL configuration info
listener to be called to notify failures

Public Methods

public void getApplicationController (String appId, Consumer<ApplicationController> onSuccess, Consumer<Throwable> onFailure)

Used to retrieve a reference to the ApplicationController

Parameters
appId the application id to be managed
onSuccess to be called in case of success. Returns a reference to the ApplicationController
onFailure to be called in case of error

public void getPrivateSettings (Consumer<PublicSettings> onSuccess, Consumer<Throwable> onFailure)

Used to get a reference to the private Setting controller class

Parameters
onSuccess to be called in case of success. Returns a reference to the publicSetting.
onFailure to be called in case of error

public void getPublicSettings (Consumer<PublicSettings> onSuccess, Consumer<Throwable> onFailure)

Used to get a reference to the public Settings controller class

Parameters
onSuccess to be called in case of success. Returns a reference to the publicSetting.
onFailure to be called in case of error

public void onFailure (Driver.Failure failure)

public static void registerDriver (String id, Driver.Factory factory)

Registers a driver to connect to a device.

Parameters
id Driver manufacturer's name (cases sensitive). This value must match the manufacturer name present in the response to a MSEARCH Target
factory A Driver.Factory that instantiate the relevant Driver.

public void releasePrivateSettings (Runnable callback)

Used to release the private settings controller resources

Parameters
callback to be called once released

public void releasePublicSettings (Runnable callback)

Used to release the public settings controller resources

Parameters
callback to be called once released