use of org.ovirt.engine.core.common.businessentities.network.IPv4Address in project ovirt-engine by oVirt.
the class NetworkConfiguratorTest method assertIpv4Details.
private void assertIpv4Details(IpConfiguration ipConfiguration) {
assertThat(ipConfiguration.getIPv4Addresses(), hasSize(1));
final IPv4Address ipv4Address = ipConfiguration.getIPv4Addresses().get(0);
assertThat(ipv4Address.getAddress(), is(IPV4_ADDRESS));
assertThat(ipv4Address.getBootProtocol(), is(Ipv4BootProtocol.STATIC_IP));
assertThat(ipv4Address.getAddress(), is(IPV4_ADDRESS));
}
use of org.ovirt.engine.core.common.businessentities.network.IPv4Address in project ovirt-engine by oVirt.
the class HostNetworkAttachmentsPersisterTest method createIpv4Address.
private IPv4Address createIpv4Address() {
IPv4Address address = new IPv4Address();
address.setAddress(IPV4_ADDRESS);
address.setNetmask(IPV4_NETMASK);
address.setGateway(IPV4_GATEWAY);
address.setBootProtocol(Ipv4BootProtocol.STATIC_IP);
return address;
}
use of org.ovirt.engine.core.common.businessentities.network.IPv4Address in project ovirt-engine by oVirt.
the class NetworkCommonUtils method createDefaultIpConfiguration.
public static IpConfiguration createDefaultIpConfiguration() {
IpConfiguration ipConfiguration = new IpConfiguration();
IPv4Address iPv4Address = createDefaultIpv4Address();
ipConfiguration.getIPv4Addresses().add(iPv4Address);
IpV6Address ipv6Address = createDefaultIpv6Address();
ipConfiguration.getIpV6Addresses().add(ipv6Address);
return ipConfiguration;
}
use of org.ovirt.engine.core.common.businessentities.network.IPv4Address in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImpl method mapIpv4Configuration.
private void mapIpv4Configuration(MapSqlParameterSource mapper, IpConfiguration ipConfiguration) {
if (ipConfiguration.hasIpv4PrimaryAddressSet()) {
final IPv4Address primaryIpv4Address = ipConfiguration.getIpv4PrimaryAddress();
mapper.addValue("boot_protocol", EnumUtils.nameOrNull(primaryIpv4Address.getBootProtocol())).addValue("address", primaryIpv4Address.getAddress()).addValue("netmask", primaryIpv4Address.getNetmask()).addValue("gateway", primaryIpv4Address.getGateway());
} else {
mapper.addValue("boot_protocol", null).addValue("address", null).addValue("netmask", null).addValue("gateway", null);
}
}
use of org.ovirt.engine.core.common.businessentities.network.IPv4Address in project ovirt-engine by oVirt.
the class NetworkAttachmentMapper method mapIpv4AddressAssignment.
private static IPv4Address mapIpv4AddressAssignment(IpAddressAssignment ipAddressAssignment) {
IPv4Address iPv4Address = new IPv4Address();
if (ipAddressAssignment.isSetAssignmentMethod()) {
Ipv4BootProtocol assignmentMethod = Ipv4BootProtocolMapper.map(ipAddressAssignment.getAssignmentMethod());
iPv4Address.setBootProtocol(assignmentMethod);
}
if (ipAddressAssignment.isSetIp()) {
if (ipAddressAssignment.getIp().isSetAddress()) {
iPv4Address.setAddress(ipAddressAssignment.getIp().getAddress());
}
if (ipAddressAssignment.getIp().isSetGateway()) {
iPv4Address.setGateway(ipAddressAssignment.getIp().getGateway());
}
if (ipAddressAssignment.getIp().isSetNetmask()) {
iPv4Address.setNetmask(ipAddressAssignment.getIp().getNetmask());
}
}
return iPv4Address;
}
Aggregations