use of org.ovirt.engine.core.common.businessentities.GuestContainer in project ovirt-engine by oVirt.
the class VdsBrokerObjectsBuilder method initGuestContainers.
private static void initGuestContainers(Map<String, Object> vmStruct, VmDynamic vm) {
if (vmStruct.containsKey(VdsProperties.guest_containers)) {
vm.setGuestContainers(new ArrayList<>());
Object obj = vmStruct.get(VdsProperties.guest_containers);
if (obj instanceof Object[]) {
Object[] containers = (Object[]) obj;
for (Object containerObj : containers) {
Map<String, Object> container = (Map<String, Object>) containerObj;
ArrayList<String> names = new ArrayList<>();
for (Object o : (Object[]) container.get(VdsProperties.guest_container_names)) {
names.add((String) o);
}
vm.getGuestContainers().add(new GuestContainer((String) container.get(VdsProperties.guest_container_id), names, (String) container.get(VdsProperties.guest_container_image), (String) container.get(VdsProperties.guest_container_command), (String) container.get(VdsProperties.guest_container_status)));
}
}
} else {
vm.setGuestContainers(Collections.emptyList());
}
}
use of org.ovirt.engine.core.common.businessentities.GuestContainer in project ovirt-engine by oVirt.
the class RegisterEntityInfoPanel method initContainersTable.
protected void initContainersTable() {
containersTable = new EntityModelCellTable<>(false, true);
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getId().toString();
}
}, constants.idContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
// $NON-NLS-1$
return String.join(", ", row.getNames());
}
}, constants.namesContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getImage();
}
}, constants.imageContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getCommand();
}
}, constants.commandContainer());
containersTable.addColumn(new AbstractTextColumn<GuestContainer>() {
@Override
public String getValue(GuestContainer row) {
return row.getStatus();
}
}, constants.statusContainer());
containersTable.setRowData(new ArrayList<EntityModel>());
// $NON-NLS-1$
containersTable.setWidth("100%");
containersTable.setSelectionModel(new NoSelectionModel());
containersTable.setEmptyTableWidget(new NoItemsLabel());
}
Aggregations