@Test public void testVRouterMacs() throws Exception { Set<MacAddress> vRouterMacs = config.vRouterMacs(); assertNotNull("vRouterMacs should not be null", vRouterMacs); assertThat(vRouterMacs.size(), is(2)); assertTrue(vRouterMacs.contains(ROUTER_MAC_1)); assertTrue(vRouterMacs.contains(ROUTER_MAC_2)); }
public Set<MacAddress> vRouterMacs() { if (!object.has(VROUTER_MACS)) { return ImmutableSet.of(); } ImmutableSet.Builder<MacAddress> builder = ImmutableSet.builder(); ArrayNode arrayNode = (ArrayNode) object.path(VROUTER_MACS); for (JsonNode jsonNode : arrayNode) { MacAddress mac; String macStr = jsonNode.asText(null); if (macStr == null) { return null; } try { mac = MacAddress.valueOf(macStr); } catch (IllegalArgumentException e) { return null; } builder.add(mac); } return builder.build(); }
SegmentRoutingAppConfig extends Config<ApplicationId> { public Set<MacAddress> vRouterMacs() { if (!object.has(VROUTER_MACS)) { return ImmutableSet.of(); } ImmutableSet.Builder<MacAddress> builder = ImmutableSet.builder(); ArrayNode arrayNode = (ArrayNode) object.path(VROUTER_MACS); for (JsonNode jsonNode : arrayNode) { MacAddress mac; String macStr = jsonNode.asText(null); if (macStr == null) { return null; } try { mac = MacAddress.valueOf(macStr); } catch (IllegalArgumentException e) { return null; } builder.add(mac); } return builder.build(); } }
SegmentRoutingAppConfig extends Config<ApplicationId> { public Set<MacAddress> vRouterMacs() { if (!object.has(VROUTER_MACS)) { return ImmutableSet.of(); } ImmutableSet.Builder<MacAddress> builder = ImmutableSet.builder(); ArrayNode arrayNode = (ArrayNode) object.path(VROUTER_MACS); for (JsonNode jsonNode : arrayNode) { MacAddress mac; String macStr = jsonNode.asText(null); if (macStr == null) { return null; } try { mac = MacAddress.valueOf(macStr); } catch (IllegalArgumentException e) { return null; } builder.add(mac); } return builder.build(); }  }
SegmentRoutingAppConfig extends Config<ApplicationId> { public Set<MacAddress> vRouterMacs() { if (!object.has(VROUTER_MACS)) { return ImmutableSet.of(); } ImmutableSet.Builder<MacAddress> builder = ImmutableSet.builder(); ArrayNode arrayNode = (ArrayNode) object.path(VROUTER_MACS); for (JsonNode jsonNode : arrayNode) { MacAddress mac; String macStr = jsonNode.asText(null); if (macStr == null) { return null; } try { mac = MacAddress.valueOf(macStr); } catch (IllegalArgumentException e) { return null; } builder.add(mac); } return builder.build(); }  @Override boolean isValid(); Set<MacAddress> vRouterMacs(); SegmentRoutingAppConfig setVRouterMacs(Set<MacAddress> vRouterMacs); Optional<DeviceId> vRouterId(); SegmentRoutingAppConfig setVRouterId(DeviceId vRouterId); Set<ConnectPoint> suppressSubnet(); SegmentRoutingAppConfig setSuppressSubnet(Set<ConnectPoint> suppressSubnet); Set<ConnectPoint> suppressHostByPort(); SegmentRoutingAppConfig setSuppressHostByPort(Set<ConnectPoint> connectPoints); Set<String> suppressHostByProvider(); SegmentRoutingAppConfig setSuppressHostByProvider(Set<String> providers); @Override String toString(); }
SegmentRoutingAppConfig extends Config<ApplicationId> { public Set<MacAddress> vRouterMacs() { if (!object.has(VROUTER_MACS)) { return ImmutableSet.of(); } ImmutableSet.Builder<MacAddress> builder = ImmutableSet.builder(); ArrayNode arrayNode = (ArrayNode) object.path(VROUTER_MACS); for (JsonNode jsonNode : arrayNode) { MacAddress mac; String macStr = jsonNode.asText(null); if (macStr == null) { return null; } try { mac = MacAddress.valueOf(macStr); } catch (IllegalArgumentException e) { return null; } builder.add(mac); } return builder.build(); }  @Override boolean isValid(); Set<MacAddress> vRouterMacs(); SegmentRoutingAppConfig setVRouterMacs(Set<MacAddress> vRouterMacs); Optional<DeviceId> vRouterId(); SegmentRoutingAppConfig setVRouterId(DeviceId vRouterId); Set<ConnectPoint> suppressSubnet(); SegmentRoutingAppConfig setSuppressSubnet(Set<ConnectPoint> suppressSubnet); Set<ConnectPoint> suppressHostByPort(); SegmentRoutingAppConfig setSuppressHostByPort(Set<ConnectPoint> connectPoints); Set<String> suppressHostByProvider(); SegmentRoutingAppConfig setSuppressHostByProvider(Set<String> providers); @Override String toString();  }