CDirectory is an invisible bean used to query the control system for
lists of devices, properties, or classes. It is an introspection widget
-- it doesn't monitor any value in the control system.
This bean is configured by specifing a regular expression for one or
more of device name, class name, or property name. Depending upon a
flag set by the user, an array of device names, property names or class
names can be retrieved. In the release (0.3), only device name query is
implemented. The class name and property name query as well as
set/getClassExpression methods are provided for release 0.4 and later.
The property name retrived are all the properties for the class. The
property expression pattern match (set/getPropertyExpression method) will
not be included in version 0.4.
The setQueryType method must be called after set*Expression to trigger
the DirectoryEvent. Again the query Type must equal CConstants.DEVICE_QUERY
in release (version 0.3). In release 0.4, the query type may be
one of: CLASS_QUERY, DEVICE_QUERY or PROPERTY_QUERY defined in CConstants
class. When the query type is set to CLASS_QUERY or PROPERTY_QUERY,
the classExpression must be set using setClassExpression. When the query
type is DEVICE_QUERY, either classExpression or deviceExpression need
be set.
To receive the directory service response, an object must implement the
CDirectoryListener interface and add itself as a listener to this bean.
There is one method, receivedNames (CDirectoryEvent e),
in the CDirectoryListener interface. This method takes CDirectoryEvent as
an argument. By calling getNames() in the CDirectoryEvent class, the
name array
(device names, property names or class names) can be obtained.