Fixed an issue in basic host and basic link config validations.

Added validation for basic device config.

Made all concrete configurations final (as they should be).

Changed stc to use the new onos-netcfg as a method to re-locate and name devices and hosts.

Change-Id: I372e6c7e6c0fa6fa52301568af73342aaae6347b
diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java b/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java
index 68aa27f..14b86d2 100644
--- a/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java
+++ b/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java
@@ -15,25 +15,26 @@
  */
 package org.onosproject.net.host.impl;
 
-import static org.slf4j.LoggerFactory.getLogger;
-
-import org.slf4j.Logger;
+import org.onlab.packet.IpAddress;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.HostLocation;
+import org.onosproject.net.SparseAnnotations;
 import org.onosproject.net.config.ConfigOperator;
 import org.onosproject.net.config.basics.BasicHostConfig;
-import org.onosproject.net.AnnotationKeys;
-import org.onosproject.net.DefaultAnnotations;
-import org.onosproject.net.SparseAnnotations;
 import org.onosproject.net.host.DefaultHostDescription;
 import org.onosproject.net.host.HostDescription;
 
+import java.util.Set;
+
 /**
  * Implementations of merge policies for various sources of host configuration
- * information. This includes applications, provides, and network configurations.
+ * information. This includes applications, providers, and network configurations.
  */
 public final class BasicHostOperator implements ConfigOperator {
 
     protected static final double DEFAULT_COORD = -1.0;
-    private static final Logger log = getLogger(BasicHostOperator.class);
 
     private BasicHostOperator() {
     }
@@ -42,7 +43,7 @@
      * Generates a HostDescription containing fields from a HostDescription and
      * a HostConfig.
      *
-     * @param cfg the host config entity from network config
+     * @param cfg   the host config entity from network config
      * @param descr a HostDescription
      * @return HostDescription based on both sources
      */
@@ -50,16 +51,29 @@
         if (cfg == null) {
             return descr;
         }
+
+        HostLocation location = descr.location();
+        ConnectPoint cfgLocation = cfg.location();
+        if (cfgLocation != null) {
+            location = new HostLocation(cfgLocation, System.currentTimeMillis());
+        }
+
+        Set<IpAddress> ipAddresses = descr.ipAddress();
+        Set<IpAddress> cfgIpAddresses = cfg.ipAddresses();
+        if (cfgIpAddresses != null) {
+            ipAddresses = cfgIpAddresses;
+        }
+
         SparseAnnotations sa = combine(cfg, descr.annotations());
-        return new DefaultHostDescription(descr.hwAddress(), descr.vlan(), descr.location(),
-                descr.ipAddress(), sa);
+        return new DefaultHostDescription(descr.hwAddress(), descr.vlan(),
+                                          location, ipAddresses, sa);
     }
 
     /**
      * Generates an annotation from an existing annotation and HostConfig.
      *
      * @param cfg the device config entity from network config
-     * @param an the annotation
+     * @param an  the annotation
      * @return annotation combining both sources
      */
     public static SparseAnnotations combine(BasicHostConfig cfg, SparseAnnotations an) {