String streamModulesPath = Paths.build(definitionPath, Paths.MODULES);
List<ModuleDeploymentStatus> statusList = new ArrayList<ModuleDeploymentStatus>();
try {
List<String> moduleDeployments = client.getChildren().forPath(streamModulesPath);
for (String moduleDeployment : moduleDeployments) {
StreamDeploymentsPath streamDeploymentsPath = new StreamDeploymentsPath(
Paths.build(streamModulesPath, moduleDeployment));
statusList.add(new ModuleDeploymentStatus(
streamDeploymentsPath.getContainer(),
streamDeploymentsPath.getModuleSequence(),
new ModuleDescriptor.Key(streamName,
ModuleType.valueOf(streamDeploymentsPath.getModuleType()),
streamDeploymentsPath.getModuleLabel()),
ModuleDeploymentStatus.State.deployed, null));
}
}
catch (KeeperException.NoNodeException e) {
// indicates there are no modules deployed for this stream;