public interface DeviceManager
Modifier and Type | Method and Description |
---|---|
void |
deleteDevice(DeviceContext dctx)
Deletes a specific device.
|
HobsonDeviceDescriptor |
getDevice(DeviceContext dctx)
Returns a specific device.
|
PropertyContainer |
getDeviceConfiguration(DeviceContext dctx)
Returns a specific device's configuration.
|
java.lang.Object |
getDeviceConfigurationProperty(DeviceContext dctx,
java.lang.String name)
Returns a device configuration property.
|
java.lang.Long |
getDeviceLastCheckin(DeviceContext dctx)
Returns the last time a device checked in.
|
java.util.Collection<HobsonDeviceDescriptor> |
getDevices(HubContext hctx)
Returns all devices published by a hub.
|
java.util.Collection<HobsonDeviceDescriptor> |
getDevices(HubContext hctx,
java.lang.String tag)
Returns all devices with a given tag.
|
java.util.Collection<HobsonDeviceDescriptor> |
getDevices(PluginContext pctx)
Returns all devices published by a plugin.
|
DeviceVariableState |
getDeviceVariable(DeviceVariableContext ctx)
Returns the state of a device variable.
|
java.util.Collection<java.lang.String> |
getDeviceVariableNames(HubContext hctx)
Returns all variable names published by all devices.
|
boolean |
hasDevice(DeviceContext dctx)
Indicates whether a device has been published.
|
boolean |
hasDeviceVariable(DeviceVariableContext ctx)
Returns whether a device has published a variable.
|
boolean |
isDeviceAvailable(DeviceContext ctx)
Indicates whether a device is currently available.
|
Future |
publishDevice(HobsonDeviceProxy device,
java.util.Map<java.lang.String,java.lang.Object> config,
java.lang.Runnable runnable)
Called by plugins to publish device proxies to the device registry and start them.
|
void |
setDeviceConfiguration(DeviceContext dctx,
java.util.Map<java.lang.String,java.lang.Object> config)
Sets device configuration properties.
|
void |
setDeviceConfigurationProperty(DeviceContext dctx,
java.lang.String name,
java.lang.Object value)
Set a device configuration property.
|
void |
setDeviceName(DeviceContext dctx,
java.lang.String name)
Sets the name of a device.
|
void |
setDeviceTags(DeviceContext dctx,
java.util.Set<java.lang.String> tags)
Sets the tag(s) for a device.
|
void |
updateDeviceVariables(java.util.Collection<DeviceVariableDescriptor> vars)
Updates information about previously published device variables.
|
void deleteDevice(DeviceContext dctx)
dctx
- the context of the device to deleteHobsonDeviceDescriptor getDevice(DeviceContext dctx)
dctx
- the context of the device to retrieveDeviceNotFoundException
- if device isn't foundPropertyContainer getDeviceConfiguration(DeviceContext dctx)
dctx
- the context of the desired devicejava.lang.Object getDeviceConfigurationProperty(DeviceContext dctx, java.lang.String name)
dctx
- the context of the device to retrieve configuration forname
- the configuration property namejava.lang.Long getDeviceLastCheckin(DeviceContext dctx)
dctx
- the device contextjava.util.Collection<HobsonDeviceDescriptor> getDevices(PluginContext pctx)
pctx
- the context of the plugin that published the devicesjava.util.Collection<HobsonDeviceDescriptor> getDevices(HubContext hctx)
hctx
- the context of the hub that published the devicesjava.util.Collection<HobsonDeviceDescriptor> getDevices(HubContext hctx, java.lang.String tag)
hctx
- the context of the hub that published the devicestag
- the tag nameDeviceVariableState getDeviceVariable(DeviceVariableContext ctx)
ctx
- the variable contextboolean hasDeviceVariable(DeviceVariableContext ctx)
ctx
- the variable contextjava.util.Collection<java.lang.String> getDeviceVariableNames(HubContext hctx)
hctx
- the hub contextboolean hasDevice(DeviceContext dctx)
dctx
- the context of the device to checkboolean isDeviceAvailable(DeviceContext ctx)
ctx
- the device contextFuture publishDevice(HobsonDeviceProxy device, java.util.Map<java.lang.String,java.lang.Object> config, java.lang.Runnable runnable)
device
- the DeviceProxy to publishconfig
- the device configuration (or null if it is not known)runnable
- a Runnable to execute after the device has been successfully publishedvoid setDeviceConfiguration(DeviceContext dctx, java.util.Map<java.lang.String,java.lang.Object> config)
dctx
- the context of the target deviceconfig
- a map of configuration property name to valuesvoid setDeviceConfigurationProperty(DeviceContext dctx, java.lang.String name, java.lang.Object value)
dctx
- the context of the target devicename
- the configuration property namevalue
- the configuration property valuevoid setDeviceName(DeviceContext dctx, java.lang.String name)
dctx
- the device contextname
- the new name of the devicevoid setDeviceTags(DeviceContext dctx, java.util.Set<java.lang.String> tags)
dctx
- the device contexttags
- the tagsvoid updateDeviceVariables(java.util.Collection<DeviceVariableDescriptor> vars)
vars
- the variable descriptors to updateCopyright © 2015 Whizzo Software LLC. All rights reserved.