The util package contains several other, smaller utilities.
Home Device Matcher
The Home Device Matcher (com.prosyst.mbs.services.hdm.util.HomeDeviceMatcher) utility class enables you to perform a search on a given array of Home Devices and to filter out those of them that do not meet your criteria.
You define your search requirements in the form of an LDAP filter, as in the getHomeDevices method of the Home Device Admin.
The method matches all Home Devices from your array against the LDAP filter and returns only those that match.
Convert
The Convert utility (com.prosyst.mbs.services.hdm.util.convert.Convert) provides methods for converting operation arguments and property values to the format, that is required by the device class interface.
When you execute an operation of a Device Class Object without being able to retrieve the object itself (as from the HAM module or from a zone) you must provide the operation's arguments as an array where each argument is formatted in the correct type (string int etc.). The same is valid for when you change a property of a Device Class Object - you must provide the new value of the property in the correct format.
Zone Utility
The Zone Utility (com.prosyst.mbs.services.hdm.util.event.ZoneUtility) allows you to easily subscribe to events fired by a specific group of devices within specific zones. Events of interest can be filtered by using an LDAP filter for Home Devices and Home Zones.
Device Class Metadata
The Device Class Metadata utility (com.prosyst.mbs.services.hdm.util.metadata.DCMetaData) allows you to retrieve the device class metadata from the OSGi Metatype Service and have it parsed in main portions like device class short name, full name, etc., and default metadata of properties and operations.
First, get the DCMetadata instance for a device class by using the getMetaData static method and then invoke the relevant methods on the returned object. The utility allows you to retrieve the default metadata about the Device Class Object properties and operations.
Beside the default property and operation metadata (the one provided by the Home Device Manager) each Device Class Object has an implementation-specific property and operation metadata (provided by the specific Protocol Adapter). To retrieve the implementation-specific metadata, use the getPropertyMetaData and getOperationMetaData methods of the com.prosyst.mbs.services.hdm.DeviceClassObject
Load Class
Utility for dynamic loading of Java classes. Can be used instead of the Class.forName method. This utility gives the ability to load a class by the class loader of the bundle which exports the package of that class. Also avoid from stopping, unresolving, resolving and starting again a bundle importing package of the loaded class in case the exported bundle has been unresolved. Due to this reason the utility should not be used in cases the loaded class is cached. In case it's cached, the caller should listen for bundle events of the exported bundle. When the exported bundle has been unresolved, the loaded class must be removed from the cache.