use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkCommonUtils method createDefaultIpv6Address.
public static IpV6Address createDefaultIpv6Address() {
IpV6Address ipv6Address = new IpV6Address();
ipv6Address.setBootProtocol(Ipv6BootProtocol.NONE);
return ipv6Address;
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImpl method createIpV6Address.
private static IpV6Address createIpV6Address(ResultSet rs, String v6BootProtocol) throws SQLException {
final IpV6Address ipV6Address = new IpV6Address();
ipV6Address.setBootProtocol(Ipv6BootProtocol.valueOf(v6BootProtocol));
ipV6Address.setAddress(rs.getString("ipv6_address"));
if (rs.getObject("ipv6_prefix") != null) {
ipV6Address.setPrefix(rs.getInt("ipv6_prefix"));
}
ipV6Address.setGateway(rs.getString("ipv6_gateway"));
return ipV6Address;
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentMapperTest method testMapFromModelIpv6Assignment.
@Test
public void testMapFromModelIpv6Assignment() {
final IpAddressAssignment model = new IpAddressAssignment();
model.setAssignmentMethod(BootProtocol.STATIC);
final Ip ip = new Ip();
ip.setAddress(ADDRESS);
ip.setGateway(GATEWAY);
ip.setNetmask(PREFIX_STR);
model.setIp(ip);
final IpV6Address actual = NetworkAttachmentMapper.mapIpv6AddressAssignment(model);
assertEquals(Ipv6BootProtocol.STATIC_IP, actual.getBootProtocol());
assertEquals(ADDRESS, actual.getAddress());
assertEquals(GATEWAY, actual.getGateway());
assertEquals(Integer.valueOf(PREFIX), actual.getPrefix());
}
use of org.ovirt.engine.core.common.businessentities.network.IpV6Address in project ovirt-engine by oVirt.
the class NetworkAttachmentMapperTest method testMapFromEntityIpv6Assignment.
@Test
public void testMapFromEntityIpv6Assignment() {
final IpV6Address entity = new IpV6Address();
entity.setBootProtocol(Ipv6BootProtocol.AUTOCONF);
entity.setAddress(ADDRESS);
entity.setGateway(GATEWAY);
entity.setPrefix(PREFIX);
final IpAddressAssignment actual = NetworkAttachmentMapper.mapIpv6AddressAssignment(entity);
assertEquals(BootProtocol.AUTOCONF, actual.getAssignmentMethod());
assertEquals(ADDRESS, actual.getIp().getAddress());
assertEquals(GATEWAY, actual.getIp().getGateway());
assertEquals(PREFIX_STR, actual.getIp().getNetmask());
}
Aggregations