public abstract class AbstractHobsonDeviceProxy extends java.lang.Object implements HobsonDeviceProxy
Constructor and Description |
---|
AbstractHobsonDeviceProxy(HobsonPlugin plugin,
java.lang.String id,
java.lang.String defaultName,
DeviceType type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addTag(java.lang.String tag) |
protected DeviceProxyVariable |
createDeviceVariable(java.lang.String name,
VariableMask mask) |
protected DeviceProxyVariable |
createDeviceVariable(java.lang.String name,
VariableMask mask,
java.lang.Object value,
java.lang.Long lastUpdate) |
protected DeviceProxyVariable |
createDeviceVariable(java.lang.String name,
VariableMask mask,
VariableMediaType mediaType) |
protected DeviceProxyVariable |
createDeviceVariable(java.lang.String name,
VariableMask mask,
VariableMediaType mediaType,
java.lang.Object value,
java.lang.Long lastUpdate) |
PropertyContainerClass |
getConfigurationClass() |
protected java.lang.Object |
getConfigurationProperty(java.lang.String name) |
protected abstract TypedProperty[] |
getConfigurationPropertyTypes()
Returns an array of configuration properties the device supports.
|
DeviceContext |
getContext() |
java.lang.String |
getDefaultName() |
HobsonDeviceDescriptor |
getDescriptor() |
DeviceError |
getError() |
java.lang.Long |
getLastCheckin() |
java.lang.String |
getName() |
protected HobsonPlugin |
getPlugin()
Returns this device's plugin.
|
DeviceType |
getType() |
DeviceVariableState |
getVariableState(java.lang.String name) |
boolean |
hasError() |
boolean |
hasVariable(java.lang.String name) |
boolean |
isStarted() |
protected void |
postEvent(HobsonEvent event) |
protected void |
publishActionProvider(ActionProvider actionProvider) |
protected void |
publishVariables(java.util.Collection<DeviceProxyVariable> vars) |
protected void |
publishVariables(DeviceProxyVariable... vars) |
protected void |
setConfigurationProperty(java.lang.String name,
java.lang.Object value) |
protected void |
setError(DeviceError deviceError)
Sets the error information for this device and puts the device into an error state.
|
void |
setLastCheckin(java.lang.Long lastCheckin) |
protected void |
setVariableValue(java.lang.String name,
java.lang.Object value,
java.lang.Long updateTime) |
protected void |
setVariableValues(java.util.Map<java.lang.String,java.lang.Object> values) |
void |
start(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> config) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getManufacturerName, getManufacturerVersion, getModelName, getPreferredVariableName, onDeviceConfigurationUpdate, onSetVariables, onShutdown, onStartup
public AbstractHobsonDeviceProxy(HobsonPlugin plugin, java.lang.String id, java.lang.String defaultName, DeviceType type)
plugin
- the HobsonPlugin that created this deviceid
- the device IDdefaultName
- the default name of the device (used when a user-defined name does not exist)type
- the type of devicepublic PropertyContainerClass getConfigurationClass()
getConfigurationClass
in interface HobsonDeviceProxy
public DeviceContext getContext()
getContext
in interface HobsonDeviceProxy
public java.lang.String getDefaultName()
getDefaultName
in interface HobsonDeviceProxy
public HobsonDeviceDescriptor getDescriptor()
getDescriptor
in interface HobsonDeviceProxy
public DeviceError getError()
getError
in interface HobsonDeviceProxy
public java.lang.Long getLastCheckin()
getLastCheckin
in interface HobsonDeviceProxy
public java.lang.String getName()
getName
in interface HobsonDeviceProxy
public DeviceType getType()
getType
in interface HobsonDeviceProxy
public DeviceVariableState getVariableState(java.lang.String name)
getVariableState
in interface HobsonDeviceProxy
public boolean hasError()
hasError
in interface HobsonDeviceProxy
public boolean hasVariable(java.lang.String name)
hasVariable
in interface HobsonDeviceProxy
public boolean isStarted()
isStarted
in interface HobsonDeviceProxy
public void setLastCheckin(java.lang.Long lastCheckin)
setLastCheckin
in interface HobsonDeviceProxy
public void start(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config)
start
in interface HobsonDeviceProxy
protected void addTag(java.lang.String tag)
protected DeviceProxyVariable createDeviceVariable(java.lang.String name, VariableMask mask)
protected DeviceProxyVariable createDeviceVariable(java.lang.String name, VariableMask mask, VariableMediaType mediaType)
protected DeviceProxyVariable createDeviceVariable(java.lang.String name, VariableMask mask, VariableMediaType mediaType, java.lang.Object value, java.lang.Long lastUpdate)
protected DeviceProxyVariable createDeviceVariable(java.lang.String name, VariableMask mask, java.lang.Object value, java.lang.Long lastUpdate)
protected abstract TypedProperty[] getConfigurationPropertyTypes()
protected java.lang.Object getConfigurationProperty(java.lang.String name)
protected HobsonPlugin getPlugin()
protected void postEvent(HobsonEvent event)
protected void publishActionProvider(ActionProvider actionProvider)
protected void publishVariables(DeviceProxyVariable... vars)
protected void publishVariables(java.util.Collection<DeviceProxyVariable> vars)
protected void setConfigurationProperty(java.lang.String name, java.lang.Object value)
protected void setError(DeviceError deviceError)
deviceError
- the device error informationprotected void setVariableValue(java.lang.String name, java.lang.Object value, java.lang.Long updateTime)
protected void setVariableValues(java.util.Map<java.lang.String,java.lang.Object> values)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2015 Whizzo Software LLC. All rights reserved.