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, wait
getSerialNumber
public Set<String> getProperties()
GenericDevice
getProperties
in interface GenericDevice
public Object getPropertyValue(String propertyName)
GenericDevice
getPropertyValue
in interface GenericDevice
public void setPropertyValue(String propertyName, Object value)
GenericDevice
setPropertyValue
in interface GenericDevice
public boolean removeProperty(String propertyName)
GenericDevice
removeProperty
in interface GenericDevice
propertyName
- the property namepublic boolean constainsProperty(String propertyName)
GenericDevice
constainsProperty
in interface GenericDevice
propertyName
- the property namepublic boolean hasPropertyValue(String propertyName)
GenericDevice
hasPropertyValue
in interface GenericDevice
propertyName
- the property namepublic String getState()
GenericDevice
getState
in interface GenericDevice
public void setState(String state)
GenericDevice
setState
in interface GenericDevice
state
- activation state to setpublic String getFault()
GenericDevice
getFault
in interface GenericDevice
public void setFault(String fault)
GenericDevice
setFault
in interface GenericDevice
public void addListener(DeviceListener<?> listener)
GenericDevice
addListener
in interface GenericDevice
listener
- the listener to addpublic void removeListener(DeviceListener<?> listener)
GenericDevice
removeListener
in interface GenericDevice
listener
- the listener to removeprotected void notifyListeners(DeviceEvent event)
public void enterInZones(List<Zone> zones)
GenericDevice
enterInZones
in interface GenericDevice
zones
- The list of zones where the device has enteredpublic void leavingZones(List<Zone> zones)
GenericDevice
leavingZones
in interface GenericDevice
zones
- The list of zones where that device has leavedCopyright © 2012-2013 ADELE Research Group. All Rights Reserved.