protected static String aliveText(Container container) {
return container.isAlive() ? "yes" : "";
}
private void printContainersVerbose(Container[] containers, Version version, PrintStream out) {
TablePrinter table = new TablePrinter();
table.columns("id", "version", "type", "connected", "profiles", "blueprint", "spring", "provision status");
for (Container container : containers) {
if (CommandUtils.matchVersion(container, version)) {
String indent = "";
for (Container c = container; !c.isRoot(); c = c.getParent()) {
indent += " ";
}
//Mark local container with a star symbol
String marker = "";
if (container.getId().equals(fabricService.getCurrentContainer().getId())) {
marker = "*";
}
String blueprintStatus = dataStore.getContainerAttribute(container.getId(), DataStore.ContainerAttribute.BlueprintStatus, "", false, false);
String springStatus = dataStore.getContainerAttribute(container.getId(), DataStore.ContainerAttribute.SpringStatus, "", false, false);
blueprintStatus = blueprintStatus.toLowerCase(Locale.ENGLISH);
springStatus = springStatus.toLowerCase(Locale.ENGLISH);
List<String> assignedProfiles = dataStore.getContainerProfiles(container.getId());
table.row(indent + container.getId() + marker, container.getVersion().getId(), container.getType(),
aliveText(container), assignedProfiles.get(0), blueprintStatus, springStatus, CommandUtils.status(container));
// we want multiple profiles to be displayed on next lines
for (int i = 1; i < assignedProfiles.size(); i++) {
table.row("", "", "", "", assignedProfiles.get(i), "", "", "");
}
}
}
table.print();
}