public abstract class AbstractDevice extends Object implements GenericDevice
GenericDevice interface that manages the
listeners addition, removal and notifications.| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
DEFAULT_HEIGHT, DEFAULT_WIDTH, DEVICE_SERIAL_NUMBER, FAULT_NO, FAULT_PROPERTY_NAME, FAULT_UNKNOWN, FAULT_YES, LOCATION_PROPERTY_NAME, LOCATION_UNKNOWN, STATE_ACTIVATED, STATE_DEACTIVATED, STATE_PROPERTY_NAME, STATE_UNKNOWN| Constructor and Description |
|---|
AbstractDevice() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(DeviceListener<?> listener)
Add the specified listener to the list of this device's listeners.
|
boolean |
constainsProperty(String propertyName)
Determines if the device contains a property definition with this name
|
void |
enterInZones(List<Zone> zones)
Callback notifying this device enters in one or more zones
|
boolean |
equals(Object o) |
String |
getFault()
Returns fault state of this device.
|
Set<String> |
getProperties()
Returns names of all properties which define the device state.
|
Object |
getPropertyValue(String propertyName)
Returns the specified property value.
|
String |
getState()
Returns activation state of this device.
|
int |
hashCode() |
boolean |
hasPropertyValue(String propertyName)
Determines if a property has been set.
|
void |
leavingZones(List<Zone> zones)
Callback notifying this device leaves one or more zones
|
protected void |
notifyListeners(DeviceEvent event)
Notify all listeners.
|
void |
removeListener(DeviceListener<?> listener)
Remove the specified listener from the list of this device's listeners.
|
boolean |
removeProperty(String propertyName)
Removes a property on this device.
|
void |
setFault(String fault)
Sets fault state of this device.
|
void |
setPropertyValue(String propertyName,
Object value)
Sets specified property value.
|
void |
setState(String state)
Sets activation state of this device.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetSerialNumberpublic Set<String> getProperties()
GenericDevicegetProperties in interface GenericDevicepublic Object getPropertyValue(String propertyName)
GenericDevicegetPropertyValue in interface GenericDevicepublic void setPropertyValue(String propertyName, Object value)
GenericDevicesetPropertyValue in interface GenericDevicepublic boolean removeProperty(String propertyName)
GenericDeviceremoveProperty in interface GenericDevicepropertyName - the property namepublic boolean constainsProperty(String propertyName)
GenericDeviceconstainsProperty in interface GenericDevicepropertyName - the property namepublic boolean hasPropertyValue(String propertyName)
GenericDevicehasPropertyValue in interface GenericDevicepropertyName - the property namepublic String getState()
GenericDevicegetState in interface GenericDevicepublic void setState(String state)
GenericDevicesetState in interface GenericDevicestate - activation state to setpublic String getFault()
GenericDevicegetFault in interface GenericDevicepublic void setFault(String fault)
GenericDevicesetFault in interface GenericDevicepublic void addListener(DeviceListener<?> listener)
GenericDeviceaddListener in interface GenericDevicelistener - the listener to addpublic void removeListener(DeviceListener<?> listener)
GenericDeviceremoveListener in interface GenericDevicelistener - the listener to removeprotected void notifyListeners(DeviceEvent event)
public void enterInZones(List<Zone> zones)
GenericDeviceenterInZones in interface GenericDevicezones - The list of zones where the device has enteredpublic void leavingZones(List<Zone> zones)
GenericDeviceleavingZones in interface GenericDevicezones - The list of zones where that device has leavedCopyright © 2012-2013 ADELE Research Group. All Rights Reserved.