The HomeDeviceAdminSpi (com.prossyt.mbs.services.hdm.spi.HomeDeviceAdminSpi) provides callback for HomeProtocolAdapter to Device Access. HomeDeviceAdminSpi notifies when a new device is added, re-added or removed, or when a device property of a DeviceClassObjecSpi is changed.
Notifying Device Access when a New HomeDeviceSpi is Added
When a new HomeDeviceSpi is added to the network, the HomeDeviceAdminSpi will notify Device Access that a new device is added or re-added. The HomeProtocolAdapter should invoke the method HomeDeviceAdminSpi.homeDeviceAdded(HomeDeviceSpi) or HomeDeviceAdminSpi.homeDeviceAdded(HomeDeviceSpi, int).
The second parameter of this method is the mode of adding the device. The protocol adapter possible values are:
Notifying Device Access that a HomeDeviceSpi is Removed
The protocol adapter invokes the method HomeDeviceAdminSpi.homeDeviceRemoved(HomeDeviceSpi) when an existing HomeDeviceSpi is removed from the network. HomeDeviceAdminSpi on its turn will notify Device Access that an existing device is removed from the network.
Notifying Device Access when HomeDeviceSpi Properties are Changed
The protocol adapter invokes the following methods, when an existing HomeDeviceSpi changes its name, vendor, version, type, or properties respectively.
HomeDeviceAdminSpi will notify Device Access about these changes.
The protocol adapter invokes HomeDeviceAdminSpi.homeDeviceStatusChanged(HomeDeviceSpi, int, HomeDeviceError, boolean)when an existing HomeDeviceSpi changes its status. Additionally, a device error has to be provided. The protocol adapter is also able to force a device refresh. This will lead to updating the internal cache. You can learn more about the internal cache in the Property Cache section.
Notifying Device Access when a HomeDeviceSpi is Invalidated
The protocol adapter invokes the method HomeDeviceAdminSpi.invalidateHomeDevice(HomeDeviceAdminSpi)when the reference of the HomeDeviceSpi is removed. On its turn, HomeDeviceAdminSpi notifies Device Access. The Device Access will remove the reference to this HomeDeviceSpi and to its DeviceClassObjectSpi objects. After the protocol adapter notifies that the HomeDeviceSpi is removed and the device is invalid, then the device can be removed by using HomeProtocolAdapterRemover.
Notifying Device Access when a Cache for HomeDeviceSpi has to be Refreshed
The protocol adapter invokes the method HomeDeviceAdminSpi.homeDeviceRefresh(HomeDeviceSpi, DeviceClassObjectSpi, String) when a device has to be refreshed. This means that its internal cache has to be updated. You can learn more about the internal property cache in the Property Cache section.
Notifying Device Access that a New DeviceClassObjectSpi is Added to the Specified HomeDeviceSpi
The protocol adapter invokes the method HomeDeviceAdminSpi.deviceClassObjectAdd(HomeDeviceSpi, DeviceClassObjectSpi) when a new device class object is added to the specified HomeDeviceSpi. The HomeDeviceAdminSpi will notify Device Access that the specified HomeDeviceSpi has a new DeviceClassObjectSpi.
Notifying Device Access that an Existing DeviceClassObjectSpi is not Available Anymore for the Specified HomeDeviceSpi
The protocol adapter invokes the method HomeDeviceAdminSpi.deviceClassObjectRemove(HomeDeviceSpi,DeviceClassObjectSpi) when an existing device class object is not available for the specified HomeDeviceSpi. The HomeDeviceAdminSpi will notify Device Access that a specific HomeDeviceSpi has no available DeviceClassObjectSpi.
Notifying Device Access when a DeviceClassObjectSpi Property is Changed
The protocol adapter invokes the method HomeDeviceAdminSpi.deviceClassObjectPropertyChange(HomeDeviceSpi, DeviceClassObjectSpi, String, Object, boolean, boolean)when a DeviceClassObjectSpi property is changed. This is related to the caching property values process – learn more about it in the Property Cache section. Device Access sends an event that the property is changed in two situations: