@Override protected HostNic postPopulate(HostNic model) { HostNic hostNIC = super.postPopulate(model); Qos qos = hostNIC.getQos(); qos.setType(QosType.HOSTNETWORK); qos.setName(null); qos.setDataCenter(null); model.setBootProtocol(BootProtocol.STATIC); return hostNIC; } }
private static void mapIpv4ToModel(VdsNetworkInterface entity, HostNic model) { BootProtocol ipv4BootProtocol = Ipv4BootProtocolMapper.map(entity.getIpv4BootProtocol()); if(ipv4BootProtocol!=null){ model.setBootProtocol(ipv4BootProtocol); } if (entity.getIpv4Address() != null || entity.getIpv4Gateway() != null || entity.getIpv4Subnet() != null) { final Ip ipv4 = new Ip(); ipv4.setVersion(IpVersion.V4); if (entity.getIpv4Address() != null) { ipv4.setAddress(entity.getIpv4Address()); } if (entity.getIpv4Gateway() != null) { ipv4.setGateway(entity.getIpv4Gateway()); } if (entity.getIpv4Subnet() != null) { ipv4.setNetmask(entity.getIpv4Subnet()); } model.setIp(ipv4); } }
to.setBootProtocol(BootProtocol.fromValue(from.getBootProtocol()));