@Test public void testDescOps() { HostDescription desc = BasicHostOperator.combine(BHC, HOST); assertEquals(NAME, desc.annotations().value(AnnotationKeys.NAME)); assertEquals(null, desc.annotations().value(AnnotationKeys.LONGITUDE)); assertEquals(String.valueOf(LAT), desc.annotations().value(AnnotationKeys.LATITUDE)); }
public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) { 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(), location, ipAddresses, sa); }
BasicHostOperator implements ConfigOperator { public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) { 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(), location, ipAddresses, sa); } }
BasicHostOperator implements ConfigOperator { public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) { 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(), location, ipAddresses, sa); } private  BasicHostOperator(); }
BasicHostOperator implements ConfigOperator { public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) { 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(), location, ipAddresses, sa); } private  BasicHostOperator(); static HostDescription combine(BasicHostConfig cfg, HostDescription descr); static SparseAnnotations combine(BasicHostConfig cfg, SparseAnnotations an); }
BasicHostOperator implements ConfigOperator { public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) { 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(), location, ipAddresses, sa); } private  BasicHostOperator(); static HostDescription combine(BasicHostConfig cfg, HostDescription descr); static SparseAnnotations combine(BasicHostConfig cfg, SparseAnnotations an);  }