* Adds all the descendant devices of the devices in the exclusion list.
* @throws RepositoryException if there is a problem acessing the device
* repository
*/
private void addDescendantDevices() throws RepositoryException {
RepositoryConnection connection = null;
try {
Volantis volantis =
ApplicationInternals.getVolantisBean(application);
connection = volantis.getDeviceConnection();
// Create a copy of the list to iterate over. This must be done
// because child devices are added to the original list during
// iteration.
List excCopy = new ArrayList(excludedDevices);
if (logger.isDebugEnabled()) {
Iterator it = excludedDevices.iterator();
while (it.hasNext()) {
logger.debug("Added parent device for exclusion: " +
it.next());
}
}
Iterator it = excCopy.iterator();
while (it.hasNext()) {
// Determine the children of the current device.
String deviceName = (String) it.next();
List children = enumerateAllDevicesChildren(
deviceName, connection);
// Add the children to the exclusion list.
excludedDevices.addAll(children);
}
} finally {
connection.disconnect();
}
}