use of org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createGuestAgentContainerPanel.
private Container createGuestAgentContainerPanel(VmNetworkInterface networkInterface, List<VmGuestAgentInterface> allGuestAgentData) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
for (VmGuestAgentInterface guestAgentInterface : allGuestAgentData) {
if (guestAgentInterface.getMacAddress() != null && guestAgentInterface.getMacAddress().equals(networkInterface.getMacAddress())) {
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getInterfaceName()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv4Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()) : constants.notAvailableLabel()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv6Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()) : constants.notAvailableLabel()), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getMacAddress()), dl);
column.getElement().appendChild(dl);
}
}
if (allGuestAgentData.isEmpty()) {
Span noDataSpan = new Span();
noDataSpan.setText(constants.notAvailableLabel());
column.add(noDataSpan);
}
return createItemContainerPanel(content);
}
use of org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method addNetworkMainInfo.
protected void addNetworkMainInfo(VmNetworkInterface networkInterface, HasWidgets targetPanel) {
DListElement dl = Document.get().createDLElement();
FlowPanel infoPanel = new FlowPanel();
StringJoiner ipv4AddressJoiner = new StringJoiner(COMMA_DELIMITER);
StringJoiner ipv6AddressJoiner = new StringJoiner(COMMA_DELIMITER);
for (VmGuestAgentInterface guestAgentInterface : allGuestAgentData) {
if (guestAgentInterface.getMacAddress() != null && networkInterface.getMacAddress().equals(guestAgentInterface.getMacAddress())) {
if (guestAgentInterface.getIpv4Addresses() != null) {
ipv4AddressJoiner.add(String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()));
}
if (guestAgentInterface.getIpv6Addresses() != null) {
ipv6AddressJoiner.add(String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()));
}
}
}
String ipv4Address = ipv4AddressJoiner.toString();
if (ipv4Address.isEmpty()) {
ipv4Address = constants.notAvailableLabel();
}
String ipv6Address = ipv6AddressJoiner.toString();
if (ipv6Address.isEmpty()) {
ipv6Address = constants.notAvailableLabel();
}
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.networkNameInterface()), SafeHtmlUtils.fromString(networkInterface.getNetworkName() != null ? networkInterface.getNetworkName() : constants.unAvailablePropertyLabel()), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), SafeHtmlUtils.fromString(ipv4Address), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), SafeHtmlUtils.fromString(ipv6Address), dl);
addStackedDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), SafeHtmlUtils.fromString(networkInterface.getMacAddress()), dl);
infoPanel.getElement().appendChild(dl);
targetPanel.add(infoPanel);
}
Aggregations