Search in sources :

Example 16 with IpV6Address

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;
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address)

Example 17 with 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;
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address)

Example 18 with 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());
}
Also used : Ip(org.ovirt.engine.api.model.Ip) IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address) IpAddressAssignment(org.ovirt.engine.api.model.IpAddressAssignment) Test(org.junit.Test)

Example 19 with IpV6Address

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());
}
Also used : IpV6Address(org.ovirt.engine.core.common.businessentities.network.IpV6Address) IpAddressAssignment(org.ovirt.engine.api.model.IpAddressAssignment) Test(org.junit.Test)

Aggregations

IpV6Address (org.ovirt.engine.core.common.businessentities.network.IpV6Address)19 IPv4Address (org.ovirt.engine.core.common.businessentities.network.IPv4Address)5 IpConfiguration (org.ovirt.engine.core.common.businessentities.network.IpConfiguration)4 Test (org.junit.Test)3 IpAddressAssignment (org.ovirt.engine.api.model.IpAddressAssignment)2 Ipv6BootProtocol (org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 Ip (org.ovirt.engine.api.model.Ip)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)1 NicToIpv4AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv4AddressFunction)1 NicToIpv6AddressFunction (org.ovirt.engine.core.utils.network.function.NicToIpv6AddressFunction)1 NetworkParameters (org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters)1