If a protocol supports multicast command delivery you can also add native HDM support for managing zones.
Native and Simulated Zone Management
Zones can be managed either natively by the protocol which connects to the devices (if supported) or it can also be simulated by the HDM module:
If a protocol supports zones natively : for each HDM-level zone that contains more than one device from the same protocol, the HDM automatically creates a protocol-level zone (also called "group"). When a command is executed, the HDM-level zone forwards it directly to the native device group and all devices receive it simultaneously.
If a protocol does not support zones natively : the HDM simulates the functionality by retrieving all devices from the group and executing the command on all of them one by one. This creates a delay which gets longer depending the amount of devices in the group.
You can add the HDM native zone management capability to a protocol by implementing the MulticastHandler interface and registering it as an OSGi service.
Implement the MulticastHandler Interface
The Home Device Manager handles multicast commands via the MulticastHandler interface.
Create Groups
Implement the methods used by the Home Device Manager for creating groups of devices:
Implement the setGroups method for creating multiple groups at once. The Home Device Manager calls this method when the MulticastHandler is registered in OSGi.
Implement the addGroup method for creating groups. The Home Device Manager calls this method when a new zone with more than one device from a given protocol is created. The addGroup method accepts the list of devices that are included in the group and an ID by which the group will be referred to by the Home Device Manager.
Implement the removeGroup method. The Home Device Manager calls this method when a Zone is removed or when it contains only one device.
Implement the addDevice and removeDevice methods for adding and removing devices from a group.
Invoke Commands
Implement the setDCOProperty and invokeDCOOperation and methods for setting properties and for executing operations on devices in a group. The methods accept the ID of the group and the standard set of arguments which are passed when performing the same action on the single device.
Register the MulticastHandler Implementation as an OSGi Service
Register the MulticastHandler instance as a service in the OSGi framework. Add a registration property to specify the adapter to which this service attaches to: