subTypes.add(confPath);
for (String cpath : subTypes) {
Address addr = new Address(parentPath);
Result result = connection.execute(new ReadChildrenNames(addr, cpath));
if (result.isSuccess()) {
@SuppressWarnings("unchecked")
List<String> subsystems = (List<String>) result.getResult();
// There may be multiple children of the given type
for (String val : subsystems) {
String newPath = cpath + "=" + val;
Configuration config2 = context.getDefaultPluginConfiguration();
String resKey;
if (path == null || path.isEmpty())
resKey = newPath;
else {
if (path.startsWith(","))
path = path.substring(1);
resKey = path + "," + cpath + "=" + val;
}
PropertySimple pathProp = new PropertySimple("path", resKey);
config2.put(pathProp);
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), // DataType
resKey, // Key
val, // Name
null, // Version
context.getResourceType().getDescription(), // subsystem.description
config2, null);
details.add(detail);
}
}
}
} else {
// Single subsystem
path += "," + confPath;
if (path.startsWith(","))
path = path.substring(1);
Result result = connection.execute(new ReadResource(new Address(path)));
if (result.isSuccess()) {
String resKey = path;
String name = resKey.substring(resKey.lastIndexOf("=") + 1);
Configuration config2 = context.getDefaultPluginConfiguration();
PropertySimple pathProp = new PropertySimple("path", path);