Remove all address bindings code from Host subsystem.

This has been superseded by the InterfaceService.

Change-Id: I8aae4cfe00752a84e545a1030c199aea8b59da38
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java b/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
index d620fed..8676e46 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
@@ -15,7 +15,6 @@
  */
 package org.onosproject.net.host;
 
-import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.HostId;
 
 /**
@@ -30,37 +29,4 @@
      */
     void removeHost(HostId hostId);
 
-    /**
-     * Binds IP and MAC addresses to the given connection point.
-     * <p>
-     * The addresses are added to the set of addresses already bound to the
-     * connection point.
-     *
-     * @param addresses address object containing addresses to add and the port
-     * to add them to
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void bindAddressesToPort(PortAddresses addresses);
-
-    /**
-     * Removes the addresses contained in the given PortAddresses object from
-     * the set of addresses bound to the port.
-     *
-     * @param portAddresses set of addresses to remove and port to remove them
-     * from
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void unbindAddressesFromPort(PortAddresses portAddresses);
-
-    /**
-     * Removes all address information for the given connection point.
-     *
-     * @param connectPoint the connection point to remove address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void clearAddresses(ConnectPoint connectPoint);
-
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostService.java b/core/api/src/main/java/org/onosproject/net/host/HostService.java
index be114f0..3901215 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostService.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostService.java
@@ -123,24 +123,4 @@
      */
     void requestMac(IpAddress ip);
 
-    /**
-     * Returns the addresses information for all connection points.
-     *
-     * @return the set of address bindings for all connection points
-     * @deprecated in Drake release: use InterfaceService instead
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindings();
-
-    /**
-     * Retrieves the addresses that have been bound to the given connection
-     * point.
-     *
-     * @param connectPoint the connection point to retrieve address bindings for
-     * @return addresses bound to the port
-     * @deprecated in Drake release: use InterfaceService instead
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
-
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostStore.java b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
index ca11a94..35a2a8b 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostStore.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
@@ -115,53 +115,4 @@
      */
     Set<Host> getConnectedHosts(DeviceId deviceId);
 
-    /**
-     * Updates the address information for a given port. The given address
-     * information is added to any previously held information for the port.
-     *
-     * @param addresses the port and address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void updateAddressBindings(PortAddresses addresses);
-
-    /**
-     * Removes the given addresses from the set of address information held for
-     * a port.
-     *
-     * @param addresses the port and address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void removeAddressBindings(PortAddresses addresses);
-
-    /**
-     * Removes any previously stored address information for a given connection
-     * point.
-     *
-     * @param connectPoint the connection point
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void clearAddressBindings(ConnectPoint connectPoint);
-
-    /**
-     * Returns the address bindings stored for all connection points.
-     *
-     * @return the set of address bindings
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindings();
-
-    /**
-     * Returns the address bindings for a particular connection point.
-     *
-     * @param connectPoint the connection point to return address information
-     *                     for
-     * @return address information for the connection point
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java b/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java
deleted file mode 100644
index 74f22ae..0000000
--- a/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2014-2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.host;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.ConnectPoint;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Represents address information bound to a port.
- */
-public final class PortAddresses {
-
-    private final ConnectPoint connectPoint;
-    private final Set<InterfaceIpAddress> ipAddresses;
-    private final MacAddress macAddress;
-    private final VlanId vlan;
-
-    /**
-     * Constructs a PortAddresses object for the given connection point, with a
-     * set of IP addresses and a MAC address. Both address parameters are
-     * optional and can be set to null.
-     *
-     * @param connectPoint the connection point these addresses are for
-     * @param ipAddresses a set of interface IP addresses
-     * @param mac a MAC address
-     * @param vlan a VLAN ID
-     */
-    public PortAddresses(ConnectPoint connectPoint,
-            Set<InterfaceIpAddress> ipAddresses, MacAddress mac, VlanId vlan) {
-        this.connectPoint = connectPoint;
-        this.ipAddresses = (ipAddresses == null) ?
-            Collections.<InterfaceIpAddress>emptySet()
-            : new HashSet<>(ipAddresses);
-        this.macAddress = mac;
-        this.vlan = vlan;
-    }
-
-    /**
-     * Returns the connection point this address information is bound to.
-     *
-     * @return the connection point
-     */
-    public ConnectPoint connectPoint() {
-        return connectPoint;
-    }
-
-    /**
-     * Returns the set of interface IP addresses.
-     *
-     * @return the interface IP addresses
-     */
-    public Set<InterfaceIpAddress> ipAddresses() {
-        return ipAddresses;
-    }
-
-    /**
-     * Returns the MAC address.
-     *
-     * @return the MAC address
-     */
-    public MacAddress mac() {
-        return macAddress;
-    }
-
-    /**
-     * Returns the VLAN ID.
-     *
-     * @return the VLAN ID
-     */
-    public VlanId vlan() {
-        return vlan;
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (this == other) {
-            return true;
-        }
-
-        if (!(other instanceof PortAddresses)) {
-            return false;
-        }
-
-        PortAddresses otherPa = (PortAddresses) other;
-
-        return Objects.equals(this.connectPoint, otherPa.connectPoint)
-                && Objects.equals(this.ipAddresses, otherPa.ipAddresses)
-                && Objects.equals(this.macAddress, otherPa.macAddress)
-                && Objects.equals(this.vlan, otherPa.vlan);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(connectPoint, ipAddresses, macAddress, vlan);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-            .add("connect-point", connectPoint)
-            .add("ip-addresses", ipAddresses)
-            .add("mac-address", macAddress)
-            .add("vlan", vlan)
-            .toString();
-    }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
index 226dad0..0fad54a 100644
--- a/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
@@ -15,15 +15,15 @@
  */
 package org.onosproject.net.host;
 
-import java.util.Set;
-
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.Host;
 import org.onosproject.net.HostId;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
+
+import java.util.Set;
 
 /**
  * Test adapter for host service.
@@ -89,14 +89,4 @@
     public void removeListener(HostListener listener) {
     }
 
-    @Override
-    public Set<PortAddresses> getAddressBindings() {
-        return null;
-    }
-
-    @Override
-    public Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint) {
-        return null;
-    }
-
 }
diff --git a/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java b/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java
deleted file mode 100644
index 7c10cd1..0000000
--- a/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.host;
-
-import java.util.Set;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.NetTestTools;
-
-import static org.hamcrest.Matchers.is;
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.testing.EqualsTester;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-/**
- * Unit tests for port addresses class.
- */
-public class PortAddressesTest {
-
-    PortAddresses addresses1;
-    PortAddresses sameAsAddresses1;
-    PortAddresses addresses2;
-    PortAddresses addresses3;
-
-    private static final ConnectPoint CONNECT_POINT1 =
-            NetTestTools.connectPoint("cp1", 1);
-    private static final IpAddress IP_ADDRESS1 = IpAddress.valueOf("1.2.3.4");
-    private static final IpPrefix SUBNET_ADDRESS1 =
-            IpPrefix.valueOf("1.2.0.0/16");
-    private static final InterfaceIpAddress INTERFACE_ADDRESS_1 =
-            new InterfaceIpAddress(IP_ADDRESS1, SUBNET_ADDRESS1);
-
-    private static final ConnectPoint CONNECT_POINT2 =
-            NetTestTools.connectPoint("cp2", 1);
-    private static final IpAddress IP_ADDRESS2 = IpAddress.valueOf("1.2.3.5");
-    private static final IpPrefix SUBNET_ADDRESS2 =
-            IpPrefix.valueOf("1.3.0.0/16");
-    private static final InterfaceIpAddress INTERFACE_ADDRESS_2 =
-            new InterfaceIpAddress(IP_ADDRESS2, SUBNET_ADDRESS2);
-
-    Set<InterfaceIpAddress> ipAddresses;
-
-
-    /**
-     * Initializes local data used by all test cases.
-     */
-    @Before
-    public void setUpAddresses() {
-        ipAddresses = ImmutableSet.of(INTERFACE_ADDRESS_1,
-                INTERFACE_ADDRESS_2);
-        addresses1 = new PortAddresses(CONNECT_POINT1, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        sameAsAddresses1 = new PortAddresses(CONNECT_POINT1, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        addresses2 = new PortAddresses(CONNECT_POINT2, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        addresses3 = new PortAddresses(CONNECT_POINT2, ipAddresses,
-                MacAddress.ZERO, VlanId.NONE);
-    }
-
-    /**
-     * Checks that the PortAddresses class is immutable.
-     */
-    @Test
-    public void testImmutability() {
-        assertThatClassIsImmutable(PortAddresses.class);
-    }
-
-    /**
-     * Checks the operation of the equals(), hash() and toString()
-     * methods.
-     */
-    @Test
-    public void testEquals() {
-        new EqualsTester()
-                .addEqualityGroup(addresses1, sameAsAddresses1)
-                .addEqualityGroup(addresses2)
-                .addEqualityGroup(addresses3)
-                .testEquals();
-    }
-
-    /**
-     * Tests that object are created correctly.
-     */
-    @Test
-    public void testConstruction() {
-        assertThat(addresses1.mac(), is(MacAddress.BROADCAST));
-        assertThat(addresses1.connectPoint(), is(CONNECT_POINT1));
-        assertThat(addresses1.ipAddresses(), is(ipAddresses));
-        assertThat(addresses1.vlan(), is(VlanId.NONE));
-    }
-}