Fixing topology related internal interface/class tree

- Moved TopologyInternal to more appropriate place

 --- BaseInternalTopology (was TopologyInternal)
  |
  +-- ImmutableInternalTopology (new)
  |
  +-- MutableInternalTopology (new)

- Updated TopologyImpl, etc. to implement appropriate
  *InternalTopology interface

- Added interface adaptor BaseTopologyAdaptor
   BaseInternalTopology (self-contained) -> BaseTopology (object handle)

- TopologyObjects ({Switch,Port,Link,Host}Impl) is now common
  between Mutable and Immutable variant of Topology.
   There were locks for whole Topology, but there weren't any locks
   per TopologyObject. If these instances were on MutableTopology,
   then locking should happen outside these instance method calls.

ONOS-1925

Change-Id: I0a13b4ed4b5a66b7ea8c42212c9504e6bc83d853
diff --git a/src/main/java/net/onrc/onos/core/topology/HostImpl.java b/src/main/java/net/onrc/onos/core/topology/HostImpl.java
index 7370be0..90af82b 100644
--- a/src/main/java/net/onrc/onos/core/topology/HostImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/HostImpl.java
@@ -4,13 +4,11 @@
 import java.util.List;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
 import net.floodlightcontroller.util.MACAddress;
 import net.onrc.onos.core.util.SwitchPort;
 
 /**
  * Handler to Host object stored in In-memory Topology snapshot.
- * <p/>
  */
 public class HostImpl extends TopologyObject implements Host {
 
@@ -23,7 +21,7 @@
      * @param topology Topology instance this object belongs to
      * @param mac MAC address of the host
      */
-    HostImpl(TopologyInternal topology, MACAddress mac) {
+    HostImpl(BaseInternalTopology topology, MACAddress mac) {
         super(topology);
         this.id = checkNotNull(mac);
     }
@@ -36,16 +34,12 @@
     @Override
     public Iterable<Port> getAttachmentPoints() {
         List<Port> ports = new ArrayList<>();
-        topology.acquireReadLock();
-        try {
-            for (SwitchPort swp : getHostEvent().getAttachmentPoints()) {
-                Port p = this.topology.getPort(swp);
-                if (p != null) {
-                    ports.add(p);
-                }
+        final BaseTopologyAdaptor topo = new BaseTopologyAdaptor(topology);
+        for (SwitchPort swp : getHostEvent().getAttachmentPoints()) {
+            Port port = topo.getPort(swp);
+            if (port != null) {
+                ports.add(port);
             }
-        } finally {
-            topology.releaseReadLock();
         }
         return ports;
     }