@Test public void testBuildOvsdbBridgeAugmentation_ManagerIpNull() { final InstanceIdentifier<Node> nodeIid = InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class) .build(); OvsdbBridgeAugmentationBuilder bridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder(); bridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName("bridgeName")); bridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(nodeIid)); OvsdbNodeAugmentationBuilder nodeAugmentationBuilder = new OvsdbNodeAugmentationBuilder(); OvsdbBridgeAugmentation augmentation = OvsdbHelper .buildOvsdbBridgeAugmentation(bridgeAugmentationBuilder.build(), nodeAugmentationBuilder.build()); assertNotNull(augmentation); assertNotNull("bridgeName", augmentation.getBridgeName().getValue()); assertEquals(nodeIid, augmentation.getManagedBy().getValue()); assertNull(augmentation.getControllerEntry()); }
public static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge, OvsdbNodeAugmentation ovsdbNode) { OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentation = new OvsdbBridgeAugmentationBuilder(); IpAddress managerIp = getManagerIp(ovsdbNode); if (managerIp != null) { List<ControllerEntry> controllerEntries = buildControllerEntries(managerIp); ovsdbBridgeAugmentation.setControllerEntry(controllerEntries); } ovsdbBridgeAugmentation.setBridgeName(bridge.getBridgeName()); ovsdbBridgeAugmentation.setManagedBy(bridge.getManagedBy()); return ovsdbBridgeAugmentation.build(); }
OvsdbHelper { public static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge, OvsdbNodeAugmentation ovsdbNode) { OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentation = new OvsdbBridgeAugmentationBuilder(); IpAddress managerIp = getManagerIp(ovsdbNode); if (managerIp != null) { List<ControllerEntry> controllerEntries = buildControllerEntries(managerIp); ovsdbBridgeAugmentation.setControllerEntry(controllerEntries); } ovsdbBridgeAugmentation.setBridgeName(bridge.getBridgeName()); ovsdbBridgeAugmentation.setManagedBy(bridge.getManagedBy()); return ovsdbBridgeAugmentation.build(); } }
OvsdbHelper { public static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge, OvsdbNodeAugmentation ovsdbNode) { OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentation = new OvsdbBridgeAugmentationBuilder(); IpAddress managerIp = getManagerIp(ovsdbNode); if (managerIp != null) { List<ControllerEntry> controllerEntries = buildControllerEntries(managerIp); ovsdbBridgeAugmentation.setControllerEntry(controllerEntries); } ovsdbBridgeAugmentation.setBridgeName(bridge.getBridgeName()); ovsdbBridgeAugmentation.setManagedBy(bridge.getManagedBy()); return ovsdbBridgeAugmentation.build(); }  }
OvsdbHelper { public static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge, OvsdbNodeAugmentation ovsdbNode) { OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentation = new OvsdbBridgeAugmentationBuilder(); IpAddress managerIp = getManagerIp(ovsdbNode); if (managerIp != null) { List<ControllerEntry> controllerEntries = buildControllerEntries(managerIp); ovsdbBridgeAugmentation.setControllerEntry(controllerEntries); } ovsdbBridgeAugmentation.setBridgeName(bridge.getBridgeName()); ovsdbBridgeAugmentation.setManagedBy(bridge.getManagedBy()); return ovsdbBridgeAugmentation.build(); }  static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker); static OvsdbTerminationPointAugmentation getOvsdbTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNode(Node node, List<TerminationPoint> tps,
            OvsdbBridgeAugmentation ovsdbBridgeAugmentation); static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge,
            OvsdbNodeAugmentation ovsdbNode); static List<TerminationPoint> buildTerminationPoints(OvsdbBridgeAugmentation bridge,
            OvsdbTerminationPointAugmentation ovsdbTp, AbstractTunnelType tunnelType); static String generateTpName(OvsdbBridgeAugmentation bridge, AbstractTunnelType tunnelType); static OvsdbTerminationPointAugmentation buildOvsdbTerminationPointAugmentation(
            OvsdbBridgeAugmentation bridge, List<Options> options, AbstractTunnelType tunnelType); static void setOption(List<Options> options, String key, String value); static IpAddress getManagerIp(OvsdbNodeAugmentation ovsdbNode); static IpAddress getNodeIp(OvsdbNodeAugmentation ovsdbNode); static List<ControllerEntry> buildControllerEntries(IpAddress ip); static OvsdbNodeAugmentation getManagerNode(OvsdbBridgeAugmentation bridge, DataBroker dataBroker); static Node getTopologyNode(InstanceIdentifier<Node> nodeIid, DataBroker dataBroker); static void createTunnelPort(InstanceIdentifier<Node> nodeIid,
            Node node, AbstractTunnelType tunnelType, DataBroker dataBroker); }
OvsdbHelper { public static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge, OvsdbNodeAugmentation ovsdbNode) { OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentation = new OvsdbBridgeAugmentationBuilder(); IpAddress managerIp = getManagerIp(ovsdbNode); if (managerIp != null) { List<ControllerEntry> controllerEntries = buildControllerEntries(managerIp); ovsdbBridgeAugmentation.setControllerEntry(controllerEntries); } ovsdbBridgeAugmentation.setBridgeName(bridge.getBridgeName()); ovsdbBridgeAugmentation.setManagedBy(bridge.getManagedBy()); return ovsdbBridgeAugmentation.build(); }  static OvsdbBridgeAugmentation getOvsdbBridgeFromTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNodeFromBridgeRef(OvsdbBridgeRef bridgeRef, DataBroker dataBroker); static OvsdbTerminationPointAugmentation getOvsdbTerminationPoint(
            InstanceIdentifier<OvsdbTerminationPointAugmentation> tpIid, DataBroker dataBroker); static Node getNode(Node node, List<TerminationPoint> tps,
            OvsdbBridgeAugmentation ovsdbBridgeAugmentation); static OvsdbBridgeAugmentation buildOvsdbBridgeAugmentation(OvsdbBridgeAugmentation bridge,
            OvsdbNodeAugmentation ovsdbNode); static List<TerminationPoint> buildTerminationPoints(OvsdbBridgeAugmentation bridge,
            OvsdbTerminationPointAugmentation ovsdbTp, AbstractTunnelType tunnelType); static String generateTpName(OvsdbBridgeAugmentation bridge, AbstractTunnelType tunnelType); static OvsdbTerminationPointAugmentation buildOvsdbTerminationPointAugmentation(
            OvsdbBridgeAugmentation bridge, List<Options> options, AbstractTunnelType tunnelType); static void setOption(List<Options> options, String key, String value); static IpAddress getManagerIp(OvsdbNodeAugmentation ovsdbNode); static IpAddress getNodeIp(OvsdbNodeAugmentation ovsdbNode); static List<ControllerEntry> buildControllerEntries(IpAddress ip); static OvsdbNodeAugmentation getManagerNode(OvsdbBridgeAugmentation bridge, DataBroker dataBroker); static Node getTopologyNode(InstanceIdentifier<Node> nodeIid, DataBroker dataBroker); static void createTunnelPort(InstanceIdentifier<Node> nodeIid,
            Node node, AbstractTunnelType tunnelType, DataBroker dataBroker);  }