Sho SHIMIZU
Committed by Gerrit Code Review

Remove API deprecated in Falcon

Change-Id: I80a8afbcd577a9cce174d3fc1e511b711d3c68d4
......@@ -149,7 +149,7 @@ public class ControlPlaneRedirectManagerTest {
@Test
public void testAddDevice() {
ConnectPoint sw1eth4 = new ConnectPoint(DEVICE_ID, PortNumber.portNumber(4));
Set<InterfaceIpAddress> interfaceIpAddresses4 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses4 = new ArrayList<>();
interfaceIpAddresses4
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"), IpPrefix.valueOf("192.168.40.0/24")));
......@@ -168,7 +168,7 @@ public class ControlPlaneRedirectManagerTest {
@Test
public void testUpdateNetworkConfig() {
ConnectPoint sw1eth4 = new ConnectPoint(DEVICE_ID, PortNumber.portNumber(4));
Set<InterfaceIpAddress> interfaceIpAddresses4 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses4 = new ArrayList<>();
interfaceIpAddresses4
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"), IpPrefix.valueOf("192.168.40.0/24")));
......@@ -189,7 +189,7 @@ public class ControlPlaneRedirectManagerTest {
@Test
public void testAddInterface() {
ConnectPoint sw1eth4 = new ConnectPoint(DEVICE_ID, PortNumber.portNumber(4));
Set<InterfaceIpAddress> interfaceIpAddresses4 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses4 = new ArrayList<>();
interfaceIpAddresses4
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"), IpPrefix.valueOf("192.168.40.0/24")));
......@@ -209,7 +209,7 @@ public class ControlPlaneRedirectManagerTest {
@Test
public void testRemoveInterface() {
ConnectPoint sw1eth4 = new ConnectPoint(DEVICE_ID, PortNumber.portNumber(4));
Set<InterfaceIpAddress> interfaceIpAddresses4 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses4 = new ArrayList<>();
interfaceIpAddresses4
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"), IpPrefix.valueOf("192.168.40.0/24")));
......@@ -329,21 +329,21 @@ public class ControlPlaneRedirectManagerTest {
* Setup Interface expectation for all Testcases.
**/
private void setUpInterfaceService() {
Set<InterfaceIpAddress> interfaceIpAddresses1 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses1 = new ArrayList<>();
interfaceIpAddresses1
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.10.101"), IpPrefix.valueOf("192.168.10.0/24")));
Interface sw1Eth1 = new Interface(SW1_ETH1.deviceId().toString(), SW1_ETH1, interfaceIpAddresses1,
MacAddress.valueOf("00:00:00:00:00:01"), VlanId.NONE);
interfaces.add(sw1Eth1);
Set<InterfaceIpAddress> interfaceIpAddresses2 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses2 = new ArrayList<>();
interfaceIpAddresses2
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.20.101"), IpPrefix.valueOf("192.168.20.0/24")));
Interface sw1Eth2 = new Interface(SW1_ETH1.deviceId().toString(), SW1_ETH2, interfaceIpAddresses2,
MacAddress.valueOf("00:00:00:00:00:02"), VlanId.NONE);
interfaces.add(sw1Eth2);
Set<InterfaceIpAddress> interfaceIpAddresses3 = Sets.newHashSet();
List<InterfaceIpAddress> interfaceIpAddresses3 = new ArrayList<>();
interfaceIpAddresses3
.add(new InterfaceIpAddress(IpAddress.valueOf("192.168.30.101"), IpPrefix.valueOf("192.168.30.0/24")));
Interface sw1Eth3 = new Interface(SW1_ETH1.deviceId().toString(), SW1_ETH3, interfaceIpAddresses3,
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.sdnip;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Test;
......@@ -216,10 +217,11 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest {
InterfaceIpAddress ia4 =
new InterfaceIpAddress(IpAddress.valueOf("192.168.40.101"),
IpPrefix.valueOf("192.168.40.0/24"));
Interface intfsw3eth1 = new Interface(s3Eth1,
Collections.singleton(ia4),
MacAddress.valueOf("00:00:00:00:00:04"),
VLAN10);
Interface intfsw3eth1 = new Interface(Interface.NO_INTERFACE_NAME,
s3Eth1,
ImmutableList.of(ia4),
MacAddress.valueOf("00:00:00:00:00:04"),
VLAN10);
configuredInterfaces.put(interfaceSw3Eth1, intfsw3eth1);
......@@ -227,10 +229,11 @@ public class PeerConnectivityManagerTest extends AbstractIntentTest {
InterfaceIpAddress ia5 =
new InterfaceIpAddress(IpAddress.valueOf("192.168.50.101"),
IpPrefix.valueOf("192.168.50.0/24"));
Interface intfsw3eth1intf2 = new Interface(s3Eth1,
Collections.singleton(ia5),
MacAddress.valueOf("00:00:00:00:00:05"),
VLAN20);
Interface intfsw3eth1intf2 = new Interface(Interface.NO_INTERFACE_NAME,
s3Eth1,
ImmutableList.of(ia5),
MacAddress.valueOf("00:00:00:00:00:05"),
VLAN20);
configuredInterfaces.put(interfaceSw3Eth1intf2, intfsw3eth1intf2);
......
......@@ -185,7 +185,8 @@ public class HostMonitorTest {
InterfaceService interfaceService = createMock(InterfaceService.class);
expect(interfaceService.getMatchingInterface(TARGET_IPV4_ADDR))
.andReturn(new Interface(cp, Collections.singletonList(IA1), sourceMac, VlanId.NONE))
.andReturn(new Interface(Interface.NO_INTERFACE_NAME,
cp, Collections.singletonList(IA1), sourceMac, VlanId.NONE))
.anyTimes();
replay(interfaceService);
......@@ -253,7 +254,8 @@ public class HostMonitorTest {
InterfaceService interfaceService = createMock(InterfaceService.class);
expect(interfaceService.getMatchingInterface(TARGET_IPV6_ADDR))
.andReturn(new Interface(cp, Collections.singletonList(IA2), sourceMac2, VlanId.NONE))
.andReturn(new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.singletonList(IA2), sourceMac2, VlanId.NONE))
.anyTimes();
replay(interfaceService);
......@@ -323,7 +325,8 @@ public class HostMonitorTest {
InterfaceService interfaceService = createMock(InterfaceService.class);
expect(interfaceService.getMatchingInterface(TARGET_IPV4_ADDR))
.andReturn(new Interface(cp, Collections.singletonList(IA1), sourceMac, VlanId.vlanId(vlan)))
.andReturn(new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.singletonList(IA1), sourceMac, VlanId.vlanId(vlan)))
.anyTimes();
replay(interfaceService);
......@@ -392,7 +395,8 @@ public class HostMonitorTest {
InterfaceService interfaceService = createMock(InterfaceService.class);
expect(interfaceService.getMatchingInterface(TARGET_IPV6_ADDR))
.andReturn(new Interface(cp, Collections.singletonList(IA2), sourceMac2, VlanId.vlanId(vlan)))
.andReturn(new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.singletonList(IA2), sourceMac2, VlanId.vlanId(vlan)))
.anyTimes();
replay(interfaceService);
......
......@@ -296,12 +296,10 @@ public class ProxyArpManagerTest {
InterfaceIpAddress ia4 = new InterfaceIpAddress(addr4, prefix4);
// Setting up interfaces
Interface intf1 = new Interface(cp, Lists.newArrayList(ia1, ia3),
MacAddress.valueOf(2 * i - 1),
VlanId.vlanId((short) 1));
Interface intf2 = new Interface(cp, Lists.newArrayList(ia2, ia4),
MacAddress.valueOf(2 * i),
VlanId.NONE);
Interface intf1 = new Interface(Interface.NO_INTERFACE_NAME, cp,
Lists.newArrayList(ia1, ia3), MacAddress.valueOf(2 * i - 1), VlanId.vlanId((short) 1));
Interface intf2 = new Interface(Interface.NO_INTERFACE_NAME, cp,
Lists.newArrayList(ia2, ia4), MacAddress.valueOf(2 * i), VlanId.NONE);
interfaces.add(intf1);
interfaces.add(intf2);
......@@ -313,7 +311,7 @@ public class ProxyArpManagerTest {
}
for (int i = LAST_CONF_DEVICE_INTF_VLAN_IP + 1; i <= LAST_CONF_DEVICE_INTF_VLAN; i++) {
ConnectPoint cp = new ConnectPoint(getDeviceId(i), P1);
Interface intf1 = new Interface(cp, Collections.emptyList(),
Interface intf1 = new Interface(Interface.NO_INTERFACE_NAME, cp, Collections.emptyList(),
MacAddress.NONE,
VlanId.vlanId((short) 1));
......@@ -850,7 +848,7 @@ public class ProxyArpManagerTest {
expect(hostService.getHostsByIp(theirIp)).andReturn(Collections.emptySet());
expect(interfaceService.getInterfacesByIp(ourIp))
.andReturn(Collections.singleton(new Interface(getLocation(1),
.andReturn(Collections.singleton(new Interface(Interface.NO_INTERFACE_NAME, getLocation(1),
Collections.singletonList(new InterfaceIpAddress(ourIp, IpPrefix.valueOf("10.0.1.1/24"))),
ourMac, VLAN1)));
expect(hostService.getHost(HostId.hostId(ourMac, VLAN1))).andReturn(null);
......@@ -883,7 +881,7 @@ public class ProxyArpManagerTest {
expect(hostService.getHostsByIp(theirIp)).andReturn(Collections.emptySet());
expect(interfaceService.getInterfacesByIp(ourIp))
.andReturn(Collections.singleton(new Interface(getLocation(1),
.andReturn(Collections.singleton(new Interface(Interface.NO_INTERFACE_NAME, getLocation(1),
Collections.singletonList(new InterfaceIpAddress(
ourIp,
IpPrefix.valueOf("1000::1/64"))),
......
......@@ -64,60 +64,6 @@ public class Interface {
}
/**
* Creates new Interface with the provided configuration.
*
* @param name name of the interface
* @param connectPoint the connect point this interface maps to
* @param ipAddresses set of IP addresses
* @param macAddress MAC address
* @param vlan VLAN ID
* @deprecated in Falcon release, in favour of ordered list
*/
@Deprecated
public Interface(String name, ConnectPoint connectPoint,
Set<InterfaceIpAddress> ipAddresses,
MacAddress macAddress, VlanId vlan) {
this.name = name == null ? NO_INTERFACE_NAME : name;
this.connectPoint = checkNotNull(connectPoint);
this.ipAddresses = ipAddresses == null ? Lists.newArrayList() :
ipAddresses.stream().collect(Collectors.toList());
this.macAddress = macAddress == null ? MacAddress.NONE : macAddress;
this.vlan = vlan == null ? VlanId.NONE : vlan;
}
/**
* Creates new Interface with the provided configuration.
*
* @param connectPoint the connect point this interface maps to
* @param ipAddresses Set of IP addresses
* @param macAddress MAC address
* @param vlan VLAN ID
* @deprecated in Falcon release - use constructors with names instead
*/
@Deprecated
public Interface(ConnectPoint connectPoint,
Set<InterfaceIpAddress> ipAddresses,
MacAddress macAddress, VlanId vlan) {
this(NO_INTERFACE_NAME, connectPoint, ipAddresses, macAddress, vlan);
}
/**
* Creates new Interface with the provided configuration.
*
* @param connectPoint the connect point this interface maps to
* @param ipAddresses Set of IP addresses
* @param macAddress MAC address
* @param vlan VLAN ID
* @deprecated in Falcon release - use constructors with names instead
*/
@Deprecated
public Interface(ConnectPoint connectPoint,
List<InterfaceIpAddress> ipAddresses,
MacAddress macAddress, VlanId vlan) {
this(NO_INTERFACE_NAME, connectPoint, ipAddresses, macAddress, vlan);
}
/**
* Retrieves the name of the interface.
*
* @return name
......
......@@ -88,7 +88,7 @@ public class InterfaceManagerTest {
InterfaceIpAddress ia = InterfaceIpAddress.valueOf("192.168." + i + ".1/24");
Interface intf = new Interface(cp,
Interface intf = new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.singletonList(ia),
MacAddress.valueOf(i),
VlanId.vlanId((short) i));
......@@ -151,7 +151,7 @@ public class InterfaceManagerTest {
// Create a new InterfaceConfig which will get added
VlanId vlanId = VlanId.vlanId((short) 1);
ConnectPoint cp = ConnectPoint.deviceConnectPoint("of:0000000000000001/2");
Interface newIntf = new Interface(cp,
Interface newIntf = new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.emptyList(),
MacAddress.valueOf(100),
vlanId);
......@@ -188,11 +188,11 @@ public class InterfaceManagerTest {
Interface intf = createInterface(1);
List<InterfaceIpAddress> addresses = Lists.newArrayList(intf.ipAddresses());
addresses.add(InterfaceIpAddress.valueOf("192.168.100.1/24"));
intf = new Interface(intf.connectPoint(), addresses, intf.mac(), intf.vlan());
intf = new Interface(Interface.NO_INTERFACE_NAME, intf.connectPoint(), addresses, intf.mac(), intf.vlan());
// Create a new interface on the same connect point as the existing one
InterfaceIpAddress newAddr = InterfaceIpAddress.valueOf("192.168.101.1/24");
Interface newIntf = new Interface(cp,
Interface newIntf = new Interface(Interface.NO_INTERFACE_NAME, cp,
Collections.singletonList(newAddr),
MacAddress.valueOf(101),
VlanId.vlanId((short) 101));
......