private boolean shouldCreateUnmanagedNetworkModel(VdsNetworkInterface nic) { return nic.getNetworkImplementationDetails() != null && !nic.getNetworkImplementationDetails().isManaged() && !hostSetupNetworksParametersData.getRemovedUnmanagedNetworks().contains(nic.getNetworkName()); }
private void updateActionAvailability() { VDS host = getEntity(); getSaveNetworkConfigCommand().setIsExecutionAllowed(host != null && (host.getNetConfigDirty() == null ? false : host.getNetConfigDirty())); getSyncAllHostNetworksCommand().setIsExecutionAllowed(getOriginalItems() != null && getOriginalItems().stream() .map(hostInterface -> hostInterface.getNetworkImplementationDetails()) .filter(Objects::nonNull) .anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync())); }
@Test public void testCustomNetworkConfigurationMapped() { VdsNetworkInterface entity = new VdsNetworkInterface(); HostNic model = HostNicMapper.map(entity, null); assertFalse(model.isSetCustomConfiguration()); entity.setNetworkImplementationDetails(new VdsNetworkInterface.NetworkImplementationDetails(false, true)); model = HostNicMapper.map(entity, null); assertEquals(entity.getNetworkImplementationDetails().isInSync(), !model.isCustomConfiguration()); entity.setNetworkImplementationDetails(new VdsNetworkInterface.NetworkImplementationDetails(true, true)); model = HostNicMapper.map(entity, null); assertEquals(entity.getNetworkImplementationDetails().isInSync(), !model.isCustomConfiguration()); }
if (entity.getNetworkImplementationDetails() != null) { model.setCustomConfiguration(!entity.getNetworkImplementationDetails().isInSync());
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return tsb.append("id", getId()) .append("name", getName()) .append("vdsId", getVdsId()) .append("networkName", getNetworkName()) .append("ipv4BootProtocol", getIpv4BootProtocol()) .append("ipv4Address", getIpv4Address()) .append("ipv4Subnet", getIpv4Subnet()) .append("ipv4Gateway", getIpv4Gateway()) .append("ipv6BootProtocol", getIpv6BootProtocol()) .append("ipv6Address", getIpv6Address()) .append("ipv6Prefix", getIpv6Prefix()) .append("ipv6Gateway", getIpv6Gateway()) .append("mtu", getMtu()) .append("bridged", isBridged()) .append("reportedSwitchType", getReportedSwitchType()) .append("type", getType()) .append("networkImplementationDetails", getNetworkImplementationDetails()) .append("qos", getQos()) .append("adPartnerMac", getAdPartnerMac()) .append("adAggregatorId", adAggregatorId); }